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

Negative velocity in header #108

Closed Jordatious closed 2 years ago

Jordatious commented 2 years ago

An IDIA user is having an issue with how CARTA is displaying the velocities. Below is the header, and the original ticket from the user. @veggiesaurus suggested @kswang1029 may know what's happening here.

SIMPLE  =                    T / conforms to FITS standard
BITPIX  =                  -32 / array data type
NAXIS   =                    3 / number of array dimensions
NAXIS1  =                 2401
NAXIS2  =                 2404
NAXIS3  =                   13
BMAJ    =   9.023228023805E-03
BMIN    =   7.187573277466E-03
BPA     =  -5.888675818494E+01
BTYPE   = 'Intensity'
OBJECT  = '        '
BUNIT   = 'beam-1 Jy'          / Brightness (pixel) unit
DATE    = '2021-08-18T13:25:26.604000' /Date FITS file was written
ORIGIN  = 'CASA 5.8.0-109'
BEAM    = 'Beam: BMAJ=32.483620885698 arcsec BMIN=25.8752637988776 arcsec &'    CONTINUE  'BPA=-58.88675818494 deg'
SLICE   = '[[(0, 570, None), (932, 3336, None), (2563, 4964, None)]]'
WCSAXES =                    3 / Number of coordinate axes
CRPIX1  =                773.0 / Pixel coordinate of reference point
CRPIX2  =               1219.0 / Pixel coordinate of reference point
CRPIX3  =               -492.0 / Pixel coordinate of reference point
CDELT1  =         -0.000833333 / [deg] Coordinate increment at reference point
CDELT2  =          0.000833333 / [deg] Coordinate increment at reference point
CDELT3  =     -52.188085856845 / [m/s] Coordinate increment at reference point
CUNIT1  = 'deg'                / Units of coordinate increment and value
CUNIT2  = 'deg'                / Units of coordinate increment and value
CUNIT3  = 'km s-1  '           / Units of coordinate increment and value
CTYPE1  = 'GLON-TAN'           / galactic longitude, gnomonic projection
CTYPE2  = 'GLAT-TAN'           / galactic latitude, gnomonic projection
CTYPE3  = 'VOPT-F2W'           / Optical velocity (linear in frequency)
CRVAL1  =      -35.57328166552 / [deg] Coordinate value at reference point
CRVAL2  =   -0.005952530480807 / [deg] Coordinate value at reference point
CRVAL3  =      25513.277174332 / [m/s] Coordinate value at reference point
LONPOLE =                180.0 / [deg] Native longitude of celestial pole
LATPOLE =   -0.005952530480807 / [deg] Native latitude of celestial pole
RESTFRQ =         1420400000.0 / [Hz] Line rest frequency
TIMESYS = 'UTC'                / Time scale
MJDREFI =                  0.0 / [d] MJD of fiducial time, integer part
MJDREFF =                  0.0 / [d] MJD of fiducial time, fractional part
SPECSYS = 'HELIOCEN'           / Reference frame of spectral coordinates
HISTORY CASA START LOGTABLE
HISTORY 2021-08-18T12:56:17 INFO SRCCODE='::ImagePadder::_reportOldNewImageShape
HISTORY >s'
HISTORY Original Temporary_Image size => [7822, 5462, 570]
HISTORY 2021-08-18T12:56:17 INFO SRCCODE='::ImagePadder::_reportOldNewImageShape
HISTORY >s'
HISTORY New  size => [7842, 5482, 570]
HISTORY 2021-08-18T13:18:24 INFO SRCCODE='::BeamManipulator::rotate'
HISTORY Original Temporary_Image restoring beam: major: 32.4836 arcsec, minor: 2
HISTORY >5.8753 arcsec, pa: -58.7524 deg
HISTORY 2021-08-18T13:18:24 INFO SRCCODE='::BeamManipulator::rotate'
HISTORY New Temporary_Image restoring beam: major: 32.4836 arcsec, minor: 25.875
HISTORY >3 arcsec, pa: -58.8868 deg
HISTORY 2021-08-18T13:25:18 INFO SRCCODE='::ImageCropper::_reportOldNewImageShap
HISTORY >es'
HISTORY Original Temporary_Image size => [7842, 5482, 570]
HISTORY 2021-08-18T13:25:18 INFO SRCCODE='::ImageCropper::_reportOldNewImageShap
HISTORY >es'
HISTORY New T12_galactic.im size => [6687, 4315, 570]
HISTORY CASA END LOGTABLE
HISTORY Written by spectral_cube v0.5.0 on 2021/12/01-14:24:31
COMMENT Original Unit=Hz
COMMENT Original Type=FREQ

I'm cutting a sub cube using Spectral Cube. Everything looks fine when I check the specs with Python, but CARTA shows negative velocities when I open the sub sube. Any idea what I'm doing wrong? I'm sure I've done this exact thing before, successfully.

Original cube: SpectralCube with shape=(570, 4315, 6687) and unit=Jy / beam: n_x: 6687 type_x: GLON-TAN unit_x: deg range: -38.363582 deg: -32.796284 deg n_y: 4315 type_y: GLAT-TAN unit_y: deg range: -1.794926 deg: 1.794676 deg n_s: 570 type_s: VOPT-F2W unit_s: km / s range: -1697.821 km / s: 25513.277 km / s

Sub cube: SpectralCube with shape=(13, 2404, 2401) and unit=Jy / beam: n_x: 2401 type_x: GLON-TAN unit_x: deg range: -36.929697 deg: -34.929974 deg n_y: 2404 type_y: GLAT-TAN unit_y: deg range: -1.020782 deg: 0.981387 deg n_s: 13 type_s: VOPT-F2W unit_s: km / s range: 1133.451 km / s: 1670.313 km / s

Sub cube in CARTA (the cube itself is correct, except for the velocities/frequencies): image

kswang1029 commented 2 years ago

CRPIX3 = -492.0 / Pixel coordinate of reference point CDELT3 = -52.188085856845 / [m/s] Coordinate increment at reference point CUNIT3 = 'km s-1 ' / Units of coordinate increment and value CTYPE3 = 'VOPT-F2W' / Optical velocity (linear in frequency) CRVAL3 = 25513.277174332 / [m/s] Coordinate value at reference point

The units are not consistently defined in the header. If we treat all the numbers as km/s it seems we can reproduce the issue reported.

bonus: BUNIT = 'beam-1 Jy' / Brightness (pixel) unit this is unusually used 🧐

kswang1029 commented 2 years ago

We better use m/s as unit elsewhere, following the FITS standard.

Jordatious commented 2 years ago

Thanks @kswang1029!