[ncl-talk] Fwd: Random file into polar coordinates
Dennis Shea
shea at ucar.edu
Wed Nov 8 19:27:27 MST 2017
---
re:
I have latitude and longitude in cartesian coordinates (example of the text
file is above). That is the only information I have. I plotted the data
before using gsn_add_polymarker for the domain I want e.g. 15N 20N and
54W-58W. The center of this domain is 16.8N and 56W. What the polymaker
function did was if I had an observation at 16N and 53W a black dot was
drawn. What I need now is transform that 16N-53W (black dot)
into cylindrical coordinates using as center 16.8N and 56W.
---
This is much more specific. Really, this needs custom built code:
[a] The region is quite small and near the equator. Hence, I think you
could treat the data as being on a cartesian grid.
clat = 16.8 ; user specified center point
clon = -56.0
latS = 15.0 ; area of interest; nearish to equator; earth curvature
effect is 'small'
latN = 20.0
lonL = -58.0
lonR = -54.0
[b] You can use the 'ind' function to isolate only points with the region
of interest:
https://www.ncl.ucar.edu/Document/Functions/Built-in/ind.shtml
[c] You specified a center point. You could use the following to determine
the radius (distance) to each point.
https://www.ncl.ucar.edu/Document/Functions/Built-in/gc_latlon.shtml
[d] I think the polar 'theta' can be determined using atan2.
https://www.ncl.ucar.edu/Document/Functions/Built-in/atan2.shtml
---
It is your responsibility to read the documentation and test with your
data. Look at the printed output. Maybe, for a point or two, manuall dray a
picture.
---
See attached ...
Good Luck
On Wed, Nov 8, 2017 at 12:45 PM, Mary Haley <haley at ucar.edu> wrote:
> Please see our r, theta plotting examples page at:
>
> http://www.ncl.ucar.edu/Applications/radar.shtml
>
> To be honest, NCL is not tailored for r, theta data, but it *is* possible
> to plot it. You have to do some of the work to convert to the coordinate
> system you want.
>
> --Mary
>
>
> On Tue, Nov 7, 2017 at 7:42 PM, Keren Rosado <keren.rosadova at gmail.com>
> wrote:
>
>>
>>
>> Sent from my iPhone
>>
>> Begin forwarded message:
>>
>> *From:* Keren Rosado <keren.rosadova at gmail.com>
>> *Date:* November 7, 2017 at 4:10:01 PM MST
>> *To:* Dennis Shea <shea at ucar.edu>
>> *Subject:* *Re: [ncl-talk] Fwd: Random file into polar coordinates*
>>
>> I have latitude and longitude in cartesian coordinates (example of the
>> text file is above). That is the only information I have. I plotted the
>> data before using gsn_add_polymarker for the domain I want e.g. 15N 20N
>> and 54W-58W. The center of this domain is 16.8N and 56W. What the polymaker
>> function did was if I had an observation at 16N and 53W a black dot was
>> drawn. What I need now is transform that 16N-53W (black dot)
>> into cylindrical coordinates using as center 16.8N and 56W.
>>
>> On Tue, Nov 7, 2017 at 3:25 PM, Dennis Shea <shea at ucar.edu> wrote:
>>
>>> Again you need clarify even more ...Please look at:
>>>
>>> ---
>>>
>>> http://hyperphysics.phy-astr.gsu.edu/hbase/sphc.html
>>>
>>> Upper left:
>>>
>>> theta is (90-latitude); co-latitude
>>> phi is longitude
>>> r is the radius of the earth (assuming a spherical earth)
>>>
>>> You have all of this information.
>>>
>>> ===
>>> http://keisan.casio.com/exec/system/1359534351
>>> ===
>>> The radius at any latitude:
>>> http://mathforum.org/library/drmath/view/54158.html
>>>
>>> r(latitude) = r*cos(latitude) ; latitude in radians
>>>
>>>
>>>
>>>
>>> On Tue, Nov 7, 2017 at 1:07 PM, Keren Rosado <keren.rosadova at gmail.com>
>>> wrote:
>>>
>>>> R, theta
>>>>
>>>> On Tue, Nov 7, 2017 at 12:11 PM, Dennis Shea <shea at ucar.edu> wrote:
>>>>
>>>>> Please clarify your question:
>>>>>
>>>>> re: "polar coordinates"
>>>>>
>>>>> (a) r,theta ? https://en.wikipedia.org/wiki/Polar_coordinate_system
>>>>> (b) lat,lon ?
>>>>>
>>>>> On Tue, Nov 7, 2017 at 11:52 AM, Keren Rosado <
>>>>> keren.rosadova at gmail.com> wrote:
>>>>>
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I have a file with observations for the entire globe for one hour
>>>>>> period.
>>>>>> Here are few lines from my txt (observations) files. The highlighted
>>>>>> values are for lat and lon:
>>>>>> 2010/08/28,04:00:00.356732, 11.7047, 133.9177, 4.8, 5
>>>>>>
>>>>>> 2010/08/28,04:00:00.629722, 36.7353, 52.1856, 26.8, 7
>>>>>>
>>>>>> 2010/08/28,04:00:00.559602, 36.8155, 52.2482, 3.3, 5
>>>>>>
>>>>>> 2010/08/28,04:00:00.922721, 4.8667, 105.7474, 8.3, 7
>>>>>>
>>>>>> 2010/08/28,04:00:00.130999, 22.7165,-105.1758, 24.9, 5
>>>>>>
>>>>>> 2010/08/28,04:00:00.400279, 11.7329, 133.9220, 16.3, 9
>>>>>>
>>>>>> 2010/08/28,04:00:01.330873, 21.6459,-105.0242, 7.3, 5
>>>>>>
>>>>>> 2010/08/28,04:00:01.409443, 28.4564, -90.7360, 9.7, 5
>>>>>>
>>>>>>
>>>>>>
>>>>>> I plotted these observations using ncl function gsn_add_polymarker
>>>>>> for the domain I am interested in lat and lon.
>>>>>>
>>>>>>
>>>>>> I will like to now how to transform the lat and lon to polar
>>>>>> coordinates for the domain I am interested.
>>>>>>
>>>>>>
>>>>>> Does anyone have an idea of how to to this?
>>>>>>
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> 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
>>
>>
>
> _______________________________________________
> 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/20171108/857637b9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: polar.ncl
Type: application/octet-stream
Size: 3341 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171108/857637b9/attachment.obj>
More information about the ncl-talk
mailing list