Skip to content

Commit

Permalink
Sub-second timing errors (#60)
Browse files Browse the repository at this point in the history
Now officially crashes out if you try to use sub-second timing for the lightcurves using nuproducts. If you want to go that fast, use Stingray/HENDRICS.
  • Loading branch information
bwgref authored Mar 18, 2021
1 parent 2ad9298 commit 3a603ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nustar_gen/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def make_lightcurve(infile, mod, src_reg,
High-energy bound. Default is 20 keV.
time_bin: astropy unit
Length of the time bin. Default is 100*u.s
Length of the time bin. Default is 100*u.s. Min is 1*u.s
outpath: str
Optional. Default is to put the lightcurves in the same location as infile
Expand All @@ -164,6 +164,8 @@ def make_lightcurve(infile, mod, src_reg,
assert os.path.isfile(infile), 'make_lightcurve: infile does not exist!'
assert os.path.isfile(src_reg), 'make_lightcurve: src_reg does not exist!'

assert time_bin.to(u.s) > 1*u.s, f'make_lightcurve: {time_bin} too fast, use another tool.'

if bgd_reg != 'None':
assert os.path.isfile(bgd_reg), 'make_lightcurve: bgd_reg does not exist!'
bkgextract='yes'
Expand All @@ -187,6 +189,9 @@ def make_lightcurve(infile, mod, src_reg,
# directory already exists
pass
time_bin = (time_bin.to(u.s)).value



stemout = f'nu{seqid}{mod}{mode}_{reg_base}_{elow}to{ehigh}_{time_bin:3.4}s'
lc_script = os.path.join(outdir, f'runlc_{stemout}.sh')

Expand Down Expand Up @@ -940,6 +945,7 @@ def make_det1_lightcurve(infile, mod, obs,

assert os.path.isfile(infile), 'make_det1_lightcurve: infile does not exist!'

assert time_bin.to(u.s) > 1*u.s, f'make_det1_lightcurve: time_bin {time_bin} too fast, use another tool.'

evdir = obs.evdir
seqid = obs.seqid
Expand Down

0 comments on commit 3a603ca

Please sign in to comment.