wiki:access/UtilsWG/UtilWgDocs/NWP_Plotting_um/vn1.0.0

NWP Plotting User Manual

Wenming LU
lwenming@bom.gov.au
Created 05 April 2017 based on NWP_PLOT vn1.0.0

Introduction

NWP_PLOT 1.0.0 is a python/matplotlib/iris app in which nwp_plot.py plots UM data in pp, grib2 and netCDF format. NWP_PLOT produces ten standard plots: mslp_Precip, mslp_Thik, screen_Dewpoint, Screen_Temperature, Screen_Relative_Humidity, 10m_Wind, 200/500/700/850hPa Temperature, Relative_Humidity and HtWind, and 200/500/700/850/900hPa wind. Sample plots can be viewed at https://accessdev.nci.org.au/~wml548/charts/aps2/nwp/.

NWP_PLOT anyplot.py plots any field in a pp, grib2 or netCDF file and also is able to plot the difference of a field between two files for the same region (The two forecasts share the same spatial resolution).

NWP_PLOT Module

This application NWP_PLOT 1.0.0 or 1.1.0 is provided as a module at raijin:/projects/access/modules. To load the module,

module use /projects/access/modules
module load nwp_plot/1.0.0  #or module load nwp_plot/1.1.0 for APS3 plotting

NWP_PLOT Arguments in Details

After load the module, run nwppot.py

wml548@raijin4 ~]$nwpplot.py --help
usage: nwpplot.py [-h] --plot PLOT --model MODEL [--range RANGE]
                  [--perspective PERSPECTIVE] [--template TEMPLATE]
                  [--plotsetting PLOTSETTING] [--inputsfc INPUTS]
                  [--inputpres INPUTP] [--inputrain INPUTR] [--output OUTPUT]
                  [--date YYYYMMDD] [--time HH] [--step STEP]
                  [--levtype LEVTYPE] [--levelist LEVELIST]
                  [--raingap RAINGAP] [-v VERBOSE]

Plot NWP Charts

optional arguments:
  -h, --help            show this help message and exit
  --plot PLOT           plot type
  --model MODEL         NWP Model Name
  --range RANGE         Plotting Range
  --perspective PERSPECTIVE
                        Plot Perspective
  --template TEMPLATE   Common Plot Settings
  --plotsetting PLOTSETTING
                        User Plot Settings
  --inputsfc INPUTS     NWP Surface Data File
  --inputpres INPUTP    NWP Pressure Level Data File
  --inputrain INPUTR    NWP Rainfall Data file
  --output OUTPUT       Plotted Chart Name
  --date YYYYMMDD       FCST Base Date
  --time HH             FCST Run Time
  --step STEP           Dataset Step
  --levtype LEVTYPE     Dataset Level Type
  --levelist LEVELIST   Pressure Level
  --raingap RAINGAP     Precipitaion Interval
  -v VERBOSE, --verbose VERBOSE
                        Print Out Data & Chart Details

The following table explains all switches in details,

SWITCH DESCRIPTION DETAILED EXPLANATION
-h, --help show help message and exit
--plot plot type must be provided; choices are mp, mt, temp, rh, dew, wind and ht
--model NWP Model Name msut be provided, such as ACCESS_C and ACCESS_G
--range Plotting Range full domain is plotted as default
--perspective Plot Perspective default NORMAL; can be POLAR as well
--template Common Plot Settings usual settings for certain nwp, e.g., city_1.5km for APS2 City models
--plotsetting User Plot Settings user personal settings for plotting
--inputsfc NWP Surface Data File sfc input data; needed for mp, dew, mt, screen level temp, rh and wind
--inputpres NWP Pressure Level Data File pres. lvl input data; needed for mt, ht and pre. level temp, rh and wind
--inputrain NWP Rainfall Data file second sfc input data for calculating rainfall
--output Plotted Chart Name PNG image name for the output
--date FCST Base Date forecast date
--time FCST Run Time forecast time
--step Dataset Step forecast hour to the forecast time
--levtype Dataset Level Type default sfc; can be pl for pres. level plotting
--levelist Pressure Level specific pressure level, e.g., 200 for 200hPa
--raingap Precipitation Interval time difference for precipitation, e.g., 1 for last 1 hour rainfall and 24 for 24 hours rainfall
-v VERBOSE, --verbose Print Out Data & Chart Details

run anyplot.py,

wml548@raijin4 ~]$anyplot.py -h
usage: anyplot.py [-h] [--plot PLOT] [--model MODEL] [--range RANGE]
                  [--perspective PERSPECTIVE] [--template TEMPLATE]
                  [--plotsetting PLOTSETTING] --input INPUT
                  [--inputcomp INPUTC] [--output OUTPUT] [--date YYYYMMDD]
                  [--time HH] [--step STEP] --field FIELD
                  [--cellmethod METHOD] [--levtype LEVTYPE]
                  [--levelist LEVELIST] [--unit UNIT] [--tick TICK]
                  [-v VERBOSE]

Plot NWP Charts

optional arguments:
  -h, --help            show this help message and exit
  --plot PLOT           plot type
  --model MODEL         NWP Model Name
  --range RANGE         Plotting Range
  --perspective PERSPECTIVE
                        Plot Perspective
  --template TEMPLATE   Common Plot Settings
  --plotsetting PLOTSETTING
                        User Plot Settings
  --input INPUT         NWP Data File
  --inputcomp INPUTC    NWP Data File For Comparison
  --output OUTPUT       Plotted Chart Name
  --date YYYYMMDD       FCST Base Date
  --time HH             FCST Run Time
  --step STEP           Dataset Step
  --field FIELD         Field For Plotting
  --cellmethod METHOD   Cell Method For Field
  --levtype LEVTYPE     Dataset Level Type
  --levelist LEVELIST   Pressure Level
  --unit UNIT           Field Unit For Plotting
  --tick TICK           Number Of Ticks For Field Plotting
  -v VERBOSE, --verbose VERBOSE
                        Print Out Data & Chart Details

The following table explains all switches in details (those repeated in the first table will not be explained in details),

SWITCH DESCRIPTION DETAILED EXPLANATION
-h, --help show help message and exit
--plot plot type any or diff; default any
--model NWP Model Name default ACCESS
--range Plotting Range default the full domain of the field
--perspective Plot Perspective
--template Common Plot Settings
--plotsetting User Plot Settings
--input NWP Surface Data File must be provided
--inputcomp NWP Pressure Level Data File input data for comparison; must be available for diff
--output Plotted Chart Name
--date FCST Base Date
--time FCST Run Time
--step Dataset Step
--field Field For Plotting field to be plotted
--cellmethod Cell Method For Field cell method for the field; can be instantaneous, max, min and mean
--levtype Dataset Level Type default sfc; can be ml for model level and pl for pressure level field
--levelist Pressure/Model Level level for ml or pl; 1,2,3... for ml and 200, 300... (hPa) for pl
--unit Field Unit For Plotting unit for plotting; e.g., for temp, using celsius in stead of kelvin
--tick Number Of Ticks For Field Plotting number of ticks of the bar in the chart
-v VERBOSE, --verbose Print Out Data & Chart Details

run esmplot.py

wml548@raijin3 ~]$esmplot.py -h
usage: esmplot.py [-h] --plot PLOT --model MODEL --member MEMBER --threshold
                  THRESHOLD [--range RANGE] [--perspective PERSPECTIVE]
                  [--template TEMPLATE] [--plotsetting PLOTSETTING]
                  [--inputpath INPUT] [--inputsfc INPUTS] [--inputpres INPUTP]
                  [--inputrain INPUTR] [--output OUTPUT] [--date YYYYMMDD]
                  [--time HH] [--step STEP] [--levtype LEVTYPE]
                  [--levelist LEVELIST] [--raingap RAINGAP] [-v VERBOSE]

Plot Ensemble Charts

optional arguments:
  -h, --help            show this help message and exit
  --plot PLOT           plot type
  --model MODEL         Model Name
  --member MEMBER       List of Members
  --threshold THRESHOLD
                        Threshold
  --range RANGE         Plotting Range
  --perspective PERSPECTIVE
                        Plot Perspective
  --template TEMPLATE   Common Plot Settings
  --plotsetting PLOTSETTING
                        User Plot Settings
  --inputpath INPUT     Data File Path
  --inputsfc INPUTS     Surface Data File
  --inputpres INPUTP    Pressure Level Data File
  --inputrain INPUTR    Rainfall Data file
  --output OUTPUT       Plotted Chart Name
  --date YYYYMMDD       FCST Base Date
  --time HH             FCST Run Time
  --step STEP           Dataset Step
  --levtype LEVTYPE     Dataset Level Type
  --levelist LEVELIST   Pressure Level
  --raingap RAINGAP     Precipitation Interval
  -v VERBOSE, --verbose VERBOSE
                        Print Out Data & Chart Details

The following table explains all switches in details (those repeated in the first table will not be explained in details),

SWITCH DESCRIPTION DETAILED EXPLANATION
-h, --help show help message and exit
--plot plot type pow for wind, pop for rainfall, pot for temp
--model NWP Model Name default ACCESS
--member Ensemble Members total list of all members
--threshold Threshold for Prob Plotting e.g., 40 for temperature or 5 for 24 hour rainfall
--range Plotting Range default the full domain of the field
--perspective Plot Perspective
--template Common Plot Settings
--plotsetting User Plot Settings
--inputpath Data File Path must be provided; path to where all members are located
--inputsfc NWP Surface Data File only file name, not full path;
--inputpres NWP Pressure Level Data File only file name, not full path; pow at 250hPa only
--inputrain NWP rainfall data only file name, not full path; pop only
--output Plotted Chart Name
--date FCST Base Date
--time FCST Run Time
--step Dataset Step
--levtype Dataset Level Type default sfc; can be pl for pressure level field
--levelist Pressure Level default=250 (standard plots, pow is at sfc and 250hPa)
--raingap Precipitation Interval default=24 (for standard plots, we are only interested in probability of rainfall in 24 hours)
-v VERBOSE, --verbose Print Out Data & Chart Details

NWP_PLOT Howto

At raijin:/short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst, there are some sample data for plotting,

qwxbjva_pa033_2016082318_utc_fc.um  #ACCESS_G sfc data
qwxbnka_pa037_2017032000_utc_fc.um  #ACCESS_R sfc data
xbnmya_pa006  #ACCESS_C SY sfc data
xbnmya_pa007  #ACCESS_C SY sfc data; for 1 hour rainfall plotting
xbnmya_pa030  #ACCESS_C SY sfc data; for 24 hour rainfall plotting
xbnmya_pc006  #ACCESS_C SY pres. lvl data
xbnmya_pe006  #ACCESS_C SY model lvl data
access_c3     #APS3 ACCESS_C data for one run
access_ce3    #APS3 ACCESS-CE data for one run

We will show how to do the plots using nwpplot.py, anyplot.py and esmplot.py.

nwpplot.py

plot ACCESS_G sfc temp

  nwpplot.py \
    --plot temp \
    --model ACCESS_G \
    --inputsfc /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/qwxbjva_pa033_2016082318_utc_fc.um \
    --output ACCESS-G_temp_sfc.png \
    --template global

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/ACCESS-G_temp_sfc.png
plot ACCESS_G sfc temp for only Australia domain

Note: --range "-50 0 90 180" is added and the --template updated as region

  nwpplot.py \
    --plot temp \
    --model ACCESS_G \
    --inputsfc /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/qwxbjva_pa033_2016082318_utc_fc.um \
    --output ACCESS-G_temp_sfc_australia.png \
    --range "-50 0 90 180" \
    --template region

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/ACCESS-G_temp_sfc_australia.png
plot ACCESS_G sfc temp for South Hemisphere with POLAR perspective --perspective

Note: changes in --range, --template and new 

  nwpplot.py \
    --plot temp \
    --model ACCESS_G \
    --inputsfc /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/qwxbjva_pa033_2016082318_utc_fc.um \
    --output ACCESS-G_temp_sfc_south_hemispere.png  \
    --range "-90 90 0 360" \
    --template polar \
    --perspective "POLAR"

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/ACCESS-G_temp_sfc_south_hemispere.png 

For other sfc plots and all sfc plots for ACCESS_R and ACCESS_C, please refer to raijin:/projects/access/apps/nwp_plot/1.0.0/nwpplot_raijin_test.ksh.

plot ACCESS_C SY mslp-precip last 1 hour

nwpplot.py \
  --plot mp \
  --model ACCESS_C(SY) \
  --inputsfc /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pa007 \
  --inputrain /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pa006 \
  --output ACCESS-C(SY)_mslpprecip_sfc.png \
  --raingap 1 \
  --template city1_5km

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/ACCESS-C(SY)_mslpprecip_sfc.png

plot ACCESS_C SY mslp-precip last 24 hour

nwpplot.py \
  --plot mp \
  --model ACCESS_C(SY) \
  --inputsfc /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pa030 \
  --inputrain /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pa006 \
  --output ACCESS-C(SY)_mslpprecip24_sfc.png \
  --raingap 24 \
  --template city1_5km

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/ACCESS-C(SY)_mslpprecip24_sfc.png
plot ACCESS_C SY mslp-thik

nwpplot.py \
  --plot mt \
  --model ACCESS_C(SY) \
  --inputpres /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pc006 \
  --inputsfc /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pa006 \
  --output ACCESS-C(SY)_mslpthik_pl.png \
  --template city1_5km

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/ACCESS-C(SY)_mslpthik_pl.png
plot ACCESS_C SY pres. lvl relative humidity

  nwpplot.py \
    --plot rh \
    --model 'ACCESS_C(SY)' \
    --inputpres /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pc006 \
    --inputsfc /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pa006 \
    --output ACCESS-C(SY)_rh_pl_850hPa.png \
    --template city1_5km \
    --levtype pl \
    --levelist 850

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/ACCESS-C(SY)_rh_pl_850hPa.png

Other pres. level plots can be produced by just chnaging --plot to temp, wind or ht. You may also change the --levelist to 200, 500 or 700 to get the plots at different pres. level.
NOTE: nwpplot.py has no functional differences in vn 1.0.0 and vn1.1.0. However, nwpplot.py in vn1.0.0 works for APS2 data using BOM STASH and nwpplot.py in vn1.1.0 works for APS3 data using BOM APS3 STASH.

anyplot.py

plot air_temperature from qwxbjva_pa033_2016082318_utc_fc.um

anyplot.py \
  --input /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/qwxbjva_pa033_2016082318_utc_fc.um \
  --field 'air_temperature' \
  --unit 'celsius' \                #convert temp to celsius whatever 
  --output anyplot_g_sfctemp.png \
  --tick 40 \                       #40 ticks for the bar in the chart
  --template global

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/anyplot_g_sfctemp.png
plot 300hPa air_temperature from xbnmya_pc006

anyplot.py \
  --input /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pc006 \
  --field 'air_temperature' \
  --unit 'celsius' \
  --output anyplot_c_temp_pl.png \
  --tick 40 \
  --levtype pl \
  --levelist 300 \
  --template city1_5km 

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/anyplot_c_temp_pl.png
plot ml lvl 30 air_temperature from xbnmya_pe006

anyplot.py \
  --input /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pe006 \
  --field 'air_temperature' \
  --unit 'celsius' \
  --outputanyplot_c_temp_ml.png \
  --tick 40 \
  --levtype ml \
  --levelist 30 \
  --template city1_5km 

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/anyplot_c_temp_ml.png
plot air_temperature difference between xbnmya_pa006 & xbnmya_pa007

anyplot.py \
  --input /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pa006 \
  --inputc input/short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/xbnmya_pa007 \
  --field 'air_temperature' \
  --unit 'celsius' \
  --output anyplot_diff_temp.png \
  --tick 40 \
  --plot 'diff' \
  --template city1_5km 

OUTPUT: /short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/plot/anyplot_diff_temp.png

esmplot.py

esmplot.py as EnSeMble plot does the probabilty plotting for ensemble forecasts. One example,

MODEL=ACCESS_CE
DATADIR=/short/dp9/aps_test_data/util_accessdev/nwp_plot/1.0.0/fcst/access_ce3/20160621T0900Z/SY/
MEMBER='enuk_um_000 enuk_um_012 enuk_um_013 enuk_um_014 enuk_um_015 enuk_um_016 enuk_um_017 enuk_um_018 enuk_um_019 enuk_um_020 enuk_um_021 enuk_um_022'

esmplot.py --plot pop \
           --model $MODEL \
           --inputpath $DATADIR \
           --inputsfc enukaa_20160621T09_spec_037 \
           --output myprcp.png \
           --member "$MEMBER" \
           --threshold 5.0 \
           --template city1_5km \
           --inputrain enukaa_20160621T09_spec_013 \
           --date 20160621 \
           --time 09 \
           --step 37

This produces the plot of probability of 24 hour rainfall at 37 hour > 5mm.

or you may run

esmplot_raijin_test.ksh

Any 4 PNG will be produced in the current folder,

myprcp.png mytemp.png mypwind.png mywind.png

Please refer to esmplot_raijin_test.ksh on how to plot all probability charts, pop, pot, pow at sfc and 250hPa.

Plot Suite

There is a Rose/cylc suite that plots all pp files and produce the plots to a designated location. The suite ID is u-al095.

The suite is tested on ACCESS_C SY. Since there is no common structure in which the pp files are organised, the rose-suite.conf needs to be modified for ACCESS_G and other NWP suites.


Another suite u-al586 does the exactly the same job. In stead of all the task related variables being defined in suite.rc, each task has a corresponding rose-app.conf in the folder app. All the relevant variables are specified in this rose-app.conf. In addition, the script= rose task run -v is defined in suite.rc. Please note there is no improvement by this design, it is just another style.

There are suites developed for APS3 NWP systems,

Last modified 3 months ago Last modified on Sep 28, 2017 2:54:56 PM