Commit 2709745c authored by Carlo Ferrigno's avatar Carlo Ferrigno
Browse files

Write LC for IBIS did not produce the full output.

I use the writeto() of pyfits to avoid this.
v 1.3.7
parent 7799d4ee
......@@ -686,19 +686,17 @@ class INTEGRALwrapper(object):
ind_extension = 2
lc_fn = output_dir + "/%s_lc_%s_%s.fits" % (instrument, source_name.replace(' ', '_'), subcases_pattern)
lcprod[0].write_fits_file(lc_fn)
hdu = lcprod[0].data_unit[ind_extension].to_fits_hdu()
fits.writeto(lc_fn, hdu.data, header=hdu.header, overwrite=True)
ff = fits.open(lc_fn) # , mode='update'
mjdref = float(ff[ind_extension].header['MJDREF'])
tstart = float(ff[ind_extension].header['TSTART']) + mjdref
tstop = float(ff[ind_extension].header['TSTOP']) + mjdref
mjdref = float(hdu.header['MJDREF'])
tstart = float(hdu.header['TSTART']) + mjdref
tstop = float(hdu.header['TSTOP']) + mjdref
try:
exposure = float(ff[ind_extension].header['EXPOSURE'])
exposure = float(hdu.header['EXPOSURE'])
except:
exposure = -1
ff.close()
return lc_fn, tstart, tstop, exposure
@staticmethod
......
......@@ -192,7 +192,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.5"
"version": "3.8.5"
}
},
"nbformat": 4,
......
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