Plot-MODE-Field
Plot-MODE-Field griggs Wed, 04/24/2019 - 16:13Plot-MODE-Field Functionality
The Plot-MODE-Field tool reads one or more MODE NetCDF output files and creates PNG images to display the data. While other MET tools produce PostScript images (which may by converted to PNG using the ImageMagick convert tool), the Plot-MODE-Field tool produces PNG files directly. The downside is the additional external dependencies on the Cairo graphics and FreeType libraries. For this reason, the compilation of MODE-Graphics is disabled by default. If you did not configure MET with --enable-mode-graphics, you may proceed to the next tool.
Plot-MODE-Field Usage
View the usage statement for Plot-MODE-Field by simply typing the following:
At a minimum, the -raw | -simple | -cluster argument indicating the types of objects to be plotted, the -obs | -fcst argument specifying whether to plot the observed or forecast field from the MODE output files, the -config path specifying the configuration file to use for specification of plotting options, and the mode_nc_file_list specifying the MODE output files to be used for plotting must be specified on the command line.
Font Data
The Plot-MODE-Field uses GhostScript font data at runtime. Since this tool is optional, the font data is not included in the MET tarball. Prior to running Plot-MODE-Field, users must first download Ghostscript font data. Please follow the link, retrieve the tarball, and save it in the data directory. Unpack the tarball and define the MET_FONT_DIR environment variable to the full path of the newly created data/fonts directory.
Return to the top-level MET directory, if necessary.
Configure
Configure griggs Wed, 04/24/2019 - 16:14The behavior of Plot-MODE-Field is controlled by the contents of the configuration file passed to it on the command line. The default Plot-MODE-Field configuration file may be found in the $MET_BASE/config/PlotModeFieldConfig_default file. Prior to modifying the configuration file, users are advised to make a copy of the default:
Open up the $MET_TUTORIAL_DATA/config/PlotModeFieldConfig_tutorial file for editing with the text editor of your choice.
- In the plot_info dictionary, set output_directory = "${MET_TUTORIAL_DATA}/output/plot_mode_field";
To output the PNG file to the plot_mode_field output directory.
Save and close this file.
Run
Run griggs Wed, 04/24/2019 - 16:16The Plot-MODE-Field utility provides a way to visualize the MODE NetCDF output files through a PNG file. Run Plot-MODE-Field to plot the MODE output on the command line using the following command:
-simple -obs \
-config $MET_TUTORIAL_DATA/config/PlotModeFieldConfig_tutorial \
$MET_TUTORIAL_DATA/output/mode/mode_240000L_20050808_000000V_120000A_obj.nc
Note that mode_240000L_20050808_000000V_120000A_obj.nc was generated earlier in the tutorial by MODE.
Output
Output griggs Wed, 04/24/2019 - 16:17In this example, Plot-MODE-Field visualizes simple objects from an observed precipitation field using parameters from the configuration file PlotModeFieldConfig_tutorial which is indicated by the output file naming convention, _obj_obs_simple.
Display the output PNG file by running the following command:
Feel free to rerun this example to plot other fields. Switch -obs to -fcst for forecast data or -simple to -cluster or -raw.
In this example, we passed a single NetCDF MODE output file to Plot-MODE-Field. However, when you pass it multiple files on the command line it creates a plot for each.