Skip to content

Commit

Permalink
Do not be overzelous with bin times, it produces unwanted side effects
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobachetti committed Feb 2, 2024
1 parent 06fc297 commit 32d2edb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions hendrics/fspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ def calc_pds(

if pdsrebin is not None and pdsrebin != 1:
pds = pds.rebin(pdsrebin)

pds.instr = instr
pds.fftlen = fftlen
pds.back_phots = back_ctrate * fftlen
Expand Down Expand Up @@ -860,7 +859,7 @@ def main(args=None):
log.setLevel(args.loglevel)

with log.log_to_file("HENfspec.log"):
bintime = np.longdouble(interpret_bintime(args.bintime))
bintime = interpret_bintime(args.bintime)

fftlen = args.fftlen
pdsrebin = args.rebin
Expand Down
2 changes: 1 addition & 1 deletion hendrics/lcurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def lcurve_from_events(
evdata = deorbit_events(evdata, deorbit_par)
deorbit_tag = "_deorb"

bintime = np.longdouble(interpret_bintime(bintime))
bintime = interpret_bintime(bintime)

tag = ""

Expand Down
6 changes: 3 additions & 3 deletions hendrics/tests/test_fspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def setup_class(cls):
)
hen.read_events.main(command.split())

command = "{0} {1} --nproc 2 -b 0.5".format(cls.ev_fileA, cls.ev_fileB)
command = "{0} {1} --nproc 2 -b -1".format(cls.ev_fileA, cls.ev_fileB)
hen.lcurve.main(command.split())
cls.lcA = cls.ev_fileA.replace("_ev", "_lc")
cls.lcB = cls.ev_fileB.replace("_ev", "_lc")
Expand Down Expand Up @@ -219,14 +219,14 @@ def test_pds_leahy(self):
evdata = self.ev_fileA
lcdata = self.lcA

command = "{0} -f 128 -k PDS --norm leahy -b 0.5".format(evdata)
command = "{0} -f 128. -k PDS --norm leahy -b -1".format(evdata)
hen.fspec.main(command.split())
evout = evdata.replace("_ev", "_pds")
assert os.path.exists(evout)
evpds = hen.io.load_pds(evout)
io.remove_pds(evout)

command = "{0} -f 128 -k PDS --save-all --norm leahy".format(lcdata)
command = "{0} -f 128. -k PDS --save-all --norm leahy".format(lcdata)
hen.fspec.main(command.split())
lcout = lcdata.replace("_lc", "_pds")
assert os.path.exists(lcout)
Expand Down

0 comments on commit 32d2edb

Please sign in to comment.