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

Import data from pygdsm #124

Open
mkolopanis opened this issue Mar 9, 2021 · 4 comments
Open

Import data from pygdsm #124

mkolopanis opened this issue Mar 9, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@mkolopanis
Copy link
Member

pygdsm is one of the only python wrappers for GSM data (both 2008 and 2016). Due to licensing we cannot import this module directly (depends on healpy/GPL license) but we could construct a function which coerces maps created by this module into a sky object.

@mkolopanis mkolopanis added the enhancement New feature or request label Mar 9, 2021
@mkolopanis
Copy link
Member Author

This is basically what I came up with in a jupyter notebook. Not sure how much more we would need? Here Galactic is an astropy coordinates object that you can just import from the module.

gsm2008_coords = HEALPix(ahp.npix_to_nside(gsm2008_cube.shape[1]), frame=Galactic())
coords = gsm2008_coords.healpix_to_skycoord(np.arange(gsm2008_coords.npix))
coords_icrs = coords.transform_to("icrs")
ra, dec = coords_icrs.ra, coords_icrs.dec
skymod_freqs  = freqs * units.Hz
stokes = units.Quantity(np.zeros((4, freqs.size, gsm2008_coords.npix)), unit=units.K)
stokes[0] = gsm2008_cube << units.K

@aelanman
Copy link
Contributor

I think this is a specific case of issue #119 . We've discussed adding frame transformations to our setup.

@mkolopanis
Copy link
Member Author

yeah this very well could be. It just came up again today and felt at least different enough to me at the time 🤔

@bhazelton
Copy link
Member

@mkolopanis now that we've implemented the frame support, is this still something we should do?

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

No branches or pull requests

3 participants