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
Please fill out relevant sections below; remove those that are unused.
Describe the bug
When performing analysis on some injected light curves with the rubin-ToO flag all the light curve data is removed by the function processData() in utils.py. This is caused by the timeshift inside the injection file being ignored when processing data. Normally this does not cause an error because the data points span a large enough range to still be captured, but with rubin ToO, the data is bunched together within one day. Thus if the injected timeshift is >1day all the data gets filtered out.
UserWarning: genfromtxt: Empty input file: "/lustre/scratch5/bking/kn_only/outdir/TP1_rubin/pm_TP1_rubin_1//ev.dat"
dead_points = np.genfromtxt(dir_ + "/ev.dat")
Traceback (most recent call last):
File "/usr/projects/nsmergers/nmma_0p2p0/bin/lightcurve-analysis", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/projects/nsmergers/nmma_0p2p0/lib/python3.11/site-packages/nmma/em/analysis.py", line 1020, in main
analysis(args)
File "/usr/projects/nsmergers/nmma_0p2p0/lib/python3.11/site-packages/nmma/em/analysis.py", line 704, in analysis
result = bilby.run_sampler(
^^^^^^^^^^^^^^^^^^
File "/usr/projects/nsmergers/nmma_0p2p0/lib/python3.11/site-packages/bilby/core/sampler/__init__.py", line 234, in run_sampler
result = sampler.run_sampler()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/projects/nsmergers/nmma_0p2p0/lib/python3.11/site-packages/bilby/core/sampler/base_sampler.py", line 97, in wrapped
output = method(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/projects/nsmergers/nmma_0p2p0/lib/python3.11/site-packages/bilby/core/sampler/pymultinest.py", line 178, in run_sampler
self.result.nested_samples = self._nested_samples
^^^^^^^^^^^^^^^^^^^^
File "/usr/projects/nsmergers/nmma_0p2p0/lib/python3.11/site-packages/bilby/core/sampler/pymultinest.py", line 201, in _nested_samples
np.vstack([dead_points, live_points]).copy(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/projects/nsmergers/nmma_0p2p0/lib/python3.11/site-packages/numpy/core/shape_base.py", line 289, in vstack
return _nx.concatenate(arrs, 0, dtype=dtype, casting=casting)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 0 and the array at index 1 has size 11
Expected behavior
All the injected light curve should be processed by NMMA and the likelihood doesn't evaluate to zero.
Platform information:
NMMA version: 0.2.0
Platform: Python 3.11.8
Additional context
Easy fix I used was:
# create the kilonova data if an injection set is given
if args.injection:
with open(args.injection, "r") as f:
injection_dict = json.load(
f, object_hook=bilby.core.utils.decode_bilby_json
)
injection_df = injection_dict["injections"]
injection_parameters = injection_df.iloc[args.injection_num].to_dict()
if "geocent_time" in injection_parameters:
tc_gps = time.Time(injection_parameters["geocent_time"], format="gps")
elif "geocent_time_x" in injection_parameters:
tc_gps = time.Time(injection_parameters["geocent_time_x"], format="gps")
else:
print("Need either geocent_time or geocent_time_x")
exit(1)
**if "timeshift" in injection_parameters:
timeshift = injection_parameters["timeshift"]
else:
timeshift = 0**
**trigger_time = tc_gps.mjd + timeshift**
The text was updated successfully, but these errors were encountered:
Please fill out relevant sections below; remove those that are unused.
Describe the bug
When performing analysis on some injected light curves with the rubin-ToO flag all the light curve data is removed by the function
processData()
in utils.py. This is caused by the timeshift inside the injection file being ignored when processing data. Normally this does not cause an error because the data points span a large enough range to still be captured, but with rubin ToO, the data is bunched together within one day. Thus if the injected timeshift is >1day all the data gets filtered out.To Reproduce
Steps to reproduce the behavior:
with the appropriate file paths
Expected behavior
All the injected light curve should be processed by NMMA and the likelihood doesn't evaluate to zero.
Platform information:
Additional context
Easy fix I used was:
The text was updated successfully, but these errors were encountered: