[Thread Prev][Thread Next][Index]

Re: reading of quickscat wind data



Hi everyone,
Martin Schmitt answered Jammal with some helpful ideas and a script from his experience with binary quickscat data, but he reports his message didn't appear in the Users List archive. Here it is:


------------- Begin Forwarded Message -------------
Hi Jammal,

I am using the daily 3-days composites from
ftp://ftp.ssmi.com/qscat

I think, to try to read the original byte-coded files with ferret
is hopeless. The ferret input is not made for this type of data processing.
So one should use the delivered fortran routines. After extracting data
with the fortran routines

(be carefully, some architectures read I*2 as -32767:32768
others as 0:65535 you must check this! A ggod test: all variables
also the rainflag and scatflag must have reasonable values. If
these are wrong, also the winds are wrong even if they look good!)

you get a .bin file for each day. A rare number of them is missing. This procedure you must have
ready, before you can use ferret to transform to
netcdf.
Using UNIX ls and a good editor I generate scripts like the attached one. Looks complicated but takes a few minutes. Much
faster than organizing loops in ferret.
It calls readbin.jnl for each bin-file.
go readbin 2001 01 01 clobber
go readbin 2001 01 02 append
go readbin 2001 01 03 append
...
and so on ...

The lines for missing files are also missing. Check the information
from the .log files written from the fortran routines.

You may also choose a region in readbin. What the script does you can guess from variable names. The
manipulation with the time variable needs explanation. The reason is, taht we
need so called time-stamps pointing to the end time of the dataset.

I attach the files for one year, if someone needs the driving
files for the other years, please feel free to write me.

Any improvement or comment concerning readbin.jnl
is very welcome.

Martin Schmidt

------------- End Forwarded Message -------------

! ! readbin.jnl

! Define the region here
let xs = -15
let xe = 22
let ys = -40 let ye = 10 ! find the day
let year = `$1`
let mont = `$2`
let daym = `$3`

define axis/x=0.125:359.875:0.25/units=degrees_east/modulo xu
define axis/y=-89.875:89.875:0.25/units=degrees_north yu

if `year eq 1999` then let day_off = 0
if `year eq 2000` then let day_off = 365
if `year eq 2001` then let day_off = 365 + 366
if `year eq 2002` then let day_off = 365 + 366 + 365
if `year eq 2003` then let day_off = 365 + 366 + 365 + 365
if `year eq 2004` then let day_off = 365 + 366 + 365 + 365 + 365
if `year eq 2005` then let day_off = 365 + 366 + 365 + 365 + 365 + 366

if `year eq 1999` then let yearlen = 365
if `year eq 2000` then let yearlen = 366
if `year eq 2001` then let yearlen = 365
if `year eq 2002` then let yearlen = 365
if `year eq 2003` then let yearlen = 365
if `year eq 2004` then let yearlen = 366
if `year eq 2005` then let yearlen = 365
define axis/t=`day_off-.5`:`day_off+yearlen-.5`:1/t0=1-jan-1999/unit=days time

define grid/x=xu/y=yu xygrid
define grid/x=xu/y=yu/t=time xytgrid

let dayval = days1900(year, mont, daym) - days1900(1999, 1, 1) + 1 - `day_off`

set data/EZ/format=stream/skip=1/grid=xygrid/var=dummy ($1)($2)($3)_3day_u.bin

let/unit="m/s"/title="zonal wind" windx=dummy + 0*t[gt=xytgrid,l=`dayval`]
save/file=windx.mom.dta.nc/($4)/l=`dayval`/x=`xs`:`xe`/y=`ys`:`ye` windx
can data/all

set data/EZ/format=stream/skip=1/grid=xygrid/var=dummy ($1)($2)($3)_3day_v.bin
let/unit="m/s"/title="meridional wind" windy=dummy + 0*t[gt=xytgrid,l=`dayval`]
save/file=windy.mom.dta.nc/($4)/l=`dayval`/x=`xs`:`xe`/y=`ys`:`ye` windy
can data/all

set data/EZ/format=stream/skip=1/grid=xygrid/var=dummy ($1)($2)($3)_3day_s.bin
let/unit="none"/title="scatflag" scatflag=dummy + 0*t[gt=xytgrid,l=`dayval`]
save/file=sflag.mom.dta.nc/($4)/l=`dayval`/x=`xs`:`xe`/y=`ys`:`ye` scatflag
can data/all

set data/EZ/format=stream/skip=1/grid=xygrid/var=dummy ($1)($2)($3)_3day_r.bin
let/unit="none"/title="radrain" radrain=dummy + 0*t[gt=xytgrid,l=`dayval`]
save/file=rflag.mom.dta.nc/($4)/l=`dayval`/x=`xs`:`xe`/y=`ys`:`ye` radrain
can data/all

set data/EZ/format=stream/skip=1/grid=xygrid/var=dummy ($1)($2)($3)_3day_m.bin
let/unit="none"/title="landmask" mask=dummy + 0*t[gt=xytgrid,l=`dayval`]
save/file=mask.mom.dta.nc/($4)/l=`dayval`/x=`xs`:`xe`/y=`ys`:`ye` mask
can data/all

can axis/all
can var/all






[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement