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

Home » Public Forums » archive » map function for astronomy
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: map function for astronomy [message #89883 is a reply to message #89877] Tue, 16 December 2014 13:24 Go to previous messageGo to previous message
eshaya is currently offline  eshaya
Messages: 4
Registered: December 2014
Junior Member
On Monday, December 15, 2014 6:21:40 PM UTC-5, esh...@umd.edu wrote:
> I want to use the map function for plots of the sky. In the map_set procedure there was a simple reverse=1 keyword to do this. How do we do this with the map function?

Well, I have gone ahead and wrote the code to force a reversal of the longitude and at least make it possible to plot skymaps with the map procedure. Here is what I did (but if anyone can find an easier way, I am all ears). First, I use the negative of the RA values in the limits:

limit = [decmin,-ramax,decmax,-ramin]

and call the map function with label_format keyword:

map1 = map('Orthographic', limit=limit, label_format = 'mapgrid_labels_reverse')

The label_format keyword is a callback to a user supplied function that can alter the labels. So mine is call mapgrid_labels_reverse:
function MapGrid_Labels_Reverse, orientation, location, fractional, defaultlabel
; Reverse RA labels for skymaps
; Be sure to reverse both the RA limits and the RA values
; And then use map function like so
; m = MAP(orthographic, LABEL_FORMAT='MapGrid_Labels_Reverse', limit=limit)

; If grid line is RA (orientation = 0), then reverse it
if (orientation eq 0) then begin
location = -location
if (location lt 0) then location = location + 360.
endif

degree = '!M' + STRING(176b) ; Use the Math symbol

label = STRTRIM(ROUND(location),2) + degree

return, label
end
----
This just uses degrees. Of course, one could be fancy here and output hours, min, sec etc instead.
Next one has to use the reverse of the ra in plotting any values:
map1 = plot(/overplot,-ra,dec,symbol='+',linestyle='')

Again, hopefully, I am just being silly here and there is some keyword or something that does all of this automagically.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: FINITE function
Next Topic: Map method bug?

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

Current Time: Fri Oct 10 07:00:26 PDT 2025

Total time taken to generate the page: 1.76246 seconds