You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromastropyimportunitsasufromastropy.ioimportfitsfromastropy.nddataimportStdDevUncertaintyfromastropy.wcsimportWCSfromspecutilsimportSpectrum1DfromjdavizimportCubevizdata_label='M58_SL1_cube'# Also works with SL2sci_filename=f'{data_label}.fits'unc_filename=f'{data_label}_unc.fits'pf_sci=fits.open(sci_filename)
pf_unc=fits.open(unc_filename)
# Image has SIP distortion that will break loading,# so we have to delete them. See# https://docs.astropy.org/en/stable/wcs/note_sip.htmlsip_list= ('A_ORDER', 'A_0_2', 'A_0_3', 'A_1_1', 'A_1_2', 'A_2_0', 'A_2_1', 'A_3_0', 'A_DMAX',
'B_ORDER', 'B_0_2', 'B_0_3', 'B_1_1', 'B_1_2', 'B_2_0', 'B_2_1', 'B_3_0', 'B_DMAX',
'AP_ORDER', 'AP_0_1', 'AP_0_2', 'AP_0_3', 'AP_1_0', 'AP_1_1', 'AP_1_2', 'AP_2_0', 'AP_2_1', 'AP_3_0',
'BP_ORDER', 'BP_0_1', 'BP_0_2', 'BP_0_3', 'BP_1_0', 'BP_1_1', 'BP_1_2', 'BP_2_0', 'BP_2_1', 'BP_3_0')
forkeyinsip_list:
delpf_sci[0].header[key]
w=WCS(pf_sci[0].header, pf_sci)
# If this is not StdDevUncertainty, change to use the correct representation.# We just assume this already aligns with the SCI data file.unc=StdDevUncertainty(pf_unc[0].data)
flux=pf_sci[0].data*u.Unit(pf_sci[0].header['BUNIT'])
sp=Spectrum1D(flux=flux, wcs=w, uncertainty=unc, meta=dict(pf_sci[0].header))
cubeviz=Cubeviz()
cubeviz.show()
cubeviz.load_data(sp, data_label=data_label)
# When you are all done. Only do this at the end of the session.pf_sci.close()
pf_unc.close()
Try with:
SL1
SL2
cc @PatrickOgle
🐱
The text was updated successfully, but these errors were encountered: