Commit 8514ef5d authored by Wilfried Mercier's avatar Wilfried Mercier
Browse files

Added a few lines to deal with WCSAXES keyword

parent 9d57e78e
......@@ -1238,6 +1238,19 @@ def buildmaps(conf, cube, hdr, var=None, plot=False, debug=False, free_ratio=Fal
del hdr['CD1_3']
if 'CDELT3' in hdr.keys():
del hdr['CDELT3']
# Added by Wilfried to deal with MXDF cubes
if 'WCSAXES' in hdr:
# If exactly 3 (cube), we change it to 2 (image)
if hdr['WCSAXES'] == 3:
hdr['WCSAXES'] = 2
# If < 2 or > 3 then that's weird and we print a warning and we put 2 instead in the images
elif hdr['WCSAXES'] < 2 or hdr['WCSAXES'] > 3:
print('WCSAXES keyword in init cu1be is %d but should be 3. Putting 2 in the images instead.' %hdr['WCSAXES'])
hdr['WCSAXES'] = 2
suff = ''
if conf['COMMW']:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment