CARTAvis / carta

To CARTA users, this repo holds the CARTA release packages. Please use this repo to log bugs and feature requests. These will be triaged by the development team and prioritised as necessary in the development cycles.
19 stars 0 forks source link

Incorrect spectral axis label / scaling for some data cubes: displaying channel number but mis-labeled as wavelength #189

Closed privong closed 10 months ago

privong commented 1 year ago

Describe the bug When viewing some data cubes in CARTA the spectral axis range is not properly calculated. The numbers displayed on the image panel info overlay and the Z-profile are the channel numbers of the cube, but labeling of the numbers incorrectly states that it is the Wavelength axis. I've generally seen this with MUSE IFU cubes downloaded from the ESO archive. I've included a screenshot below; the wavelength range of the cube is approximately 480-930 nm, but the z profile (upper right) shows a range of 1-3680 (this is the number of channels in the cube) and mis-labels the axis as "Air Wavelength (angstroms)".

I've experienced this bug in CARTA versions 3.0.0 and 4.0.0-beta1, both via remote operation to NRAO's lustre system and the local installation on my own machine.

To Reproduce Steps to reproduce the behavior:

  1. Load a datacube (e.g., for NGC 3256 from this link: https://archive.eso.org/scienceportal/home?data_release_date=*:2023-06-25&pos=156.96368,-43.90376&r=0.016667&fovcorners=157.237158,-44.039914,156.690731,-44.039915,156.691982,-43.766578,157.235906,-43.766576&observatory=%22La%20Silla%20Paranal%20APEX%22&dp_type=CUBE&sort=dist,-fov,-obs_date&s=P%2fDSS2%2fcolor&f=0.392497&fc=157.235906,-43.766576&cs=J2000&av=true&ac=false&c=9,10,11,12,13,14,15,16,17,18,19,20,21&ta=RES&dts=true&sdtm=%7b%22CUBE%22%3atrue%7d&at=156.96368,-43.90376&sr=i)
  2. View a spectral profile for any aperture or spatial location in the cube. The spectral axis values and labels are incorrect.
  3. Attempting to change the Spectal coordinate from an "Air wavelength" to another type (e.g., frequency) causes the window CARTA to become unresponsive.

Expected behavior The spectral dimension should show the correct wavelength units based on the header and it should be possible to convert the display to other units (e.g., frequency).

Screenshots or videos

Screen Shot 2023-06-24 at 14 58 49

Platform info (please complete the following information):

Additional context Here is a copy of the header for the screenshot shown above:

# NGC3256-outer-ADP.2021-01-20T02 40 44.857.fits
XTENSION = IMAGE / IMAGE extension
BITPIX = -32 / number of bits per data pixel
NAXIS = 3 / number of data axes
NAXIS1 = 1968 / length of data axis 1
NAXIS2 = 607 / length of data axis 2
NAXIS3 = 3681 / length of data axis 3
PCOUNT = 0 / required keyword; must = 0
GCOUNT = 1 / required keyword; must = 1
EXTNAME = DATA / This extension contains data values
HDUCLASS = ESO / class name (ESO format)
HDUDOC = DICD / document with class description
HDUVERS = DICD version 6 / version number (according to spec v2.5.1)
HDUCLAS1 = IMAGE / Image data format
HDUCLAS2 = DATA / this extension contains the data itself
ERRDATA = STAT / pointer to the variance extension
OBJECT = AM1025-433 (DATA)
BUNIT = 10**(-20)erg.s**(-1).cm**(-2).angstrom**(-1)
CRPIX1 = 910.441142061412 / Pixel coordinate of reference point
CRPIX2 = 453.878386376509 / Pixel coordinate of reference point
CD1_1 = -5.555555555556E-05 / Coordinate transformation matrix element
CD1_2 = 0.000000000000E+00 / Coordinate transformation matrix element
CD2_1 = 0.000000000000E+00 / Coordinate transformation matrix element
CD2_2 = 5.555555555556E-05 / Coordinate transformation matrix element
CUNIT1 = deg / Units of coordinate increment and value
CUNIT2 = deg / Units of coordinate increment and value
CTYPE1 = RA---TAN / Right ascension, gnomonic projection
CTYPE2 = DEC--TAN / Declination, gnomonic projection
CSYER1 = 1.229839976100E-05 / [deg] Systematic error in coordinate
CSYER2 = 9.269008101560E-06 / [deg] Systematic error in coordinate
CRVAL1 = 1.569720170000E+02
CRVAL2 = -4.388987000000E+01
CTYPE3 = AWAV
CUNIT3 = angstrom
CD3_3 = 1.250000000000E+00
CRPIX3 = 1
CRVAL3 = 4.750301269531E+03
CRDER3 = 2.600000000000E-02 / [angstrom] Random error in spectral coordinate
CD1_3 = 0.000000000000E+00
CD2_3 = 0.000000000000E+00
CD3_1 = 0.000000000000E+00
CD3_2 = 0.000000000000E+00
TITLE = AM1025-433_2897035_2020-12-07T06:40:35.829_WFM-NOAO-N_OBJ
CHECKSUM = CEhGECe9CCeECCe9 / HDU checksum updated 2021-01-20T02:35:48
DATASUM = 1184944154 / data unit checksum updated 2021-01-20T02:35:48

Add any other context about the problem here.

kswang1029 commented 1 year ago

We are fixing this issue and this will be part of the v4-stable release.

privong commented 1 year ago

Great, thank you. Let me know if you need any additional info from me.

kswang1029 commented 10 months ago

This should have been fixed in v4-stable release.