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

bug in spatial coordinates? #280

Closed
astroklaassen opened this issue Feb 17, 2016 · 7 comments
Closed

bug in spatial coordinates? #280

astroklaassen opened this issue Feb 17, 2016 · 7 comments

Comments

@astroklaassen
Copy link

I've got a bunch of (ALMA) spectral cubes which, when I read in to SpectralCube, end up getting shifted by a couple of arcmin (in both RA and DEC). This includes example cubes I've created myself, and those created by someone else. I noticed this shift when I tried to plot continuum contours on top of a moment map to find the new map was spatially offset outside my primary beam.

The input cubes haven't been modified since they were exported from CASA images (one set created with dropstokes=True, the other set with the degenerate axis left in). This happens before I do any processing to the cube, i.e. the simple case of:

cube = SpectralCube.read(infile)
cube.write(outfile)

already corrupts the spatial coordinate information (the spectral limits remain unchanged).

I've attached two screen captures showing the FOV of the original FITS cube, and that output from Spectral Cube (in this case, a cube with a degenerate stokes axis)
orig_cube_coordinates
spectralcube_coordinates

any suggestions?

possibly related, when I import the cubes, I get a number of warnings along the lines of:

WARNING: FITSFixedWarning: PC01_01 = 1.000000000000E+00
indices in parameterized keywords must not have leading zeroes. [astropy.wcs.wcs]

which I haven't been able to work through, since those header keywords don't seem to have any leading zeros.

Versions:
spectral_cube: 0.3.1
python: 2.7
(ipython 3.1.1)
astropy 1.1.1
(mostly installed with anaconda - not anaconda2)

@keflavich
Copy link
Contributor

Could you send over a full copy of a header (or post it here)?

@astroklaassen
Copy link
Author

full fits cube sent.

@keflavich
Copy link
Contributor

This is a major bug, and it's not in spectral-cube, it's in astropy.wcs. I'll post something upstream. The CRVAL values are getting ridiculously truncated!

@astroklaassen
Copy link
Author

Thanks for the update. glad it's not just me.

@keflavich
Copy link
Contributor

@astroklaassen if you pull the latest astropy master, this issue is fixed. I was also using an out-of-date astropy; I think this issue was fixed within the last ~2 weeks.

@keflavich
Copy link
Contributor

the issue was fixed by this commit:
astropy/astropy#4579

@astroklaassen
Copy link
Author

updated astropy master, and, as expected, the coordinates are no longer truncated.

Thank you very much.

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

2 participants