swp2ga

June 13, 2000 by Shinsuke Satoh

0. Overview

   "swp2ga" is a program to convert NCAR SOLO's swp format files into 
   4-byte binary files for GrADS.  The purpose of this program is not 
   only to display data using GrADS, but also to help an advanced radar 
   data analysis (e.g. dual-Doppler) following a basic analysis by SOLO.  
   A simple binary output will be useful to develop your original program.  

1. Obtaining the swp2ga

swp2ga source code

swp2ga archive (swp2ga.tar.gz) on this server (Shift + click, when you use Netscape 4.x)

ftp://ftp.crl.go.jp/pub/ck/satoh/swp2ga.tar.gz

2. Installing

   (1) uncompress and extract files from the archive
       > zcat swp2ga.tar.gz | tar xvf -
       or
       > tar xvzf swp2ga.tar.gz
   (2) compile (*)
       > make
   (3) copy the executing file ("swp2ga") into 
       an appropriate directory, if you need.
       (e.g., > cp -p swp2ga /usr/local/bin/) 
   
* Supported platforms: Linux(2.0.35), Sun4(Solaris 2.5)
             compiler: gcc 2.7.2.3
  (I hope this program works well on the other platforms.) 

3. Usage

usage: swp2ga
      -i [input file(s)]       : possible to use wild card (ex. swp.*)
     (-o [output path/file]    : if not, name automatically (gart.))
     (-p [output parameter(s)] : (ex. -p DM DZ VR )
     (-f [fixed num of rays]   : fixed output dimension (Num of AZ data)
     (-c                       : output GrADS ctl file )
     (-v                       : be verbose )
     (-t                       : output text-form file )
     (-h -help                 : show this usage )

   (1) You must designate input file(s) including a correct path. 
       Plural input files are divided by a blank space.
       File name substitution (wild card: *, ?, [0-5]) may be useful.
       Maximum input file number is 252.  This limitation may depend 
       on the argument number limitation in your shell.
   (2) If -o command is omitted, output files are named automatically 
       (swp. -> gart.), and are outputted on the current directory.
       To designate output directory, the last character must be '/'.
   (3) If -p command is omitted, all included parameters are outputted.
       Plural parameter names are divided by a blank space.
   (4) To fix the output dimension of number of rays (data number in 
       azimuth direction in the case of PPI), you can use -f command.  
       The fixed dimension will simplify a following fortran program.
   (5) To make a GrADS data descriptor file (ctl file) automatically, 
       you can use the command -c.
   (6) To output in the text format, this option should be added.
       Each element is saved in different files. Extension flag indicates
       an element of each file. --- << Added by Yuuki Honda. Thanks! >>
   (7) To check header information, you may use the command -v.

4. Output data format

   If you see the following message from swp2ga execution,
   ----------------------------------------------------------
     included data dims:  13(params) * 244(rays) * 280(cells)
     output parameters:   VE DM DZ  (3 params)
     output data size:    3 * 245 * 283 * 4 byte
   ----------------------------------------------------------
   you can read the contents of the outputted data using
   imax=283 (num_of_cells+3), jmax=245 (num_of_rays+1), and 
   kmax=3 (num_of_parameters) as rtdat(imax,jmax,kmax) in fortran,  
   or rtdat[kmax][jmax][imax] in c.
   Remark that 
     "i=1 means the observation time [second in the day]", 
     "i=2 means the azimuth angle [degree]",
     "i=3 means the elevation angle [degree]", and
     'j=1 means the distance from the radar [m]"
   Please see the sample program of ./sample/dow2d.f, or 
   the sample GrADS script of ./sample/swp2ga_disp.gs

5. Example to use

   (1) To prepare GrADS environment (see GrADS documents in detail)
   > cp -p sample/*.gs ~/grads_script/
   > setenv GASCRP ~/grads_script    ----> can write in your .cshrc

   (2) To execute the swp2ga, and display the output using GrADS 
   > swp2ga -i ~/swp_data/swp.97062400*.0.5 -o ~/ga_data/ -p DM DZ NCP DCZ VE SW -c
   > cd ~/ga_data
   > grads -lc "run swp2ga_disp gart.970624001234.DOW2.0.5.ctl"

   (3) To execute a sample program, and display the output using GrADS 
   > vi dow2d.f  ------> edit IMAX, JMAX, KMAX, and so on.
   > g77 dow2d.f -o dow2d
   > cd ~/ga_data
   > dow2d  -----> input file:  gart.970624001234.DOW2.0.5
                   output file: gaxy.970624001234.DOW2.0.5
   > grads -pc "run swp2ga_disp_6panels gaxy.970624001234.DOW2.0.5.ctl"

6. Others

GrADS
http://grads.iges.org/grads/
ftp://grads.iges.org/

NCAR SOLO
http://www.atd.ucar.edu/rdp/solo/solo_home.html
ftp://ftp.atd.ucar.edu/ (login name and passwd are requested)

If you have any questions or comments, contact me at:

 
Home