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

Home » Public Forums » archive » Re: Skymap and Array Problems
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: Skymap and Array Problems [message #35746] Wed, 09 July 2003 16:59
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Stephanie Wissel" <wissels@yahoo.com> wrote in message
news:d7877ccd.0307090628.5bd563a9@posting.google.com...
> The grid in galactic coordinates is not distorted. The
> transformation involves rotation (the galactic plane is 63deg from the
> celestial plane) and translation from the earth centered vertex to
> vertex at the center of the galaxy.
>
> ...
>
> The main problem is that after conversion the coordinates are not
> chronological. Meaning that instead of
>
> Long Lat ..............i get..............Long Lat
> -182 -89 12 23
> -155 -45 -155 -45
> 12 23 -189 -89
> 35 78 35 78

Hmm. It's still not clear to me if this can be represented by an
IDLgrContour or IDLgrSufarce object.

Imagine a regular, unrotated rectangular grid with, say, m x n vertices and
each vertex joined to its 4 neighbours (fewer for edge or corner vertices)
by line segments. For what it's worth, The total number of connecting line
segments is (m-1)*n + (n-1)*m. As you know, an IDLgrSurface or IDLgrContour
can represent this grid, using 1-D DATAX & DATAY arrays (GEOMX & GEOMY for
an IDLgrContour). DATAX & DATAY must be monotonic, maybe increasing (I'm not
sure), but don't need to be evenly spaced. If we rotate this grid around the
zaxis, stretch it or otherwise distort it in the xy plane (I've forgotten
the technical terms here) then DATAX & DATAY will probably have to be
two-dimensional. I haven't explored the limits here, but I think the
constraint is that the line segments may not cross. The IDLgrSurface and
IDLgrContour objects also support DATAZ (GEOMZ) keywords, so the vertices
can be shifted normal to the xy plane. Then the model they're contained in
can be rotated, translated or scaled in 3D space. So potentially you should
be able to use them to represent your data, provided that there is *some*
direction from which the layout looks like a (possibly distorted)
rectangular grid, with non-crossing line segments. Make that your z
direction, set up your DATAX, DATAY & DATAZ arrays then rotated, translated,
and scale your model to get the viewpoint you want. Good luck!

An IDLgrPolygon is much more general. In addition to the vertex positions
(the DATA property) you can also represent how they're connected (the
POLYGONS property). Given the vertex positions, you can create the polygon
descriptors by triangulation, but if you already know how the points are
connected, then it's better to use the information.

You can represent data values on an IDLgrPolygon by colouring the vertices.
I don't know if it's possible to generate contours on an IDLgrPolygon.

Hope this helps.

-- -
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: Skymap and Array Problems [message #35752 is a reply to message #35746] Wed, 09 July 2003 07:28 Go to previous message
wissels is currently offline  wissels
Messages: 2
Registered: July 2003
Junior Member
>> Furthermore, the galactic coordinates do not come out in sequential
>> order, so I need to sort them (along with their referenced data
>> points).
>
> This might be. Could you please try to explain the geometry of your grid in
> galactic coordinates. You start out with a rectangular grid in celestial
> coordinates, right? Ie one that can be described by 1D x & y arrays (not
> necessarily evenly spaced). Is the grid in galactic coordinates a distorted
> rectangular grid? Or (as I think you are implying) something more general.

The grid in galactic coordinates is not distorted. The
transformation involves rotation (the galactic plane is 63deg from the
celestial plane) and translation from the earth centered vertex to
vertex at the center of the galaxy.

I must have made the problem sound worse than it is. I'm just
frustrated, because of my lack of understanding in idl.

The main problem is that after conversion the coordinates are not
chronological. Meaning that instead of

Long Lat ..............i get..............Long Lat
-182 -89 12 23
-155 -45 -155 -45
12 23 -189 -89
35 78 35 78

As far as I can tell IDLgrCONTOUR (or CONTOUR for that matter) will
not let me plot well if the coordinates are not sorted. So I have to
sort all three arrays (the latitude set, the longitude set and the
data set) in order to map correctly. I hope that makes my problem a
little clearer. I will try looking at IDLgrPolygon.

Thanks!
Stephanie
Re: Skymap and Array Problems [message #35761 is a reply to message #35752] Tue, 08 July 2003 14:43 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Stephanie Wissel" <wissels@yahoo.com> wrote in message
news:d7877ccd.0307081143.22d78b61@posting.google.com...
> Hello,
>
> I'm an undergraduate and admittedly inexperiened in the ways of IDL
> (more akin to C++ and Java). I've been working on the following
> problem for a while and could use any help you can offer.
>
> At any rate, I must use IDL to plot a contour skymap of some data in
> a particular region first in celstial coordinates and then in galactic
> coordinates. I've used a procedure from the astro libraries on the
> web to convert from ra and dec to galactic latitude and longitude.
>
> Frustrated with MAP_SET and contour plots, I turned to object-oriented
> graphics. Basically, I used three arrays: one for the data, one for
> the x-coordinates and one for the y-coordinates. This was all fine
> and good, until I converted to galactic coordinates, because in the
> conversion, the lat is dependent on the long and vice versa. While I
> originally began with a 110x110 set of coordinates independent of one
> another, I am left with an set of 12100 points (x and y) corresponding
> to each data point.

This shouldn't be a problem.

> Furthermore, the galactic coordinates do not come out in sequential
> order, so I need to sort them (along with their referenced data
> points).

This might be. Could you please try to explain the geometry of your grid in
galactic coordinates. You start out with a rectangular grid in celestial
coordinates, right? Ie one that can be described by 1D x & y arrays (not
necessarily evenly spaced). Is the grid in galactic coordinates a distorted
rectangular grid? Or (as I think you are implying) something more general.
Distorted rectangular grids are not hard to deal with--I spend much of my
time displaying data from an ocean model with a curvilinear horizontal grid
and a terrain-following vertical coordinate. For more general grids you need
to describe not only the vertex positions of the grid, but also the
connectivity (which points are next to which). It can still be done in IDL,
but it's a little harder. In IDL object graphics, the IDLgrPolygon object
can display 2D or 3D grids with almost any connectivity. The IDLgrContour
and IDLgrSurface objects are less flexible so if you want to use them you
will need to regrid your data. But in either case you need to start by
describing the grid properly to IDL.

> This poses another problem, because the three arrays are
> separate from each other, galx, galy, and gal_arr and I don't know how
> to combine them so that I could read
>
> galx galy gal_arr.

Sorry, I don't understand this. Read them from what?

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Speed test on Mac G5, anyone?
Next Topic: IDLgrText

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

Current Time: Thu Oct 09 14:09:13 PDT 2025

Total time taken to generate the page: 0.48230 seconds