Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support images? #5

Open
tammojan opened this issue Nov 22, 2017 · 1 comment
Open

Support images? #5

tammojan opened this issue Nov 22, 2017 · 1 comment

Comments

@tammojan
Copy link
Contributor

I think it would be great to reproject all-sky images (FITS files) onto a polyhedron. Do you see a possibility to add that to this code? Or would it require a totally different approach?

For inspiration, see how Earth can be projected onto different foldable polyhedra: http://www.progonos.com/furuti/MapProj/Normal/ProjPoly/Foldout/foldout.html

@tammojan
Copy link
Contributor Author

To answer my own question: I took a map of 720x360 pixels (representing latitude and longitude), from http://vizier.cfa.harvard.edu/viz-bin/Cat?VIII/76 . The following code makes an entry in stars.dat for each pixel in the image:

from astropy.io import fits
import astropy.units as u
from astropy.coordinates import Longitude, Latitude

data=fits.open("lab.fit")[0].data[445,:,:]
(ymax, xmax) = data.shape

f = open('mystars.dat', 'w')
for (y, x), val in np.ndenumerate(data):
    ra_deg = x/(xmax-1)*360 * u.deg
    dec_deg = (y/(ymax-1)*180-90) * u.deg
    ra, dec = Longitude(ra_deg), Latitude(dec_deg)
    print("{},{},{}".format(ra.to_string(sep=" ", unit=u.hour),
                            dec.to_string(sep=" ", alwayssign=True, unit=u.deg),
                            val),
          file=f)

f.close()

Also, I made some changes to color stars according to magnitude, I'll create a PR for that.

labicosahedron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant