// // time: Wed Apr 24 07:44:47 1996 // // version: 3.0.0 (format), 3.1.0 (DX) // // // Begin MDF // MODULE AutoRegrid // CATEGORY Realization // DESCRIPTION Regrids a field of scattered positions // INPUT scattered; group or series or value list or string list; (none); field with positions to regrid // INPUT nearest[visible:0]; integer or string; 3; number of nearest neighbors to use // INPUT exponent[visible:0]; scalar; 2; weighting exponent // INPUT missing[visible:0]; value; (no default); missing value to insert, if necessary // OUTPUT gridded; field; gridded field // OUTPUT grid; field; grid used for interpolation // End MDF // // comment: Given a set of scattered points, this macro interpolates the scattered points onto a regular grid computed from the bounding box and the number of points using Regrid. Refer to the description of Regrid for more information. // 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 = 1180, height = 1429 // layout: snap = 0, width = 50, height = 50, align = UL // macro AutoRegrid( scattered ,nearest = 3 ,exponent = 2 ,missing ) -> ( gridded ,grid ) { // // node Input[1]: x = 121, y = 0, inputs = 0, label = Input // parameter: position = 1, name = 'scattered', value = ' ', descriptive = 0, description = 'field with positions to regrid', required = 1, visible = 1 // AutoRegrid_Input_1_out_1 = scattered; // // node Inquire[7]: x = 23, y = 90, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "is group" // input[3]: visible = 0 // AutoRegrid_Inquire_7_out_1 = Inquire( AutoRegrid_Input_1_out_1, "is group", NULL ) [instance: 7, cache: 1]; // // node Compute[2]: x = 24, y = 171, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0+1" // expression: value = a+1 // name[2]: value = a // AutoRegrid_Compute_2_out_1 = Compute( "$0+1", AutoRegrid_Inquire_7_out_1 ) [instance: 2, cache: 1]; // // node Select[6]: x = 195, y = 100, inputs = 3, label = Select // input[2]: visible = 0 // AutoRegrid_Select_6_out_1 = Select( AutoRegrid_Input_1_out_1, NULL, NULL ) [instance: 6, cache: 1]; // // node Switch[42]: x = 110, y = 233, inputs = 3, label = Switch // AutoRegrid_Switch_42_out_1 = Switch( AutoRegrid_Compute_2_out_1, AutoRegrid_Input_1_out_1, AutoRegrid_Select_6_out_1 ) [instance: 42, cache: 1]; // // node Transmitter[61]: x = 1, y = 292, inputs = 1, label = points // points = AutoRegrid_Switch_42_out_1; // // node Receiver[263]: x = 779, y = 0, inputs = 1, label = points // AutoRegrid_Receiver_263_out_1 = points; // // node Inquire[8]: x = 845, y = 44, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 0, type = 32, value = "is 3dpositions" // input[3]: visible = 0 // AutoRegrid_Inquire_8_out_1 = Inquire( AutoRegrid_Receiver_263_out_1, "is 3dpositions", NULL ) [instance: 8, cache: 1]; // // node Transmitter[60]: x = 769, y = 139, inputs = 1, label = is_3d // is_3d = AutoRegrid_Inquire_8_out_1; // // node Receiver[261]: x = 36, y = 616, inputs = 1, label = is_3d // AutoRegrid_Receiver_261_out_1 = is_3d; // // node Extract[1]: x = 319, y = 283, inputs = 2, label = Extract // input[2]: defaulting = 0, visible = 0, type = 32, value = "box" // AutoRegrid_Extract_1_out_1 = Extract( AutoRegrid_Switch_42_out_1, "box" ) [instance: 1, cache: 1]; // // node Compute[101]: x = 149, y = 405, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0.x" // expression: value = a.x // name[2]: value = a // AutoRegrid_Compute_101_out_1 = Compute( "$0.x", AutoRegrid_Extract_1_out_1 ) [instance: 101, cache: 1]; // // node Statistics[3]: x = 147, y = 495, inputs = 1, label = Statistics // output[1]: visible = 0 // output[2]: visible = 0 // output[3]: visible = 0 // AutoRegrid_Statistics_3_out_1, AutoRegrid_Statistics_3_out_2, AutoRegrid_Statistics_3_out_3, AutoRegrid_Statistics_3_out_4, AutoRegrid_Statistics_3_out_5 = Statistics( AutoRegrid_Compute_101_out_1 ) [instance: 3, cache: 1]; // // node Compute[102]: x = 370, y = 410, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0.y" // expression: value = a.y // name[2]: value = a // AutoRegrid_Compute_102_out_1 = Compute( "$0.y", AutoRegrid_Extract_1_out_1 ) [instance: 102, cache: 1]; // // node Statistics[4]: x = 372, y = 505, inputs = 1, label = Statistics // output[1]: visible = 0 // output[2]: visible = 0 // output[3]: visible = 0 // AutoRegrid_Statistics_4_out_1, AutoRegrid_Statistics_4_out_2, AutoRegrid_Statistics_4_out_3, AutoRegrid_Statistics_4_out_4, AutoRegrid_Statistics_4_out_5 = Statistics( AutoRegrid_Compute_102_out_1 ) [instance: 4, cache: 1]; // // node Receiver[266]: x = 482, y = 396, inputs = 1, label = is_3d // AutoRegrid_Receiver_266_out_1 = is_3d; // // node Compute[107]: x = 558, y = 448, inputs = 3, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 ? $1.z : 0" // expression: value = a ? b.z : 0 // name[2]: value = a // name[3]: value = b // AutoRegrid_Compute_107_out_1 = Compute( "$0 ? $1.z : 0", AutoRegrid_Receiver_266_out_1, AutoRegrid_Extract_1_out_1 ) [instance: 107, cache: 1]; // // node Statistics[5]: x = 558, y = 523, inputs = 1, label = Statistics // output[1]: visible = 0 // output[2]: visible = 0 // output[3]: visible = 0 // AutoRegrid_Statistics_5_out_1, AutoRegrid_Statistics_5_out_2, AutoRegrid_Statistics_5_out_3, AutoRegrid_Statistics_5_out_4, AutoRegrid_Statistics_5_out_5 = Statistics( AutoRegrid_Compute_107_out_1 ) [instance: 5, cache: 1]; // // node Compute[103]: x = 102, y = 686, inputs = 5, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 ? [$1, $2, $3] : [$1, $2]" // expression: value = a ? [x_min, y_min, z_min] : [x_min, y_min] // name[2]: value = a // name[3]: value = x_min // name[4]: value = y_min // name[5]: value = z_min // AutoRegrid_Compute_103_out_1 = Compute( "$0 ? [$1, $2, $3] : [$1, $2]", AutoRegrid_Receiver_261_out_1, AutoRegrid_Statistics_3_out_4, AutoRegrid_Statistics_4_out_4, AutoRegrid_Statistics_5_out_4 ) [instance: 103, cache: 1]; // // node Receiver[262]: x = 197, y = 767, inputs = 1, label = is_3d // AutoRegrid_Receiver_262_out_1 = is_3d; // // node Compute[104]: x = 258, y = 805, inputs = 6, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 ? [$2, $3, $4] - $1 : [$2, $3] - $1" // expression: value = a ? [x_max, y_max, z_max] - min : [x_max, y_max] - min // name[2]: value = a // name[3]: value = min // name[4]: value = x_max // name[5]: value = y_max // name[6]: value = z_max // AutoRegrid_Compute_104_out_1 = Compute( "$0 ? [$2, $3, $4] - $1 : [$2, $3] - $1", AutoRegrid_Receiver_262_out_1, AutoRegrid_Compute_103_out_1, AutoRegrid_Statistics_3_out_5, AutoRegrid_Statistics_4_out_5, AutoRegrid_Statistics_5_out_5 ) [instance: 104, cache: 1]; // // node Construct[1]: x = 132, y = 873, inputs = 4, label = Construct // input[3]: defaulting = 1, visible = 0, type = 1, value = 2 // input[4]: visible = 0 // AutoRegrid_Construct_1_out_1 = Construct( AutoRegrid_Compute_103_out_1, AutoRegrid_Compute_104_out_1, NULL, NULL ) [instance: 1, cache: 1]; // // node Receiver[264]: x = 417, y = 749, inputs = 1, label = points // AutoRegrid_Receiver_264_out_1 = points; // // node Inquire[1]: x = 421, y = 840, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "counts" // input[3]: defaulting = 0, visible = 1, type = 32, value = "data" // AutoRegrid_Inquire_1_out_1 = Inquire( AutoRegrid_Receiver_264_out_1, "counts", "data" ) [instance: 1, cache: 1]; // // node Receiver[260]: x = 550, y = 865, inputs = 1, label = is_3d // AutoRegrid_Receiver_260_out_1 = is_3d; // // node Compute[1]: x = 442, y = 911, inputs = 3, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$1 ? ($0 < 250 ? 2 : $0 < 50000 ? int(sqrt($0^.3333)) : 6) : ($0 < 1090 ? 5 : $0 < 6000000 ? int(sqrt(sqrt($0))/(log10($0)/2.) + 1.5) : int(sqrt(sqrt($0))/log10(sqrt($0)) - 0.5) )" // expression: value = b ? (a < 250 ? 2 : a < 50000 ? int(sqrt(a^.3333)) : 6) : (a < 1090 ? 5 : a < 6000000 ? int(sqrt(sqrt(a))/(log10(a)/2.) + 1.5) : int(sqrt(sqrt(a))/log10(sqrt(a)) - 0.5) ) // name[2]: value = a // name[3]: value = b // AutoRegrid_Compute_1_out_1 = Compute( "$1 ? ($0 < 250 ? 2 : $0 < 50000 ? int(sqrt($0^.3333)) : 6) : ($0 < 1090 ? 5 : $0 < 6000000 ? int(sqrt(sqrt($0))/(log10($0)/2.) + 1.5) : int(sqrt(sqrt($0))/log10(sqrt($0)) - 0.5) )", AutoRegrid_Inquire_1_out_1, AutoRegrid_Receiver_260_out_1 ) [instance: 1, cache: 1]; // // node Refine[1]: x = 133, y = 1005, inputs = 2, label = Refine // AutoRegrid_Refine_1_out_1 = Refine( AutoRegrid_Construct_1_out_1, AutoRegrid_Compute_1_out_1 ) [instance: 1, cache: 1]; // // node Output[2]: x = 33, y = 1043, inputs = 1, label = Output // parameter: position = 2, name = 'grid', value = ' ', descriptive = 0, description = 'grid used for interpolation', required = 0, visible = 1 // grid = AutoRegrid_Refine_1_out_1; // // node Receiver[265]: x = 34, y = 1201, inputs = 1, label = points // AutoRegrid_Receiver_265_out_1 = points; // // node Input[2]: x = 213, y = 1113, inputs = 0, label = Input // parameter: position = 2, name = 'nearest', value = '3', descriptive = 0, description = 'number of nearest neighbors to use', required = 0, visible = 0 // AutoRegrid_Input_2_out_1 = nearest; // // node Transmitter[27]: x = 297, y = 436, inputs = 1, label = box // box = AutoRegrid_Extract_1_out_1; // // node Receiver[228]: x = 916, y = 255, inputs = 1, label = box // AutoRegrid_Receiver_228_out_1 = box; // // node Select[7]: x = 915, y = 344, inputs = 3, label = Select // input[2]: visible = 0 // AutoRegrid_Select_7_out_1 = Select( AutoRegrid_Receiver_228_out_1, NULL, NULL ) [instance: 7, cache: 1]; // // node Compute[79]: x = 926, y = 140, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0+1" // expression: value = a+1 // name[2]: value = a // AutoRegrid_Compute_79_out_1 = Compute( "$0+1", AutoRegrid_Inquire_8_out_1 ) [instance: 79, cache: 1]; // // node Receiver[227]: x = 1086, y = 15, inputs = 1, label = box // AutoRegrid_Receiver_227_out_1 = box; // // node Select[9]: x = 1026, y = 158, inputs = 3, label = Select // input[2]: defaulting = 0, visible = 0, type = 1, value = 3 // AutoRegrid_Select_9_out_1 = Select( AutoRegrid_Receiver_227_out_1, 3, NULL ) [instance: 9, cache: 1]; // // node Select[8]: x = 1130, y = 190, inputs = 3, label = Select // input[2]: defaulting = 0, visible = 0, type = 1, value = 7 // AutoRegrid_Select_8_out_1 = Select( AutoRegrid_Receiver_227_out_1, 7, NULL ) [instance: 8, cache: 1]; // // node Switch[43]: x = 1009, y = 383, inputs = 3, label = Switch // AutoRegrid_Switch_43_out_1 = Switch( AutoRegrid_Compute_79_out_1, AutoRegrid_Select_9_out_1, AutoRegrid_Select_8_out_1 ) [instance: 43, cache: 1]; // // node Compute[80]: x = 859, y = 453, inputs = 4, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 ? sqrt( ($2.x - $1.x)*($2.x - $1.x) + ($2.y - $1.y)*($2.y - $1.y) + ($2.z-$1.z)*($2.z-$1.z) ) : sqrt( ($2.x - $1.x)*($2.x - $1.x) + ($2.y - $1.y)*($2.y - $1.y) ) " // expression: value = a ? sqrt( (c.x - b.x)*(c.x - b.x) + (c.y - b.y)*(c.y - b.y) + (c.z-b.z)*(c.z-b.z) ) : sqrt( (c.x - b.x)*(c.x - b.x) + (c.y - b.y)*(c.y - b.y) ) // name[2]: value = a // name[3]: value = b // name[4]: value = c // AutoRegrid_Compute_80_out_1 = Compute( "$0 ? sqrt( ($2.x - $1.x)*($2.x - $1.x) + ($2.y - $1.y)*($2.y - $1.y) + ($2.z-$1.z)*($2.z-$1.z) ) : sqrt( ($2.x - $1.x)*($2.x - $1.x) + ($2.y - $1.y)*($2.y - $1.y) ) ", AutoRegrid_Inquire_8_out_1, AutoRegrid_Select_7_out_1, AutoRegrid_Switch_43_out_1 ) [instance: 80, cache: 1]; // // node Compute[81]: x = 949, y = 560, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 == 0.0 ? 1.0e30 : $0" // expression: value = a == 0.0 ? 1.0e30 : a // name[2]: value = a // AutoRegrid_Compute_81_out_1 = Compute( "$0 == 0.0 ? 1.0e30 : $0", AutoRegrid_Compute_80_out_1 ) [instance: 81, cache: 1]; // // node Transmitter[62]: x = 970, y = 678, inputs = 1, label = radius // radius = AutoRegrid_Compute_81_out_1; // // node Receiver[267]: x = 267, y = 1164, inputs = 1, label = radius // AutoRegrid_Receiver_267_out_1 = radius; // // node Input[4]: x = 334, y = 1172, inputs = 0, label = Input // parameter: position = 3, name = 'exponent', value = '2', descriptive = 0, description = 'weighting exponent', required = 0, visible = 0 // AutoRegrid_Input_4_out_1 = exponent; // // node Input[5]: x = 427, y = 1197, inputs = 0, label = Input // parameter: position = 4, name = 'missing', value = '(no default)', descriptive = 1, description = 'missing value to insert, if necessary', required = 0, visible = 0 // AutoRegrid_Input_5_out_1 = missing; // // node Regrid[1]: x = 172, y = 1269, inputs = 6, label = Regrid // AutoRegrid_Regrid_1_out_1 = Regrid( AutoRegrid_Receiver_265_out_1, AutoRegrid_Refine_1_out_1, AutoRegrid_Input_2_out_1, AutoRegrid_Receiver_267_out_1, AutoRegrid_Input_4_out_1, AutoRegrid_Input_5_out_1 ) [instance: 1, cache: 1]; // // node Output[1]: x = 264, y = 1366, inputs = 1, label = Output // parameter: position = 1, name = 'gridded', value = ' ', descriptive = 0, description = 'gridded field', required = 0, visible = 1 // gridded = AutoRegrid_Regrid_1_out_1; // network: end of macro body } AutoRegrid_Input_1_out_1 = NULL; AutoRegrid_Inquire_7_out_1 = NULL; AutoRegrid_Compute_2_out_1 = NULL; AutoRegrid_Select_6_out_1 = NULL; AutoRegrid_Switch_42_out_1 = NULL; AutoRegrid_Transmitter_61_out_1 = NULL; AutoRegrid_Receiver_263_out_1 = NULL; AutoRegrid_Inquire_8_out_1 = NULL; AutoRegrid_Transmitter_60_out_1 = NULL; AutoRegrid_Receiver_261_out_1 = NULL; AutoRegrid_Extract_1_out_1 = NULL; AutoRegrid_Compute_101_out_1 = NULL; AutoRegrid_Statistics_3_out_4 = NULL; AutoRegrid_Statistics_3_out_5 = NULL; AutoRegrid_Compute_102_out_1 = NULL; AutoRegrid_Statistics_4_out_4 = NULL; AutoRegrid_Statistics_4_out_5 = NULL; AutoRegrid_Receiver_266_out_1 = NULL; AutoRegrid_Compute_107_out_1 = NULL; AutoRegrid_Statistics_5_out_4 = NULL; AutoRegrid_Statistics_5_out_5 = NULL; AutoRegrid_Compute_103_out_1 = NULL; AutoRegrid_Receiver_262_out_1 = NULL; AutoRegrid_Compute_104_out_1 = NULL; AutoRegrid_Construct_1_out_1 = NULL; AutoRegrid_Receiver_264_out_1 = NULL; AutoRegrid_Inquire_1_out_1 = NULL; AutoRegrid_Receiver_260_out_1 = NULL; AutoRegrid_Compute_1_out_1 = NULL; AutoRegrid_Refine_1_out_1 = NULL; AutoRegrid_Receiver_265_out_1 = NULL; AutoRegrid_Input_2_out_1 = NULL; AutoRegrid_Transmitter_27_out_1 = NULL; AutoRegrid_Receiver_228_out_1 = NULL; AutoRegrid_Select_7_out_1 = NULL; AutoRegrid_Compute_79_out_1 = NULL; AutoRegrid_Receiver_227_out_1 = NULL; AutoRegrid_Select_9_out_1 = NULL; AutoRegrid_Select_8_out_1 = NULL; AutoRegrid_Switch_43_out_1 = NULL; AutoRegrid_Compute_80_out_1 = NULL; AutoRegrid_Compute_81_out_1 = NULL; AutoRegrid_Transmitter_62_out_1 = NULL; AutoRegrid_Receiver_267_out_1 = NULL; AutoRegrid_Input_4_out_1 = NULL; AutoRegrid_Input_5_out_1 = NULL; AutoRegrid_Regrid_1_out_1 = NULL;