[ncl-talk] calculate area of polygon box
Adam Phillips
asphilli at ucar.edu
Mon Feb 5 09:46:04 MST 2018
Hi Kunal,
The examples shown on the area_poly_sphere documentation page also
illustrate how to use gc_clkwise and gc_qarea, the latter having the
requirement of input lat/lon arrays having a size of 4. This was done to
show that the results are the same between gc_qarea and area_poly_sphere
(when input lat/lon arrays are of size 4). Try just calling
area_poly_sphere and all should be well.
Adam
On Mon, Feb 5, 2018 at 9:32 AM, Kunal Bali <kunal.bali9 at gmail.com> wrote:
> Dear Dennis Sir,
> Thanks for this suggestion.
>
> I tried that one, but I think these examples are applicable to
> rectangular box only with the 4 lat lon grid points.
>
> I followed the examples on that page. e.g.
>
> ncl 0> rsph = 1.0
> ncl 1> lonv = (/77.98,77.96,79.01,80.02,80.98,81.57,81.98,83.01,84.00,83.
> 99,83.01,83.01,80.98,81.00,80.01,79.64,79.63,79.01,77.98/)
> ncl 2> latv = (/31.00,29.70,29.15,28.82,28.43,28.01,27.98,27.47,27.38,28.
> 64,28.99,29.40,29.56,29.99,30.05,30.01,30.61,30.64,31.00/)
> ncl 3> qorder = gc_clkwise(latv, lonv)
> ncl 4> qarea_gc = gc_qarea(latv, lonv)
> fatal:gc_qarea: the last (rightmost) dimension of arrays must be 4
> fatal:["Execute.c":8576]:Execute: Error occurred at or near line 4
>
>
>
>
> ---
> Kunal Bali
>
>
>
>
>
> On Mon, Feb 5, 2018 at 9:09 PM, Dennis Shea <shea at ucar.edu> wrote:
>
>> Did you look at any of the functions?
>>
>> Click "Functions" ; Click "Alphabetical Listing"; Search 'area'
>>
>> Keep going till you find something: Like .......
>>
>> http://www.ncl.ucar.edu/Document/Functions/Built-in/area_pol
>> y_sphere.shtml
>>
>> On Mon, Feb 5, 2018 at 5:32 AM, Kunal Bali <kunal.bali9 at gmail.com> wrote:
>>
>>> Dear NCL users,
>>>
>>> I have coordinates such as
>>> lonv = (/77.98,77.96,79.01,80.02,80.98,81.57,81.98,83.01,84.00,83.9
>>> 9,83.01,83.01,80.98,81.00,80.01,79.64,79.63,79.01,77.98/)
>>>
>>> latv = (/31.00,29.70,29.15,28.82,28.43,28.01,27.98,27.47,27.38,28.6
>>> 4,28.99,29.40,29.56,29.99,30.05,30.01,30.61,30.64,31.00/)
>>>
>>>
>>> from that, I am able to plot the polygon line e.g.
>>>
>>>
>>>
>>>
>>>
>>> So, could anyone please let me know how to calculate the area (in km) of
>>> this polygon box?
>>>
>>>
>>> thank you
>>> ---
>>> Kunal Bali
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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 list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
--
Adam Phillips
Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180205/cf0db9ca/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: area.png
Type: image/png
Size: 27216 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180205/cf0db9ca/attachment.png>
More information about the ncl-talk
mailing list