// // time: Wed Apr 24 07:50:22 1996 // // version: 3.0.0 (format), 3.1.0 (DX) // // // Begin MDF // MODULE ConvertToCellCentered // CATEGORY Transformation // DESCRIPTION Forces data to be treated as cell-centered without interpolation // INPUT field; group or series or value list or string list; (none); field to be converted // OUTPUT cell_centered; field; field converted to be cell-centered // End MDF // // comment: This program converts a field from positions-dependent to connections-dependent without interpolating data as would be the case for Post. This program is intended to be used for cases where data can only be imported as positions-dependent because the original structure does // comment: not make a distinction between positions-dependent and connections-dependent and Data Explorer assumes a default of positions-dependent (i.e., CDF, netCDF and HDF). Since that information is not typically imbedded in the file, only the user would be aware that such a transformation would be required. In such cases, the bounding box for the data is not exactly correct, which Post preserves. This program would make the appropriate adjustment. This problem occurs often for gridded observational data in the earth and space sciences. // comment: // comment: // comment: (C) COPYRIGHT International Business Machines Corp. 1996. // comment: All Rights Reserved. // comment: Licensed Materials - Property of IBM // comment: // comment: Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. // comment: // comment: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THE SOFTWARE, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IBM DOES NOT WARRANT AGAINST THE INFRINGMENT OF PATENTS, COPYRIGHT OR ANY OTHER INTELLECTUAL PROPERTY RIGHTS OF OTHERS. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, IS WITH YOU. // workspace: width = 487, height = 962 // layout: snap = 0, width = 50, height = 50, align = UL // macro ConvertToCellCentered( field ) -> ( cell_centered ) { // // node Input[1]: x = 164, y = 0, inputs = 0, label = Input // parameter: position = 1, name = 'field', value = ' ', descriptive = 0, description = 'field to be converted', required = 1, visible = 1 // ConvertToCellCentered_Input_1_out_1 = field; // // node Inquire[9]: x = 49, y = 70, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "is group" // input[3]: visible = 0 // ConvertToCellCentered_Inquire_9_out_1 = Inquire( ConvertToCellCentered_Input_1_out_1, "is group", NULL ) [instance: 9, cache: 1]; // // node Compute[108]: x = 54, y = 150, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0+1" // expression: value = a+1 // name[2]: value = a // ConvertToCellCentered_Compute_108_out_1 = Compute( "$0+1", ConvertToCellCentered_Inquire_9_out_1 ) [instance: 108, cache: 1]; // // node Select[10]: x = 267, y = 77, inputs = 3, label = Select // ConvertToCellCentered_Select_10_out_1[cache: 0] = Select( ConvertToCellCentered_Input_1_out_1, NULL, NULL ) [instance: 10, cache: 1]; // // node Switch[44]: x = 157, y = 195, inputs = 3, label = Switch // ConvertToCellCentered_Switch_44_out_1[cache: 0] = Switch( ConvertToCellCentered_Compute_108_out_1, ConvertToCellCentered_Input_1_out_1, ConvertToCellCentered_Select_10_out_1 ) [instance: 44, cache: 1]; // // node Extract[2]: x = 0, y = 439, inputs = 2, label = Extract // ConvertToCellCentered_Extract_2_out_1[cache: 0] = Extract( ConvertToCellCentered_Switch_44_out_1, NULL ) [instance: 2, cache: 1]; // // node Options[1]: x = 48, y = 542, inputs = 5, label = Options // input[2]: defaulting = 0, visible = 1, type = 32, value = "dep" // input[3]: defaulting = 0, visible = 1, type = 32, value = "connections" // input[4]: visible = 0 // input[5]: visible = 0 // ConvertToCellCentered_Options_1_out_1[cache: 0] = Options( ConvertToCellCentered_Extract_2_out_1, "dep", "connections", NULL, NULL ) [instance: 1, cache: 1]; // // node Inquire[3]: x = 114, y = 300, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "origin" // input[3]: visible = 0 // ConvertToCellCentered_Inquire_3_out_1 = Inquire( ConvertToCellCentered_Switch_44_out_1, "origin", NULL ) [instance: 3, cache: 1]; // // node Inquire[10]: x = 215, y = 293, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "deltas" // input[3]: visible = 0 // ConvertToCellCentered_Inquire_10_out_1 = Inquire( ConvertToCellCentered_Switch_44_out_1, "deltas", NULL ) [instance: 10, cache: 1]; // // node Inquire[1]: x = 303, y = 290, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "is 3dpositions" // input[3]: visible = 0 // ConvertToCellCentered_Inquire_1_out_1 = Inquire( ConvertToCellCentered_Switch_44_out_1, "is 3dpositions", NULL ) [instance: 1, cache: 1]; // // node Extract[1]: x = 432, y = 269, inputs = 2, label = Extract // input[2]: defaulting = 0, visible = 1, type = 32, value = "positions" // ConvertToCellCentered_Extract_1_out_1[cache: 0] = Extract( ConvertToCellCentered_Switch_44_out_1, "positions" ) [instance: 1, cache: 1]; // // node Inquire[2]: x = 364, y = 338, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "grid counts" // input[3]: visible = 0 // ConvertToCellCentered_Inquire_2_out_1 = Inquire( ConvertToCellCentered_Extract_1_out_1, "grid counts", NULL ) [instance: 2, cache: 1]; // // node Compute[1]: x = 322, y = 432, inputs = 3, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 ? [$1.x + 1, $1.y + 1, $1.z + 1] : [$1.x + 1, $1.y + 1]" // expression: value = a ? [b.x + 1, b.y + 1, b.z + 1] : [b.x + 1, b.y + 1] // name[2]: value = a // name[3]: value = b // ConvertToCellCentered_Compute_1_out_1 = Compute( "$0 ? [$1.x + 1, $1.y + 1, $1.z + 1] : [$1.x + 1, $1.y + 1]", ConvertToCellCentered_Inquire_1_out_1, ConvertToCellCentered_Inquire_2_out_1 ) [instance: 1, cache: 1]; // // node Construct[1]: x = 208, y = 500, inputs = 4, label = Construct // input[4]: visible = 0 // ConvertToCellCentered_Construct_1_out_1[cache: 0] = Construct( ConvertToCellCentered_Inquire_3_out_1, ConvertToCellCentered_Inquire_10_out_1, ConvertToCellCentered_Compute_1_out_1, NULL ) [instance: 1, cache: 1]; // // node Post[1]: x = 256, y = 582, inputs = 2, label = Post // input[2]: defaulting = 0, visible = 1, type = 32, value = "connections" // ConvertToCellCentered_Post_1_out_1[cache: 0] = Post( ConvertToCellCentered_Construct_1_out_1, "connections" ) [instance: 1, cache: 1]; // // node Replace[3]: x = 139, y = 788, inputs = 4, label = Replace // input[3]: visible = 0 // input[4]: visible = 0 // ConvertToCellCentered_Replace_3_out_1[cache: 2] = Replace( ConvertToCellCentered_Options_1_out_1, ConvertToCellCentered_Post_1_out_1, NULL, NULL ) [instance: 3, cache: 1]; // // node Output[1]: x = 141, y = 899, inputs = 1, label = Output // parameter: position = 1, name = 'cell_centered', value = ' ', descriptive = 0, description = 'field converted to be cell-centered', required = 0, visible = 1 // cell_centered = ConvertToCellCentered_Replace_3_out_1; // network: end of macro body } ConvertToCellCentered_Input_1_out_1 = NULL; ConvertToCellCentered_Inquire_9_out_1 = NULL; ConvertToCellCentered_Compute_108_out_1 = NULL; ConvertToCellCentered_Select_10_out_1 = NULL; ConvertToCellCentered_Switch_44_out_1 = NULL; ConvertToCellCentered_Extract_2_out_1 = NULL; ConvertToCellCentered_Options_1_out_1 = NULL; ConvertToCellCentered_Inquire_3_out_1 = NULL; ConvertToCellCentered_Inquire_10_out_1 = NULL; ConvertToCellCentered_Inquire_1_out_1 = NULL; ConvertToCellCentered_Extract_1_out_1 = NULL; ConvertToCellCentered_Inquire_2_out_1 = NULL; ConvertToCellCentered_Compute_1_out_1 = NULL; ConvertToCellCentered_Construct_1_out_1 = NULL; ConvertToCellCentered_Post_1_out_1 = NULL; ConvertToCellCentered_Replace_3_out_1 = NULL;