[AstroPy] How to convert pixel position to latitude and longitude?

Stuart Mumford stuart at cadair.com
Mon Apr 27 04:53:27 EDT 2015


Hello,

The SunPy library has the tools to do what you wish.

First create a SunPy map: 
http://docs.sunpy.org/en/latest/code_ref/map.html#creating-map-objects

Then extract the HPC coordinate for a given  pixel: 
http://docs.sunpy.org/en/latest/code_ref/map.html#sunpy.map.mapbase.GenericMap.pixel_to_data

Then convert that pixel to HGS lon/lat: 
http://docs.sunpy.org/en/latest/api/sunpy.wcs.convert_hpc_hg.html#sunpy.wcs.convert_hpc_hg

If you wish for more help, specific to the SunPy library, you might be 
interested in the sunpy mailing list: sunpy at googlegroups.com

Stuart

On 23/04/15 13:42, 李辉 wrote:
>
> In HMI fits file , the data block represents the solar disk. I want to 
> get the latitude and longitude of pixels on the solar disk.
>
> I thought the astropy.wcs package can do this, but it did not work! 
> Perhaps , i did not find a right way to use it. Could you help me, 
> thanks a lot!
>
> --------------------------------
>
> NULL
>
>
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20150427/2710bd88/attachment.html>


More information about the AstroPy mailing list