[ncl-talk] gc_latlon question

Mary Haley haley at ucar.edu
Wed Jan 4 07:26:06 MST 2017


Hi Matt,

What I would do is use the conform_dims function to conform both arrays to
2D, such that the latitudes will be repeated along one dimension, and the
longitudes will be repeated on the other dimension:

nlat  = dimsizes(lat)
nlon  = dimsizes(lon)
lat2d = conform_dims((/nlat,nlon/),lat,0)
lon2d = conform_dims((/nlat,nlon/),lon,1)

lat2d and lon2d are now the same size (nlat x nlon).

--Mary


On Tue, Jan 3, 2017 at 3:47 PM, Matthew Fearon <Matthew.Fearon at dri.edu>
wrote:

> Just curious if there is a simple way (without a loop) to find the true
> surface distance between two coordinate pairs where the lat and lon arrays
> are one dimensional but of unequal size (eg, as on some rectilinear grids)?
> For example, nlat=200 and nlon=300.
>
> I see how gc_latlon works for equal size lat/lon arrays that are 1 or 2D.
>
> Is the best approach to pad my 1-D lat array with fillvalues to make it of
> equal size to the lon array?
>
> thanks,
> Matt
>
>
> PUBLIC RECORDS NOTICE: In accordance with NRS Chapter 239, this email and
> responses, unless otherwise made confidential by law, may be subject to the
> Nevada Public Records laws and may be disclosed to the public upon request.
>
> _______________________________________________
> 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/20170104/6bfa1acb/attachment.html 


More information about the ncl-talk mailing list