[ncl-talk] Easier, more elegant way to do: ncl where() and keepMetaData?

Erik J. Schaffernicht eschaffe at uni-koeln.de
Wed Jun 24 10:18:01 MDT 2015


Now, I rewrote my ncl-script because on first sight it seemed you are 
right.  But when it comes to gsn_csm_contour_map  (or somewhere else, 
there is no line number given with the warning messages)
I get these warnings:

(0)    check_for_y_lat_coord: Warning: Data either does not contain a 
valid latitude coordinate array or doesn't contain one at all.
(0)    A valid latitude coordinate array should have a 'units' attribute 
equal to one of the following values:
(0)        'degrees_north' 'degrees-north' 'degree_north' 'degrees 
north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg 
north'

and the only thing I changed was this:

w2=sediProbab
w2=where(landAreaFrV .lt. 0.5, w2 at _FillValue, w2)
copy_VarMeta(sediProbab,w2)
sediProbab=w2

to

sediProbab=where(landAreaFrV .lt. 0.5, sediProbab at _FillValue, sediProbab)


So, what is happening there with the where()





On 23.06.2015 14:58, Carl Schreck wrote:
> You should be able to simply do:
>
> sediProbab = where(landAreaFrV .lt. 0.5, sediProbab at _FillValue, sediProbab)
>
> sediProbab's metadata will be unchanged.
>
>      Carl
>
> On Tue, Jun 23, 2015 at 7:14 AM, Erik J. Schaffernicht <
> eschaffe at uni-koeln.de> wrote:
>
>> Is there an easier/shorter way(?) than the following to keep the metaData:
>>
>>                              (sediProbab is a matrix with metaData)
>>
>> w2=sediProbab
>> w2=where(landAreaFrV .lt. 0.5, w2 at _FillValue, w2)
>> copy_VarMeta(sediProbab,w2)
>> sediProbab=w2
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5001 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150624/b9c116e3/attachment.bin 


More information about the ncl-talk mailing list