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

Dennis Shea shea at ucar.edu
Wed Jun 24 11:28:41 MDT 2015


Excellent suggestion.  When you send questions to ncl-talk, it is suggested
that you *always* include a printVarSummary(...) of your variable(s). How
are people supposed to know the variable structure. You know (hopefully)
but ncl-talk does not! Note: it is also suggested that you include the NCL
version you are using.

Since you are concerned with meta data, you should do a before and after
printVarSummary(...).


On Wed, Jun 24, 2015 at 11:15 AM, Walter Kolczynski <
walter.kolczynski at noaa.gov> wrote:

>  Have you tried a printVarSummary to see what your metadata actually is,
> both before and after where?
>
> - Walter
>
>
> On 24-Jun-15 12:18, Erik J. Schaffernicht wrote:
>
> 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
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing listncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> --
> Walter Kolczynski, Jr.
> Global Ensemble Team
> NOAA/NWS/NCEP/EMC (via I.M. Systems Group)(301) 683-3781
>
>
> _______________________________________________
> 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/84fb8a96/attachment.html 


More information about the ncl-talk mailing list