//
// time: Wed Feb 12 11:23:06 1997
//
// version: 3.1.1 (format), 3.1.4 (DX Beta)
//
//
//
// macro reference (direct): ConvertColorNameList ConvertColorNameListMacro.net
include "ConvertColorNameListMacro.net"
//
// Begin MDF
// MODULE BandColors
// CATEGORY Macros
// DESCRIPTION Band a 2D data set with stepped color map
// INPUT data; value list or string list or object; (none);  2D data set
// INPUT scalar_values; scalar or scalar list; (none);  list of scalar values for band dividing points
// INPUT color_list; object; (none);  list of colors; should be one more than in list of scalar values
// OUTPUT banded; color field;  banded 2D field
// OUTPUT colormap; field;  colormap used
// End MDF
//
// comment: This macro takes as input a 2D scalar field, a scalar list with n items and a list of colornames with n+1 items. It creates as output a banded version of the 2D field, colored using the list of given colors from min_of_data to max_of_data. As a second output, it gives the colormap, for use with the ColorBar module, for example.
// comment: 
// comment: This macro requires the macro ConvertColorNameListMacro, also found in this directory.
// comment: 
// comment:  (C) COPYRIGHT International Business Machines Corp. 1996.
// comment:  All Rights Reserved.
// comment:  Licensed Materials - Property of IBM
// workspace: width = 682, height = 587
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro BandColors(
 data
,scalar_values
,color_list
) -> (
 banded
,colormap
) {
    // 
    // node Input[3]: x = 124, y = 0, inputs = 0, label = Input
    // parameter: position = 2, name = 'scalar_values', value = ' ', descriptive = 0, description = ' list of scalar values for band dividing points', required = 1, visible = 1
    //
BandColors_Input_3_out_1 = scalar_values;
    // 
    // node Inquire[1]: x = 518, y = 208, inputs = 3, label = Inquire
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "items"
    //
BandColors_Inquire_1_out_1 = 
    Inquire(
    BandColors_Input_3_out_1,
    "items",
    NULL
    ) [instance: 1, cache: 1];
    // 
    // node Input[4]: x = 322, y = 1, inputs = 0, label = Input
    // parameter: position = 3, name = 'color_list', value = ' ', descriptive = 0, description = ' list of colors; should be one more than in list of scalar values', required = 1, visible = 1
    //
BandColors_Input_4_out_1 = color_list;
    // 
    // node Inquire[2]: x = 610, y = 204, inputs = 3, label = Inquire
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "items"
    //
BandColors_Inquire_2_out_1 = 
    Inquire(
    BandColors_Input_4_out_1,
    "items",
    NULL
    ) [instance: 2, cache: 1];
    // 
    // node Compute[1]: x = 532, y = 302, inputs = 3, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "$1 == $0 + 1 ? 1 : 2"
    // expression: value = colorlist_items == scalarlist_items + 1 ? 1 : 2
    // name[2]: value = scalarlist_items
    // name[3]: value = colorlist_items
    //
BandColors_Compute_1_out_1 = 
    Compute(
    "$1 == $0 + 1 ? 1 : 2",
    BandColors_Inquire_1_out_1,
    BandColors_Inquire_2_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Input[2]: x = 463, y = 318, inputs = 0, label = Input
    // parameter: position = 1, name = 'data', value = ' ', descriptive = 0, description = ' 2D data set', required = 1, visible = 1
    //
BandColors_Input_2_out_1 = data;
    // 
    // node Route[1]: x = 528, y = 399, inputs = 2, outputs = 2, label = Route
    //
BandColors_Route_1_out_1,
BandColors_Route_1_out_2 = 
    Route(
    BandColors_Compute_1_out_1,
    BandColors_Input_2_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Transmitter[1]: x = 499, y = 473, inputs = 1, label = data_xcvr
    //
data_xcvr = BandColors_Route_1_out_1;
    // 
    // node Receiver[1]: x = 8, y = 23, inputs = 1, label = data_xcvr
    //
BandColors_Receiver_1_out_1[cache: 0] = data_xcvr;
    // 
    // node Band[1]: x = 0, y = 137, inputs = 4, label = Band
    //
BandColors_Band_1_out_1 = 
    Band(
    BandColors_Receiver_1_out_1,
    BandColors_Input_3_out_1,
    NULL,
    NULL
    ) [instance: 1, cache: 1];
    // 
    // node Statistics[1]: x = 128, y = 131, inputs = 1, label = Statistics
    //
BandColors_Statistics_1_out_1,
BandColors_Statistics_1_out_2,
BandColors_Statistics_1_out_3,
BandColors_Statistics_1_out_4,
BandColors_Statistics_1_out_5 = 
    Statistics(
    BandColors_Receiver_1_out_1
    ) [instance: 1, cache: 1];
    // 
    // node List[2]: x = 223, y = 211, inputs = 3, label = List
    //
BandColors_List_2_out_1 = 
    List(
    BandColors_Statistics_1_out_4,
    BandColors_Input_3_out_1,
    BandColors_Statistics_1_out_5
    ) [instance: 2, cache: 1];
    // 
    // node ConvertColorNameList[1]: x = 333, y = 160, inputs = 1, label = ConvertColorNameList
    //
BandColors_ConvertColorNameList_1_out_1 = 
    ConvertColorNameList(
    BandColors_Input_4_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Construct[2]: x = 341, y = 256, inputs = 4, label = Construct
    //
BandColors_Construct_2_out_1 = 
    Construct(
    BandColors_List_2_out_1,
    NULL,
    NULL,
    BandColors_ConvertColorNameList_1_out_1
    ) [instance: 2, cache: 1];
    // 
    // node Color[1]: x = 156, y = 313, inputs = 5, label = Color
    //
BandColors_Color_1_out_1 = 
    Color(
    BandColors_Band_1_out_1,
    BandColors_Construct_2_out_1,
    NULL,
    NULL,
    NULL
    ) [instance: 1, cache: 1];
    // 
    // node Route[2]: x = 590, y = 399, inputs = 2, outputs = 2, label = Route
    // input[2]: defaulting = 0, visible = 1, type = 16777248, value = {"number of items in colorlist must = number items in scalar list + 1"}
    //
BandColors_Route_2_out_1,
BandColors_Route_2_out_2 = 
    Route(
    BandColors_Compute_1_out_1,
    {"number of items in colorlist must = number items in scalar list + 1"}
    ) [instance: 2, cache: 1];
    // 
    // node Message[3]: x = 573, y = 525, inputs = 3, label = Message
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "error"
    // input[3]: defaulting = 0, visible = 1, type = 3, value = 1
    //
    Message(
    BandColors_Route_2_out_2,
    "error",
    1
    ) [instance: 3, cache: 1];
    // 
    // node Output[2]: x = 154, y = 433, inputs = 1, label = Output
    // parameter: position = 1, name = 'banded', value = ' ', descriptive = 0, description = ' banded 2D field', required = 0, visible = 1
    //
banded = BandColors_Color_1_out_1;
    // 
    // node Output[3]: x = 288, y = 441, inputs = 1, label = Output
    // parameter: position = 2, name = 'colormap', value = ' ', descriptive = 0, description = ' colormap used', required = 0, visible = 1
    //
colormap = BandColors_Construct_2_out_1;
// network: end of macro body
}
BandColors_Input_3_out_1 = NULL;
BandColors_Inquire_1_out_1 = NULL;
BandColors_Input_4_out_1 = NULL;
BandColors_Inquire_2_out_1 = NULL;
BandColors_Compute_1_out_1 = NULL;
BandColors_Input_2_out_1 = NULL;
BandColors_Route_1_out_1 = NULL;
BandColors_Transmitter_1_out_1 = NULL;
BandColors_Receiver_1_out_1 = NULL;
BandColors_Band_1_out_1 = NULL;
BandColors_Statistics_1_out_4 = NULL;
BandColors_Statistics_1_out_5 = NULL;
BandColors_List_2_out_1 = NULL;
BandColors_ConvertColorNameList_1_out_1 = NULL;
BandColors_Construct_2_out_1 = NULL;
BandColors_Color_1_out_1 = NULL;
BandColors_Route_2_out_2 = NULL;
