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

Using reproject_from_healpix produces an array with 3 dimensions #341

Open
Kimmo1 opened this issue Feb 28, 2023 · 0 comments
Open

Using reproject_from_healpix produces an array with 3 dimensions #341

Kimmo1 opened this issue Feb 28, 2023 · 0 comments

Comments

@Kimmo1
Copy link

Kimmo1 commented Feb 28, 2023

Hi

I am using reproject_from_healpix with a Healpix map of hydrogen HI data (LAB_fullvel.fits), which is available at
https://lambda.gsfc.nasa.gov/product/foreground/fg_LAB_HI_Survey_get.html
Also the Fits header of the file is available on the same page.

I am trying to reproject part of the Healpix map into tangential projection, with RA and Dec coordinates. The Python program I used is at the end of this message. The program works without errors, but the array which the reproject_from_healpix produces has three dimensions, like (100,100,1024)

What is the reason for this, where is that axis with a length of 1024 coming from ?

As far as I understand, the Healpix data is not a data cube, having a third axis for velocity.

The Fits header has
TFORM1 = '1024E ' / data format of field: 4-byte REAL
Does this has something to do with the extra dimension with a length of 1024 ?

Thanks for any help, Kimmo Lehtinen


from astropy.io import fits
from astropy.wcs import WCS
from reproject import reproject_from_healpix

hdu = fits.open('LAB_fullvel.fits')[1]

target_header = fits.Header.fromstring("""
NAXIS = 2
NAXIS1 = 100
NAXIS2 = 100
CTYPE1 = 'RA---TAN'
CRPIX1 = 50.5
CRVAL1 = 239.2
CDELT1 = -0.3
CUNIT1 = 'deg '
CTYPE2 = 'DEC--TAN'
CRPIX2 = 50.5
CRVAL2 = -53.1
CDELT2 = 0.3
CUNIT2 = 'deg '
COORDSYS= 'icrs '
""", sep='\n')

data = hdu.data['TEMPERATURE']

array, footprint = reproject_from_healpix((data, 'G'), target_header, nested=False)

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