rdemaria / pytimber

Python Wrapping of CALS API
12 stars 23 forks source link

Querying time interval with LoggingDB #77

Closed pierrebarroca closed 4 years ago

pierrebarroca commented 4 years ago

When I do a query for given time interval I retrieve empty data.

This issue can be easily replicated with the LHC_Panel notebook in the examples querying a single measurement like this on cell 6 now=time.time() now_minus_a_day = now - 3600*24 ib1="LHC.BCTDC.A6R4.B1:BEAM_INTENSITY" ib2="LHC.BCTDC.A6R4.B2:BEAM_INTENSITY" nrg="LHC.BOFSU:OFSU_ENERGY" data=db.get(ib1,now_minus_a_day,now)

gives {'LHC.BCTDC.A6R4.B1:BEAM_INTENSITY': (array([], dtype=float64), array([], dtype=float64))}

querying a single datetime works

pierrebarroca commented 4 years ago

Here is an example.

Screenshot_2020-06-16 PytimberEXAMPLECO2 - Jupyter Notebook

rdemaria commented 4 years ago

With one timestamp you get the last data point before the timestamp. Are you sure this record is in between ts1 and ts2? What happens when the data range is larger?

pierrebarroca commented 4 years ago

I got the issue now. Thank you for the help.