[ncl-talk] lat,lon subscript for Lambert projection

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Thu Feb 22 08:34:09 MST 2024


Coordinate subscripting is only available for 1-D coordinates.  It looks
like your file has 2-D coordinates.  For 2-D, use NCL's lookup functions.
See the doc page for *lat/lon functions*.  This is independent of the type
of projection, because all curvilinear projections should be using 2-D
coordinate variables, such as your lat2d and lon2d.

For locating single points, use *getind_latlon2d*.  For the boundary
indices of a region, use *region_ind*.


On Thu, Feb 22, 2024 at 2:18 AM Debasish Hazra via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Hi,
> I am trying to plot a timeseries over a point location from a netcdf file
> which is in Lambert Conformal projection. I have defined
>  lat2d = a1->lat
>  lon2d = a1->lon
>   nlat = dimsizes(lat2d(:,0))
>   nlon = dimsizes(lat2d(0,:))
>   dims = dimsizes(lon2d)
> print(dims)
>          precip_intg1 = a1->precip(0,:,:,:)
>           loc1 = precip_intg1(:,{32.635},{-106.338})
>
> fatal:NclOneDValGetClosestIndex: finish coordinate index out of range,
> can't continue
> fatal:Could not obtain coordinate indexes, unable to perform subscript
>
> Is there a way to subscript lat,lon for Lambert projection in NCL.
> Thanks
> Debasish
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20240222/460bdb5e/attachment.htm>


More information about the ncl-talk mailing list