[Thread Prev][Thread Next][Index]

Re: [ferret_users] units of SKIP ?



Hi Ryo,
To summarize,
  • For double-precision Ferret, the data written with LIST/FORMAT=STREAM is written as 8-byte words.  An option to write lower-precision data probably wouldn't be hard to implement, but it's not currently available.

  • Indeed, as you found, /SKIP is in units of words, and for double-precision Ferret, that is 8 bytes. I agree that it would be nice to be able to specify that (or perhaps at least to have it match the size given in the /TYPE qualifier).

  • As Russ noted, LIST/SINGLY is the qualifier you found; it refers to ascii listings.  It's spelling is changed for the next Ferret release.

  • The documentation needs clarifying.
So we'll at least get the docs updated, and it sounds as if you may have a workaround with ncks for now.  Thank you Russ for contributing that. I have added this issue to our list of enhancements.



-Ansley

On 12/15/2015 1:13 AM, Ryo Furue wrote:
Hi Ferret users,

Actually my last question

http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2015/msg00502.html

occurred in preparing for the real question I wanted to ask:

What determines the units for the SKIP qualifier to the FILE command?

I'll give a complete example below, but briefly, I found the unit is 8
bytes even when "type=r4"?  How can one change that?

The documentation says that "/SKIP arguments are in units of words"
and it seems a word is 8 bytes.  But, it's not convenient for r4 data.
  (Ideally, it would be nice if the units could be specified by the
user.)

I need SKIP to read a colleague's stream-binary data in
single-precision:  Because each of his files contains several
variables, I need to skip to the variable I want to examine.

By the way, to construct my example below, I used Russ's ncks command
to build a binary data in single precision.

FERRET v6.94
Darwin 14.1.0 - 02/26/15

Mac 10.11.2

Regards,

Ryo
---------------
set data coads_climatology
list SST[i=1:4,j=15,l=1] ! j=15 -> y=61S
SPAWN rm tmp.nc
SPAWN ncks -b sst.bin -C -v SST \
  /usr/local/ferret/data/coads_climatology.cdf -o tmp.nc
let skip = 14 * 180 !<- skip 14 latitude bands
let skip_half = 14 * 180 / 2
define axis/x=21:379:2/units=degrees_east lon
define axis/y=-61:89:2/units=degrees_north lat !<- start from 61S
define grid/x=lon/y=lat grid
!file/format=stream/type=r4/skip=`skip`/grid=grid/var=new_sst sst.bin
file/format=stream/type=r4/skip=`skip_half`/grid=grid/var=new_sst sst.bin
list new_sst[i=1:4,j=1]


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement