[Go to Previous] [Go to Next]


Modify the Layer Object

doRemove - Removes a displayed layer

Usage: layer.doRemove()
Example:
layer.doRemove()
Remarks:
This function removes a displayed layer. The user can specify the name of the layer used at createLayer() or by specifying a layer index from the array returned by getLayers().

getData - Returns a data object associated with the layer

Usage: myDataLayer.getData()
Example:
layerData = layer.getData()
Remarks:
The data object returned from the getData function (layerData from the above example) can now be passed through various formulas

getDisplayUnit - Returns the unit of a displayed layer

Usage: myDataLayer.getDisplayUnit()
Example:
layer.getDisplayUnit()

getLayer - Returns a reference to a displayed layer

Usage: layer = panel[0].getLayer(index)
Example:
satLayer = panel[0].getLayer[1]
Remarks:
This function returns a reference to a displayed error, which allows for passing this layer through other functions such as setLayerVisible(), setEnhancement(), and setLayerLabel(). The numerical value in the square brackets after getLayer in the example is the layer's index in the display. The index of displays in the displays begins with 0, which is the first layer displayed in the panel (normally the map layer). The second layer displayed would be index 1, the third layer display would be index 2, and so on.

getLayers - Returns a list of layer objects in the referenced display panel

Usage: layers = panel[0].getLayers()
Example:
layers = panel[0].getLayers()
satLayer = layers[1]
Remarks:
This function returns list of layers in the display panel. The first layer in the list, index 0 (zero) will be the first layer displayed, generally the map layer. Using this function in the above example, the satLayer object can then be passed through other functions such as setLayerVisible(), setEnhancement(), and setLayerLabel(). The numerical value in the square brackets after getLayer in the example is the layer's index in the display. The index of displays in the displays begins with 0, which is the first layer displayed in the panel (normally the map layer). The second layer displayed would be index 1, the third layer display would be index 2, and so on.

setColorScale - Displays color scale on a panel and specifies its attributes

Usage: myDataLayer.setColorScale(keywords)
Keywords - optional:
visible= True - displays color scale (default)
placement= location of color scale
'Top' (default)
'Bottom'
'Left'
'Right'
font= name of font; default = font defined in User Preferences
style= font style; default=font defined in user preferences
'BOLD' - bolded font
'ITALIC' - italicized font
'NONE'
size= size of font; default = size of font defined in User Preferences
color= 'color name'; default = color defined in User Preferences
-or-
[R,G,B] fractional scaling factor for each red, green and blue value (0.0 to 1.0)
showUnit= toggles the visibility of the display unit on the color scale (default = False)
Example:
layer.setColorScale(placement='Left',font='SansSerif',size=18.0,color='green',showUnit=True)

setDisplayUnit - Sets the unit of a displayed layer

Usage: myDataLayer.getDisplayUnit()
Keywords - required:
unitname= Sets the unit to be applied to the displayed layer.
Example:
layer.setDisplayUnit('hPa')

setEnhancement - Applies a color table and defines data range of data in a layer

Usage: myDataLayer.setEnhancement(keywords)
Keywords - required:
color table = color table name e.g., 'Longwave Infrared Deep Convection'
Keywords - optional:
range= (min,max) enhancement range; default = (min,max) of data
transparency= transparency to apply to entire enhancement. The valid range is 0 - 100, with 0 being opaque and 100 being 100% transparent; default=0
Example:
layer.setEnhancement('Longwave Infrared Deep Convection',range=(20,250),transparency=20)

setExtraLegendLabel - Sets the Extra Legend Label of the displayed layer. The Extra Legend Label is the text that lists below the blue Legend Label in the Legend of the Main Display window

Usage: myDataLayer.setExtraLegendLabel(keywords)
Keywords - required:
text= extra legend label string. This can include the macros included in the Remarks of setLayerLabel. Multiple lines can be created by using the HTML new line character: \n
Example:
layer.setExtraLegendLabel(text='%level%\n%shortname%')

setLayerLabel - Toggles a layer label on/off and defines its attributes

Usage: myDataLayer.setLayerLabel(keywords)
Keywords - required:
label = layer label string. This can include macros
Keywords - optional:
visible= True - displays layer label(default)
font= name of font; default = font defined in User Preferences.
style= font style; default = font defined in user preferences
'BOLD' - bolded font
'ITALIC' - italicized font
'NONE'
size= size of font; default = size of font defined in User Preferences
color= 'color name'; default = color defined in User Preferences
-or-
[R,G,B] fractional scaling factor for each red, green and blue value (0.0 to 1.0)
Example:
layer.setLayerLabel('%displayname% %timestamp%', size=15, color='blue', style='BOLD')
layer.setLayerLabel('%timestamp% - GOES East image', size=15, color='blue', style='BOLD')
Remarks:
There are a variety of macros that can be passed into the label keyword. Note that these macros must be contained within the label= string so they must be surrounded by quotes. These macros may differ between data sources and can include:
%displayname% The name of the display
%shortname% Shot name of parameter being displayed
%longname% Long name of parameter being displayed
%displayunit% Unit of parameter being displayed
%timestamp% Lists the timestep of parameter currently being displayed. This defaults to the time format in the User Preferences. The time format can be changed by using the macro in the form of:
%time:<time pattern>%
For example:
%time:HHz EEE dd MMM yyyy% would show something like 20UTC Wed 02 Dec 2015
%fhour% Forecast hour of grid being displayed followed by an 'H' for hour
%fhour2% Forecast hour of grid being displayed without being followed by an 'H' for hour
%level% Lists the vertical level of the parameter being displayed

setLayerVisible- Toggles layer visibility on/off, this includes any color scale or layer labels for the layer

Usage: myDataLayer.setLayerVisible(keywords)
Keywords - required:
visible= sets the visibility of the layer
True - displays the layer
False - does not display the layer
Example:
layer.setLayerVisible(visible=False)

setLegendLabel - Sets the Legend Label of the displayed layer. The Legend Label is the blue text of the layer seen in the Legend of the Main Display window

Usage: myDataLayer.setLegendLabel(keywords)
Keywords - required:
text= legend label string. This can include the macros included in the Remarks of setLayerLabel
Example:
layer.setLayerLabel(text='Layer 1')

setVerticalPosition - Sets the vertical positioning of the layer in the Main Display. The acceptable values range from -1 (bottom) to 1 (top)

Usage: myDataLayer.setLayerVisible(keywords)
Keywords - required:
verticalPosition= Sets the vertical positioning of the layer in the Main Display.
Example:
layer.setVerticalPosition(1)

[Go to Previous] [Go to Next]