aplpy / aplpy

Astronomical Plotting Library in Python
http://aplpy.github.com
Other
171 stars 82 forks source link

ValueError: More than one HDU is present, please specify HDU to use with ``hdu_in=`` option #427

Open mbarai opened 5 years ago

mbarai commented 5 years ago

I am trying to create an RGB fits cube, but every time I try to do it, it asks me to specify the header, but none of the syntax I use it correct and there is no documentation of it online. PLEASE HELP!!! I have been stuck since almost 3 days

INPUT: aplpy.make_rgb_cube(['/Users/milibarai/Desktop/Lensed_Galaxies/RELICS/A2163/hst_14096_a2_wfc3_ir_f160w_drz.fits','/Users/milibarai/Desktop/Lensed_Galaxies/RELICS/A2163/hst_14096_a2_wfc3_ir_f105w_drz.fits','/Users/milibarai/Desktop/Lensed_Galaxies/RELICS/A2163/hst_12253_07_acs_wfc_f606w_drz.fits'],'/Users/milibarai/Desktop/Lensed_Galaxies/RELICS/rgbcube.fits')

inonchiu commented 11 months ago

I did two modifications as a simple fix in the file rgb.py:

  1. wcs, shape = find_optimal_celestial_wcs(files, frame=frame, auto_rotate=auto_rotate) -> wcs, shape = find_optimal_celestial_wcs([ fits.open(fis)[1] for fis in files ], frame=frame, auto_rotate=auto_rotate)

  2. image_cube[i, :, :] = reproject_interp(filename, wcs, shape_out=shape)[0] -> image_cube[i, :, :] = reproject_interp(fits.open(filename)[1], wcs, shape_out=shape)[0]