# Metview Macro - created from Display Window contents
# By:   dev
# Date: Tue May 10 13:12:07 2011
# For:  cgr (Sandor Kertesz)
# 
# Disclaimer:
#   This macro is to be used primarily as a framework. 
#   Some macros generated in this manner may not work  
#   as expected and in such cases you may need to 
#   fine-tune the macro manually! 
  
# Device Description 
File = ps_output(  
		OUTPUT_NAME : '/home/graphics/cgr/metview//Local/OGC/Tutorial/ps' 
	) 
  
# Checks running mode  
mode = runmode()  
if mode = 'batch' or mode = 'execute' then  
          setoutput(File)  
end if  
  
# Call function to build layout (defined at end of macro)
display_window = build_layout()

# Drops to SuperPage.
  
# Data and Visualisation parameters 
  

# Drops to Page.
  
# Data and Visualisation parameters 
  
NASA = wmsclient(  
		SERVER            : "http://neowms.sci.gsfc.nasa.gov/wms/wms", 
		VERSION           : "Default", 
		REQUEST           : "http://neowms.sci.gsfc.nasa.gov/wms/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=AVHRR_SST_M&STYLES=rgb&CRS=CRS:84&BBOX=-180.0,-90.0,180.0,90.0&WIDTH=1024&HEIGHT=512&FORMAT=image/png&TRANSPARENT=TRUE&TIME=2006-12-01", 
		EXTRA_GETCAP_PAR  : "", 
		EXTRA_GETMAP_PAR  : "", 
		HTTP_USER         : "", 
		HTTP_PASSWORD     : "", 
		LAYER_TITLE       : "Sea Surface Temperature 1981-2006 (1 month - AVHRR)", 
		LAYER_DESCRIPTION : "Sea surface temperature is the temperature of the top millimeter of the ocean's surface. Sea surface temperatures influence weather, including hurricanes, as well as plant and animal life in the ocean. Like Earth's land surface, sea surface temperatures are warmer near the equator and colder near the poles. Currents like giant rivers move warm and cold water around the world's oceans. Some of these currents flow on the surface, and they are obvious in sea surface temperature images. These data are collected by an ongoing series of National Oceanic and Atmospheric Administration (NOAA) satellites.", 
		SERVICE_TITLE     : "NASA Earth Observations (NEO) WMS", 
		LAYER_LEGEND      : "http://neo.sci.gsfc.nasa.gov/palettes/files/global_sst.gif", 
		TIME_DIMENSIONS   : "TIME" 
	) 
  
# Plot command  
plot ( display_window[1], NASA ) 

# End of main program

# Function to build the layout.
function build_layout()

    #PageDescription  
    COASTLINES1 = mcoast(  
    		MAP_COASTLINE                 : 'ON', 
    		MAP_COASTLINE_COLOUR          : 'BLACK', 
    		MAP_COASTLINE_RESOLUTION      : 'AUTOMATIC', 
    		MAP_COASTLINE_STYLE           : 'SOLID', 
    		MAP_COASTLINE_THICKNESS       : 1, 
    		MAP_COASTLINE_LAND_SHADE      : 'OFF', 
    		MAP_COASTLINE_SEA_SHADE       : 'OFF', 
    		MAP_BOUNDARIES                : 'OFF', 
    		MAP_CITIES                    : 'OFF', 
    		MAP_RIVERS                    : 'OFF', 
    		MAP_GRID                      : 'ON', 
    		MAP_GRID_LATITUDE_REFERENCE   : 0, 
    		MAP_GRID_LATITUDE_INCREMENT   : 10, 
    		MAP_GRID_LONGITUDE_REFERENCE  : 0, 
    		MAP_GRID_LONGITUDE_INCREMENT  : 20, 
    		MAP_GRID_LINE_STYLE           : 'SOLID', 
    		MAP_GRID_THICKNESS            : 1, 
    		MAP_GRID_COLOUR               : 'BLACK', 
    		MAP_LABEL                     : 'ON', 
    		MAP_LABEL_QUALITY             : 'MEDIUM', 
    		MAP_LABEL_COLOUR              : 'UNDEFINED', 
    		MAP_LABEL_HEIGHT              : 0.25, 
    		MAP_LABEL_LATITUDE_FREQUENCY  : 1, 
    		MAP_LABEL_LONGITUDE_FREQUENCY : 1 
    	) 
    _MapView_ = mapview(  
    		MAP_PROJECTION              : 'CYLINDRICAL', 
    		AREA                        : [ -90,-180,90,180 ], 
    		SUBPAGE_X_POSITION          : 7.5, 
    		SUBPAGE_Y_POSITION          : 5, 
    		SUBPAGE_X_LENGTH            : 85, 
    		SUBPAGE_Y_LENGTH            : 85, 
    		PAGE_FRAME                  : 'ON', 
    		PAGE_FRAME_COLOUR           : 'BLUE', 
    		PAGE_FRAME_LINE_STYLE       : 'SOLID', 
    		PAGE_FRAME_THICKNESS        : 2, 
    		PAGE_ID_LINE                : 'OFF', 
    		PAGE_ID_LINE_TYPE           : 'BOTH', 
    		PAGE_ID_LINE_COLOUR         : 'BLUE', 
    		PAGE_ID_LINE_SYSTEM_PLOT    : 'OFF', 
    		PAGE_ID_LINE_DATE_PLOT      : 'OFF', 
    		PAGE_ID_LINE_USER_TEXT_PLOT : 'ON', 
    		PAGE_ID_LINE_ERRORS_PLOT    : 'OFF', 
    		PAGE_ID_LINE_LOGO_PLOT      : 'OFF', 
    		PAGE_ID_LINE_HEIGHT         : 0.25, 
    		PAGE_ID_LINE_QUALITY        : 'MEDIUM', 
    		SUBPAGE_FRAME               : 'ON', 
    		SUBPAGE_FRAME_COLOUR        : 'BLACK', 
    		SUBPAGE_FRAME_LINE_STYLE    : 'SOLID', 
    		SUBPAGE_FRAME_THICKNESS     : 2, 
    		SUBPAGE_BACKGROUND_COLOUR   : 'WHITE', 
    		COASTLINES                  : COASTLINES1 
    	) 
    Page2 = plot_page(  
    		TOP        : 0, 
    		BOTTOM     : 100, 
    		LEFT       : 0, 
    		RIGHT      : 100, 
    		ROWS       : 1, 
    		COLUMNS    : 1, 
    		PAGE_X_GAP : 0, 
    		PAGE_Y_GAP : 0, 
    		VIEW                     : _MapView_ 
    	)  
      
    # SuperPageDescription 
    _Display_Window_ = plot_superpage(  
    		LAYOUT_SIZE        : 'A4', 
    		LAYOUT_ORIENTATION : 'LANDSCAPE', 
    		CUSTOM_WIDTH       : 29.7, 
    		CUSTOM_HEIGHT      : 21.0, 
    		PAGES                    : [ Page2 ] 
    	) 
    # plot_superpage returns a list of drop identifiers. 
    # Index 1 is for first page, and so on. 
    # end of superpage definition  
      
    return _Display_Window_ 

end build_layout
