HARMONI-ELT / HSIM

HSIM: HARMONI simulation pipeline
BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

Inconsistent WCS keywords in output cube #7

Closed novaric closed 10 months ago

novaric commented 11 months ago

Hello,

When running an input cube scene through HSIM3 I get inconsistent WCS entries in the output cube.

The input cube has the following wavelength WCS entries: CRVAL3 = 19381.215277778 / Coordinate value at reference point CRPIX3 = 1.0 / Pixel coordinate of reference point CUNIT3 = 'Angstrom' / Units of coordinate increment and value CTYPE3 = 'wavelength' / Coordinate type code CDELT3 = 2.4305555551181 / Coordinate increment at reference point CD1_1 = -4.18E-06 CD2_2 = 4.18E-06 CD2_1 = 0.0 CD1_2 = 0.0 CD3_3 = 2.4305 CD3_1 = 0.0 CD3_2 = 0.0 CD1_3 = 0.0 CD2_3 = 0.0 CDELT1 = 4.18E-06 CDELT2 = 4.18E-06

But the output cubes have the following entries:

CRVAL3 = 1.951 / Coordinate value at reference point CRPIX3 = 1 / Pixel coordinate of reference point CUNIT3 = 'micron ' / Units of coordinate increment and value CTYPE3 = 'wavelength' / Coordinate type code CDELT3 = 0.000141405610155732 / Coordinate increment at reference point CD3_3 = 2.4305

Here the CD3_3 and CDELT3 are incompatible, and ds9 produces erroneous wcs when opening the cube in wavelength.

And for the spatial coordinates:

CRPIX1 = 1 / Pixel coordinate of reference point CRPIX2 = 1 / Pixel coordinate of reference point CUNIT1 = 'mas ' / Units of coordinate increment and value CUNIT2 = 'mas ' / Units of coordinate increment and value CTYPE1 = 'RA---TAN' / Coordinate type code CTYPE2 = 'DEC--TAN' / Coordinate type code CRVAL1 = -1904.148 / [arcsec] Coordinate value at reference point CRVAL2 = -2084.148 / [arcsec] Coordinate value at reference point LATPOLE = 90.0 / [deg] Native latitude of celestial pole BUNIT = 'erg/s/cm2/um/arcsec2' / data unit type RADESYS = 'FK5 ' CD1_1 = -4.18E-06 CD2_2 = 4.18E-06 CD2_1 = 0.0 CD1_2 = 0.0 CD3_3 = 2.4305 CD3_1 = 0.0 CD3_2 = 0.0 CD1_3 = 0.0 CD2_3 = 0.0 CDELT1 = 20.0 CDELT2 = 20.0

Here again the CDELT1 and CDELT2 are inconsistent with the CD1_1 and CD2_2 entries. This makes ds9 being confused about the pixel scale and overall RA / DEC coordinates.

Johan

pereirasantaella commented 10 months ago

Thanks for reporting this problem. It is now fixed in a4bed528c472f3005024d91303321645b919be60