avrg2grads - sinotec2/CAMx_utility GitHub Wiki

Purpose

Transform 5-dimensional CAMx(UAM) unformatted file into GrADS unformatted 2-d binary file(one spec on one file) to generate the gridded data plots.

Arguments

  1. avrg file name(eg. ROOT.S.grd), with all extension, case sensitive.
  2. species sequence number(if from *S.grd, they are: 1O3 2NO2 3SO2 4VOC 5PM25 6PM10 7PNO3 8PSO4)
  3. number of interval hours (1 for O3, 24 for PM's 720/744 for month average)

Output

ROOTspecnam.ga (big_endian binary gridded data file for GrADS)
ROOTspecnam.ctl (grads control file)

excution(such as)

  1. slim / shk / dmavrg / tmavrg ... etc preparation
  2. for i in 5 6;do avrg2grads 1309_Hs.S.grd02LD $i 24;done (for PM2.5 and PM10)
  3. grads -p -b -c 'run XX.gs' (generate the png's)
  4. ~/bin/monpm.cs amn (amn=jan~dec) montage 4 in one page and merge into multipage pdf_file, OR
  5. for i in {01..31};do -geometry +4+4 ??L$i"DEC2010.png" $i.pdf;done; pdf_all ?? dec_O3
  6. the resultant files: amn_spec.pdf (amn=jan~dec) (spec=O3,PM2.5, PM10 ...)

Other files needed:

  1. color.gs cbar.gs
  2. TWN_COUNTY.dbf TWN_COUNTY.prj TWN_COUNTY.shp TWN_COUNTY.shx
    Relative scripts

monpm.cs

[kuang@master con09]$ cat ~/bin/monpm.cs
for sp in PM10 PM25;do
for n in {1..8};do
m=$(( n*4 ))
montage -geometry +4+4 $(ls -rt *$sp".png" |head -n$m|tail -n4) $n".pdf"
done
pdf_all ? $1_$sp
done

montage is a linux command of ImageMagick package.
pdf_all Joint all the single page .pdf together to a volume pdf file.

⚠️ **GitHub.com Fallback** ⚠️