[AstroPy] Fwd: how to make a sky plot

Ricardo Ogando ricardogando at gmail.com
Sat Apr 5 18:45:05 EDT 2014


Hi astropy folks, 

I think this message from Molly bounced so I am forwarding it to you.

Thanks,
Ricardo

Begin forwarded message:

> From: Molly Swanson <molly.swanson at gmail.com>
> Subject: Fwd: Re: [AstroPy] how to make a sky plot
> Date: 5 de abril de 2014 17:58:04 BRT
> To: astropy at scipy.org, ricardogando at gmail.com
> 
> Hi Ricardo and astropy folks,
> 
> I developed an extension from the python map-making package basemap called skymap, which I use to plot mangle masks.  It uses all of basemap's machinery for managing spherical projections but does things in a sky-plotting-appropriate way.  I do use degrees for labeling RA though - might be hard to get basemap to do otherwise.  Anyway, check out figure 1 in http://arxiv.org/pdf/1312.4877.pdf for an example usage. 
> 
> It's not packaged up very cleanly or anything since it's embedded in my mangle plotting stuff, but if anyone wants to use it or work on including it in astropy, it's up on github within https://github.com/mollyswanson/manglepy
> It's in the graphmask.py file.
> 
> Thanks,
> Molly Swanson
> 
> ---------- Forwarded message ----------
> From: Ricardo Ogando <ricardogando at gmail.com>
> Date: Wed, Apr 2, 2014 at 10:42 AM
> Subject: Fwd: Re: [AstroPy] how to make a sky plot
> To: Molly Swanson <molly at star.ucl.ac.uk>, Molly Swanson <molly.swanson at gmail.com>
> 
> 
> Hi Molly,
> 
> since I saw that you developed Skymap from Basemap
> but I am not sure if it is public,
> I am bringing this discussion to your attention:
> people trying to plot parts of the sky in the right projection,
> which I do not think matplotlib currently do.
> 
> Thanks,
> Ricardo
> 
> 
> 
> -------- Original Message --------
> Subject:        Re: [AstroPy] how to make a sky plot
> Date:   Wed, 2 Apr 2014 10:31:44 -0400
> From:   Eric Jensen <ejensen1 at swarthmore.edu>
> Reply-To:       Astronomical Python mailing list <astropy at scipy.org>
> To:     Astronomical Python mailing list <astropy at scipy.org>
> 
> 
> 
> 
> On Apr 2, 2014, at 10:10 AM, Jonathan T. Niehof wrote:
> 
> (Don't know if it's possible to label RA in hours
> instead of degrees longitude.)
> 
> If it isn't possible to do this directly in the plotting routine, you
> could do something like this to manipulate the x-axis tick labels
> directly.  (But if you do this, don't forget when looking at your plot
> and modifying your plot code that you are really still plotting a
> variable in degrees even if your label is in hours!  e.g. your limits
> would still have to be degrees )
> 
> fig = plt.figure()
> ax = fig.add_subplot(111)
> 
> [ Code in here to plot your data and set axis limits. ]
> 
> # Need to draw the canvas in order for ticklabels to be set:
> fig.canvas.draw()
> ticklist= ax.get_xticklabels()
> new_label_list = []
> for label in ticklist:
>      # Get rid of dollar signs if using Latex labels:
>      string= label.get_text().replace('$', '')
>      # Some labels may be blank, leave as-is:
>      if string == '':
>          new_label = string
>      else:
> # Get numeric equivalent, change to hours:
>          tick_num = float(string)
>          tick_num = tick_num/15.
> # Note that this rounds to integer, might not be what you want:
>          tick_string = "%d" % tick_num
> # Add a raised "h" to denote hours:
>          new_label = "$" + tick_string + "^h$"
>      new_label_list.append(new_label)
> new = ax.set_xticklabels(new_label_list)
> 
> (Based on code from
> http://stackoverflow.com/questions/11244514/matplotlib-modify-tick-label-text 
> )
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20140405/64cd56ac/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Attached.txt
URL: <http://mail.python.org/pipermail/astropy/attachments/20140405/64cd56ac/attachment.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20140405/64cd56ac/attachment-0001.html>


More information about the AstroPy mailing list