Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patches #321

Merged
merged 59 commits into from
Mar 22, 2024
Merged

Patches #321

merged 59 commits into from
Mar 22, 2024

Conversation

kkappler
Copy link
Collaborator

A lot of housekeeping, some development on a jupyter notebook tour of EarthScope, and groundwork laid for coherence calculation via cross power feature.

This, plus a nearly ready manuscript for submission to JOSS (from joss branch) and much housekeeping of mth5 and mt_metadata say its time to merge into main and bump patch version.

- typo fix
- add comment for where segment weights maybe added
- Update process_mth5 so check_if_fc_levels_already_exist is done before initializing mth5s
- factor logic in TFKernel so that the actual check in the mth5 object is a standalone function
- address old Note#3 in check_if_fc_levels_already_exist (ambiguity eliminated)
- test was packing data but not metadata
- now metadata are being stored with the FCs
- replace variable decimation_and_stft_config with fc_config
- add a property to TFK returns a boolean if all_fcs_already_exist
- check all_fcs_already_exist at start of process_mth5
- if all_fcs_already_exist, do not build fc layers
- move fc_level checking into TFK, out of process_mth5
- remove mode kwarg from tfk.initialize_mth5s(), get this info from tfk.get_mth5_file_open_mode()
- kernel_dataset initializes "fc" column to None, rather than False
  - boolean state is set during check_if_fcs_already_exist
- kernel_dataset now has fc column of df initialized to None, rather than False
- This means that asserting equality between dataframes must handle fc column carefully
- Updated the test to respect this
- noted that the plotter for frq response not working in numpy 1.24, but
  OK in 1.25
- seems related to this: matplotlib/matplotlib#24106
- tidied up workflow in process_transfer_functions
- created placeholders for segment weights
- factored out some methods applied to X, Y, RR for readability
- add note about edf weights
- add logger message as well
Add some placeholders for coherence sorting

- frequency_band_helpers.py
  - add some placeholder methods
  - especially Spectrogram class -- a candidate to replace stft_obj in main flow

- kernel_dataset.py:
  - Factor update_survey_metadata method into its own method for better readability

- coherence_weights.py
  - experimental code for Jackkknife coherence weights

- xarray_helpers.py
  - Deprecate unusued cast_3d_stft_to_2d_observations method from xarray_helpers
  - move notes from this method into stack_fcs()
- added a note on issue #119 about how jackknife may be better applied
  after simple and multiple coherences
- misc notes/doc in coherence_weights and factoring
- adjust_band_for_coherence_sorting added to frequency_band_helpers
- make logic depend on mth5 file version
- re-add jupyter notebooks to tests to see if this has any effect there
- If fc_group already exists, get it instead of add it
- If fc_decimation already exists, get it instead of add it
- this reduces logging messages, but shouldn't change the behaviour
- have been experimenting with a few approaches to coherence sorting
- have decided on a method using Spectrogram() class _crosspower method
- most of what is in coherence sorting now is just messy, half tested, experimental muck
- but it has a form of what I would like later, and there may be a few nuggets
- so, against my better judgement I am committing it and tagging associated with issue #119
Copy link

codecov bot commented Mar 16, 2024

Codecov Report

Attention: Patch coverage is 81.84019% with 75 lines in your changes are missing coverage. Please review.

Project coverage is 79.74%. Comparing base (803fcfe) to head (d40e58b).

Files Patch % Lines
aurora/pipelines/transfer_function_kernel.py 80.00% 16 Missing ⚠️
aurora/time_series/spectrogram.py 50.00% 14 Missing ⚠️
aurora/time_series/frequency_band_helpers.py 23.52% 13 Missing ⚠️
aurora/pipelines/transfer_function_helpers.py 74.35% 10 Missing ⚠️
aurora/pipelines/process_mth5.py 92.45% 4 Missing ⚠️
aurora/test_utils/synthetic/station_config.py 57.14% 3 Missing ⚠️
...a/transfer_function/regression/helper_functions.py 88.23% 2 Missing ⚠️
tests/parkfield/test_process_parkfield_run.py 33.33% 2 Missing ⚠️
tests/parkfield/test_process_parkfield_run_rr.py 33.33% 2 Missing ⚠️
tests/pipelines/test_transfer_function_kernel.py 91.66% 2 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   77.69%   79.74%   +2.04%     
==========================================
  Files          89       91       +2     
  Lines        5626     5716      +90     
==========================================
+ Hits         4371     4558     +187     
+ Misses       1255     1158      -97     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

kkappler added 15 commits March 16, 2024 07:22
- rename df to less ambiguous frequency_increment
- add solve_single_time_window to helper functions
- add a test for solve_single_time_window
- factor z-time-series calculation out of coherence into spectral features
- add temporary handling for issue #319
- add simple_solve and direct_solve tf helpers
- add tests for helpersy
- some nomenclature tidying and add a bit more test coverage
  (fc_decimations=None case)
@kkappler kkappler merged commit 4311ceb into main Mar 22, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant