[Go to Previous] [Go to Next]


Modify the Layer Object

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)

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)

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')
Remarks:
There are a variety of macros that can be passed into the label keyword. 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)

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)

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

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.

[Go to Previous] [Go to Next]