-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Current localization requires pytz-localized timestamps to run (but see: #1197). Add a few clarifying notes about this in the documentation:
- Expose the documentation about the need for localized datetimes in the higher level
localize_detectionsfunction, as currently it's only exposed increate_candidate_events-opensoundscape/opensoundscape/localization/synchronized_recorder_array.py
Lines 328 to 348 in 2f14a07
Example of adding `start_timestamp` to multi-index of detections df manually: ```python # assume we have a csv with columns file, start_time, end_time, class1, ... # e.g., the output of and opensoundscape CNN prediction workflow detections = pd.read_csv('my_opso_detections.csv',index_col=[0,1,2]) # let's assume all files started recording at the same time for this example: import pytz import datetime tz = pytz.timezone('America/New_York') detections = detections.reset_index(drop=False) detections['start_timestamp']=[ datetime.datetime(2024,1,1,10,0,0).astimezonoe(tz)+ datetime.timedelta(detections.at[i,'start_time']) for i in detections.index ] # add the start_timestamp column into the multi-index detections = detections.reset_index(drop=False).set_index( ["file", "start_time", "end_time", "start_timestamp"] ) ``` - See if we can fix the Python code rendering in RTD in this context
Metadata
Metadata
Assignees
Labels
No labels