subcube extraction keeps old data_header
When extracting a subcube using the Cube[] notation, it keeps the old data_header instead of updating the relevant keywords. Example when extracting from a MUSE cube of 552x436x3680 pixels:
cube = mpdaf.obj.Cube('CUBEec.fits')
print('data_header (before):', cube.data_header['CRVAL3'],
cube.data_header['CRPIX3'], cube.data_header['NAXIS3'])
cubeX = cube[1652:1670, 133:215, 352:464]
cubeX.info()
print('data_header (after):', cubeX.data_header['CRVAL3'],
cubeX.data_header['CRPIX3'], cubeX.data_header['NAXIS3'])
As output I get:
data_header (before): 4749.9892578125 1.0 3680
[INFO] 18 x 82 x 112 Cube (CUBEec.fits)
INFO:mpdaf.obj.data:18 x 82 x 112 Cube (CUBEec.fits)
[INFO] .data(18 x 82 x 112) (1e-20 erg / (Angstrom cm2 s)), .var(18 x 82 x 112)
INFO:mpdaf.obj.data:.data(18 x 82 x 112) (1e-20 erg / (Angstrom cm2 s)), .var(18 x 82 x 112)
[INFO] center:(-27:36:06.4085,13:56:11.3192) size:(16.400",22.400") step:(0.200",0.200") rot:-0.0 deg frame:FK5
INFO:mpdaf.obj.coords:center:(-27:36:06.4085,13:56:11.3192) size:(16.400",22.400") step:(0.200",0.200") rot:-0.0 deg frame:FK5
[INFO] wavelength: min:6814.99 max:6836.24 step:1.25 Angstrom
INFO:mpdaf.obj.coords:wavelength: min:6814.99 max:6836.24 step:1.25 Angstrom
data_header (after): 4749.9892578125 1.0 3680
I would have expected that the NAXIS and CRPIX values would get adapted to the extraction region, at least that's what IRAF has done 20 years ago...
[P.S.: I hope this is still the correct way to file MPDAF tickets...]