[ncl-talk] how to extract a time index

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Mon Feb 17 20:34:41 MST 2020


A slight correction here, sorry.  It is CellFill that needs 4 adjacent grid
points to draw each grid box.  RasterFill will draw a box for every point
with non-missing data.  See the resource docs for cnFillMode.  RasterFill
would be a good initial setting for Vanúcia to try, for debugging.


On Mon, Feb 17, 2020 at 7:56 PM Dennis Shea via ncl-talk <ncl-talk at ucar.edu>
wrote:

> For a
>       res at cnFillMode  = "RasterFill"
> there must be 4 grid points that are adjacent to one another for a grid
> box to be drawn.
> Likely, that is not the case for the *VERY SPARSELY POPULATED* arrays you
> have available.
> In fact, NCL's  *stat_dispersion *
> <http://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.shtml>
> function indicates that more than * 99.999+%* of the array values are
> missing [_FillValue]. Specifically, of the 946956000 values only 14 are not
> missing.
>
> [time | 365] x [lat | 1410] x [lon | 1840]  ===> 946956000
>
> =========================================
> The script ou attached:
> :
> The following is *not* 'time'.
>        time     = r(:,0,0)                      ; selecting just time
> This assignment yields all the 'r' values over 365 times at the grid point
> with index values (0,0)
> Try the following to see the values in 'time'
>        print(time)                                ; values of array 'r'
> over all times at grid point (0,0)
>        exit
>
> 'time' would be
>        time = r*&*time                           ; extract all 'time'
> coordinates associated with variable 'r'
>
> or, explicitly extract the variable 'time' from the file(s).
>         time = dat[:]->time
>
> The above are equivalent.
> ==============================
> I have no idea why the following is being assigned:
>          r at _FillValue = -999
> The _FillValue is already -999.0
> ===============================
>
> Attached are two scripts :
> [1] *tst_vanucia.ncl_v0  *uses stat_dispersion to illustrate its usage.
> [2] *tst_vanucia.ncl_v1*: creates the attached plot
>
>      It uses* polymarkers *
> <http://www.ncl.ucar.edu/Applications/polyg.shtml>to illustrate the 'nfr'
> values and prints the desired values.
> =====================
>      YYYYMMDD   LAT    LON   VALUE
> (0) 2017012112  -24.4  -57.01  1
> (1) 2017012912  -19.58  -50.4  1
> (2) 2017013012  -22.35  -57.97  1
> (3) 2017020412  -17.45  -46.58  1
> (4) 2017031112  -24.71  -57.28  1
> (5) 2017100212  -20.21  -43.62  1
> (6) 2017100612  -24.86  -57.87  1
> (7) 2017101312  -22.87  -53.63  1
> (8) 2017102712  -19.19  -57.16  1
> (9) 2017111712  -22.51  -44.11  1
> (10) 2017112412  -19.63  -54.81  3
> (11) 2017121512  -18.2  -54.46  2
> (12) 2017121612  -21.58  -42.03  1
> (13) 2017122612  -17.79  -45.92  2
>
>
> On Mon, Feb 17, 2020 at 7:27 AM Vanúcia Schumacher via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
>> Hi NCL's user
>>
>> I would like to know how I can extract the date information (YYYYMMDD)
>> and coords (LAT LON)  for each non-missing value from the variable obtained?
>> And how could I plot these points, because they are 14 valid pixels
>> (cells-size) and when I plot only 1 pixel appears
>>
>> Attached are my script and data which I am trying to do this.
>>
>> I appreciate any help
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200217/0a349e97/attachment.html>


More information about the ncl-talk mailing list