From 23f5035a59fc154087726cb16272bb6029e4b37d Mon Sep 17 00:00:00 2001 From: weygoldt <88969563+weygoldt@users.noreply.github.com> Date: Tue, 24 Jan 2023 17:47:43 +0100 Subject: [PATCH] plot subset --- code/chirpdetection.py | 12 ++++++------ code/extract_chirps.py | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/chirpdetection.py b/code/chirpdetection.py index 1d67e39..541015d 100755 --- a/code/chirpdetection.py +++ b/code/chirpdetection.py @@ -102,7 +102,7 @@ class ChirpPlotBuffer: self.t0 = 0 fig = plt.figure( - figsize=(14 / 2.54, 20 / 2.54) + figsize=(14 * ps.cm, 18 * ps.cm) ) gs0 = gr.GridSpec( @@ -652,16 +652,16 @@ def chirpdetection(datapath: str, plot: str, debug: str = 'false') -> None: raw_time = np.arange(data.raw.shape[0]) / data.raw_rate # good chirp times for data: 2022-06-02-10_00 - window_start_index = (3 * 60 * 60 + 6 * 60 + 43.5) * data.raw_rate - window_duration_index = 60 * data.raw_rate + # window_start_index = (3 * 60 * 60 + 6 * 60 + 43.5) * data.raw_rate + # window_duration_index = 60 * data.raw_rate # t0 = 0 # dt = data.raw.shape[0] # window_start_seconds = (23495 + ((28336-23495)/3)) * data.raw_rate # window_duration_seconds = (28336 - 23495) * data.raw_rate - # window_start_index = 0 - # window_duration_index = data.raw.shape[0] + window_start_index = 0 + window_duration_index = data.raw.shape[0] # generate starting points of rolling window window_start_indices = np.arange( @@ -675,7 +675,7 @@ def chirpdetection(datapath: str, plot: str, debug: str = 'false') -> None: multiwindow_chirps = [] multiwindow_ids = [] - for st, window_start_index in enumerate(window_start_indices): + for st, window_start_index in enumerate(window_start_indices[3175:]): logger.info(f"Processing window {st+1} of {len(window_start_indices)}") diff --git a/code/extract_chirps.py b/code/extract_chirps.py index 61c8564..5d5580e 100644 --- a/code/extract_chirps.py +++ b/code/extract_chirps.py @@ -10,7 +10,7 @@ from IPython import embed def main(datapaths): for path in datapaths: - chirpdetection(path, plot='false') + chirpdetection(path, plot='show') if __name__ == '__main__': @@ -45,6 +45,7 @@ if __name__ == '__main__': recs = pd.DataFrame(columns=['recording'], data=valid_datasets) recs.to_csv('../recs.csv', index=False) + datapaths = ['../data/mount_data/2020-03-25-10_00/'] main(datapaths) # window 1524 + 244 in dataset index 4 is nice example