comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Converting distance to degrees
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Converting distance to degrees [message #76532] Fri, 17 June 2011 01:44
Klemen is currently offline  Klemen
Messages: 80
Registered: July 2009
Member
Ashely,

the data you have are projected and transformation into another
projection is not as easy as it seems. You have to first find out, in
which map projections are your data. Check metadata, ask the data
creator... Perhaps such a link might help:
http://egsc.usgs.gov/isb/pubs/MapProjections/projections.htm l

Then:
1. Use MAP_PROJ_INIT to define a structure for definition of your map
projection.
2. Transform the location of your data from Chartezian XY into
ellipsoid LON LAT coordinates using MAP_PROJ_INVERSE.
As your original data are quite detailed comparing to the results you
might think of aggregating your original data into e.g. 25 km grid
first. This will speed up the gridding in step 3 significantlly.
3. Grid the data using TRIANGULATE and GRIDDATA. In both cases use /
SPHERE option.

See also this discussion:
http://groups.google.com/group/comp.lang.idl-pvwave/browse_t hread/thread/688e9587fa29ecb7/2f7820d787d6047f?hl=en&q=# 2f7820d787d6047f

Cheers, Klemen
Re: Converting distance to degrees [message #76538 is a reply to message #76532] Thu, 16 June 2011 10:49 Go to previous message
Ashley Berg is currently offline  Ashley Berg
Messages: 14
Registered: February 2011
Junior Member
Thanks for replying. I understand what you mean. It is 1-km
resolution data. While this dataset is square in the kilometer sense,
in the degree sense it is not. If I were to convert each point to a
lat/lon point, all rows would still have the same number of data
points and be 1-km apart, but on a map, the top row would span across
more longitude lines than the bottom row.

Using the radius of the Earth at each latitude in kilometers and using
the fact that it's 360 degrees around a latitude circle, I can
calculate how many kilometers divide into a degree at each latitude.
However, since the number of kilometers in a degree will not be an
integer number, I'm not sure if I can turn a 1-km resolution grid into
a degree grid after all.


On Jun 16, 7:32 am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article
> < 33651085-7428-4309-a843-8d4a6bb9f...@e17g2000prj.googlegroup s.com >,
>  Ashley Berg <ashley.b...@gmail.com> wrote:
>
>> I have an ASCII grid of 1-km data values across the conterminous US,
>> 4629 cols x 2931 rows.  I was wondering if there is some kind of
>> routine in IDL that will convert kilometers to degrees?  I need to
>> convert the 1-km data to a 0.5x0.5 degree grid.
>
> Since the Earth is a sphere (approximately), it is
> not possible to have a regular 1 km grid over any large area
> of the Earth's surface.
>
> You probably need to check with the data set's creator
> to find out what kind of grid it really is.
>
> Ken Bowman
Re: Converting distance to degrees [message #76546 is a reply to message #76538] Thu, 16 June 2011 06:32 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<33651085-7428-4309-a843-8d4a6bb9f330@e17g2000prj.googlegroups.com>,
Ashley Berg <ashley.berg@gmail.com> wrote:

> I have an ASCII grid of 1-km data values across the conterminous US,
> 4629 cols x 2931 rows. I was wondering if there is some kind of
> routine in IDL that will convert kilometers to degrees? I need to
> convert the 1-km data to a 0.5x0.5 degree grid.

Since the Earth is a sphere (approximately), it is
not possible to have a regular 1 km grid over any large area
of the Earth's surface.

You probably need to check with the data set's creator
to find out what kind of grid it really is.

Ken Bowman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: spherical harmonics
Next Topic: Tick mark label with !P.Multi

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:36:07 PDT 2025

Total time taken to generate the page: 0.00381 seconds