[Thread Prev][Thread Next][Index]

[ferret_users] creating a file with short integers as output



Dear ferret users / developers,


I'm having trouble trying to write a netcdf file with scaled values
using short integers.  The process (which works fine in the old
situation) I'm trying to improve is

1)  grib files on thredds (opendap)
2)  ferret loops over time steps and saves selected variables as
    netcdf
3)  catenenate netcdf files to one big file (ncrcat)

I would now like to let ferret write the data as scaled short
integers, with a fixed offset and scale factor in step 2).

After reading the documentation I have tried something like this:

let /units="degrees C" my_t2 = t2[d=1] - 272.15

define att my_t2.scale_factor = 0.01
set attribute /output my_t2.scale_factor

define att my_t2.add_offset = 0.0
set attribute /output my_t2.scale_factor

set var /outtype=short /bad=-32767 my_t2

save /clobber /file=testing.nc my_t2


Questions:

- is this the correct way?

- Does ferret automatically scale the values or do I need to do
  explicitly divide by scale_factor and subtract add_offset?

- When saving multiple scaled variables, ferret (6.8.4 and 6.8.5) gets
  confused.  The order of saving matters: a single variable works,
  saving 3 together breaks.  Message: cannot represent data in
  variable as short. 


Any help is much appreciated.
Kind regards,

     Hein


-- 

Dr. Hein Zelle
Senior consultant meteorology & oceanography
BMT ARGOSS

Tel:        +31 (0)527-242299
Fax:        +31 (0)527-242016
E-mail:     hein.zelle@xxxxxxxxxxxxx
Website:    www.bmtargoss.com
	    
BMT ARGOSS b.v.
Voorsterweg 28, 8316 PT Marknesse, the Netherlands
Postal address: P.O. Box 61, 8325 ZH Vollenhove, the Netherlands

Registered in The Netherlands, Registered no. 39060160.

Unless otherwise agreed by BMT ARGOSS in writing, all work,
services, goods or products supplied by BMT ARGOSS shall be subject
to and governed by BMT ARGOSS' own terms and conditions which are
available for inspection from BMT ARGOSS on request.

E-mail confidentiality notice and disclaimer:
The contents of this e-mail and any attachments are intended for the
use of the mail addressee(s) shown. If you are not that person, you
are not allowed to read it, to take any action based upon it or to
copy it, forward, distribute or disclose the contents of it and you
should please delete it from your system. BMT ARGOSS does not accept
liability for any errors or omissions in the context of this e-mail or
its attachments which arise as a result of internet transmission, nor
accept liability for statements which are those of the author and
clearly not made on behalf of BMT ARGOSS.


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

Privacy Policy | Disclaimer | Accessibility Statement