Project

General

Profile

Changing Dtype from F to I?

Added by Álvaro Sánchez about 2 years ago

Hello :)
I need to merge a variable to an existent dataset, which I use to run some scripts after.
The problem I have is that the rest of the variables are written in I16 format, and the new one that I need to include is F32.
But when I try 'cdo -b I16 copy file ofile' I get the following:
cdo copy: 0%cdf_put_att_double: ncid = 131072 varid = 3 att = _FillValue val = 1e+20

Error (cdf_put_att_double): NetCDF: Numeric conversion not representable

When I remove the "I" from that formula it works, like: cdo -b 16 copy file ofile
But when I do sinfon ofile I still get Dtype as F32.
I have been checking my scripts until losing my eyes, and I don't know whats' happening, this looks like the only solution left, to change that F32 to I16. Could you help me?
Thank you so so much :)


Replies (4)

RE: Changing Dtype from F to I? - Added by Álvaro Sánchez about 2 years ago

Hiii, does someone know how to solve this?
I really need it, thank you very much :)

RE: Changing Dtype from F to I? - Added by Brendan DeTracey about 2 years ago

I am uncertain whether cdo can do this. You might want to try the ncpdq command from NetCDF Operators(NCO) [http://nco.sourceforge.net/].

RE: Changing Dtype from F to I? - Added by Brendan DeTracey about 2 years ago

Oh... and for cdo and you might also try changing your missing value to something representable as I16. 1e20 is of course going to fail in translation to a sixteen bit integer, right? . Try cdo setmissval,-32768 infile outfile

RE: Changing Dtype from F to I? - Added by Álvaro Sánchez about 2 years ago

Thank you very very very much Brendan, I really appreciatte it :) ::

    (1-4/4)