Closed jaegunjung closed 6 years ago
@jaegunjung
Sure, this is easy to do. You can do it inline or with a file.
Note that I use --
to force the evaluation order. I define PM25 first and then I use -v to select and plot it.
Note that both examples have an ellipsis (...
) that needs to be replaced with the definition your are using. Please post your definition for the record.
pncmap.py -v PM25 -- -f uamiv --expr='PM25=...' inpath figroot
or
cat "PM25=..." > /path/to/pm25.pncexpr
pncmap.py -v PM25 -- -f uamiv --exprscript=/path/to/pm25.pncexpr inpath figroot
*If future readers are working on windows, replace the '
with "
around the expression.
Hi Barron,
When I used --expr='PM25=PNO3', I got the following error messages,
IOAPI_ISPH is assumed to be 6370000.; consistent with WRF **PNC:/disk41/jjung_linux/util/python/anaconda3/lib/python3.5/site-packages/PseudoNetCDF/core/_functions.py:80:UserWarning: Skipping PM25 Traceback (most recent call last): File "/usr/people/jjung/util/python/anaconda3/bin/pncmap.py", line 11, in
@jaegunjung - The two examples in the first post work. I just tested it with the test case outputs from day 20020603.avrg.grd01 with the definition that you used and with the following definition. Both can be pasted into my example and produce the expected figure.
PM25=SOA2 + SOA3 + PNO3 + SOA1 + POA + CCRS + PEC + SOA4 + PNH4 + CPRM + FCRS + PSO4 + FPRM
In the future if something doesn't work, don't just post the error. Paste the exact command that failed. Right now, I am guessing a little bit because all I see is your error.
Your error states that PNO3 isn't available. That could be for two reasons. First, the variable could not be in your output. Easily checkable with pncdump -f uamiv
. Second, you might not have included the extra --
in between the -v
option and and the --expr
option.
It is really, really important that you include the --
before the --expr
(e.g., pncmap.py -v PM25 -- --expr='PM25=PNO3' inpath outpath
). Without the --
in between, it filters the species for only PM25. Since PM25 isn't there, no variables are kept. Then there are no variables available to define PM25. As stated in the initial post, the extra --
forces order of operations.
Hi Barron,
Thanks for pointing "--". As you expected, I did not use "--" in the argument list. I will post the command I used in the next time so that you can understand better what happened.
I just want to note that the order of argument matters. When I tried,
pncmap.py -v PM25 --from-conv=ioapi --format=uamiv -- --expr='PM25=PNO3_1+PSO4_1+PNH4_1+POA_1+SOA1_1+SOA2_1+SOA3_1+SOA4_1+SOPA_1+SOPB_1+PEC_1+CRST_1+NA_1+PCL_1' $infile $outpath/$outfile -s LAY,0 -r TSTEP,max --states --norm="Normalize(vmin=0,vmax=20.0)"
pncmap cannot recognize "--states" argument. But, when I put the argument before the "-- --expr=..." as follows, it worked.
pncmap.py -v PM25 --from-conv=ioapi --format=uamiv -s LAY,0 -r TSTEP,max --states --norm="Normalize(vmin=0,vmax=20.0)" -- --expr='PM25=PNO3_1+PSO4_1+PNH4_1+POA_1+SOA1_1+SOA2_1+SOA3_1+SOA4_1+SOPA_1+SOPB_1+PEC_1+CRST_1+NA_1+PCL_1' $infile $outpath/$outfile
Thank you for your instruction. I appreciate it.
Jaegun
pncmap.py is very useful to do QA CAMx output files.
I want to plot PM2.5 but do not know how to combine multiple variables. Can you show an example?
Thanks - Jaegun