[ncl-talk] todouble() Keep meta data?
Alan Brammer
abrammer at albany.edu
Wed Jun 24 11:21:13 MDT 2015
I don't believe there are wrapped version of the type converters. There is
always the option of writing a function for it.
Here's a quick Wrap version of totype(), you can edit accordingly if you
want todouble specifically.
undef("totype_Wrap")
function totype_Wrap(x, type)
local x, type, retval
begin
retval = totype(x, type)
copy_VarMeta(x, retval)
retval at _FillValue = default_fillvalue(type) ; set fillvalue back to
default for new type
return(retval)
end
then you can just
oro := totype_Wrap(oro, "double")
Alan.
On Wed, Jun 24, 2015 at 12:20 PM, Erik J. Schaffernicht <
eschaffe at uni-koeln.de> wrote:
> If I transform a field with todouble() I loose all meta data. Why?
>
> Do I always have to do it like this or is there a shorter way?:
>
> t2=todouble(oro)
> copy_VarMeta(oro,t2)
> oro:=t2
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150624/49040918/attachment.html
More information about the ncl-talk
mailing list