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

Update attenuation modules #320

Merged
merged 9 commits into from
Oct 1, 2024
Merged

Update attenuation modules #320

merged 9 commits into from
Oct 1, 2024

Conversation

kuanfufeng
Copy link
Collaborator

@kuanfufeng kuanfufeng commented Sep 27, 2024

This PR is for updating attenuation modules with the multi-window option.

  • The original get_SSR is renamed as get_codawindow_SSR.
  • The new module, get_codawindow_SSR, can handle both single and multiple windows cases.
  • Another new module, window_determine, slices the input coda window into ten small windows and returns the first 30% and the 30% after a half point to the call.
  • By now, the multi-window number is fixed at 6, according to the article setting (Hirose et al., 2019, 2022).

There is one more modification, regardless of the monitoring module. For correction, the parameter smooth_N is replaced by smoothspect_N in noise_module.

"""
Esyn_temp = np.zeros((npts // 2))
Eobs_temp = np.zeros((npts // 2))
PLOT_CHECK = False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering moving this as the function arguments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I will add the PLOT_CHECK as a function argument. Esyn_temp and Eobs_temp will keep recalculating via get_energy_density based on the parameters. Maybe we can leave them as they are.

Copy link
Collaborator

@niyiyu niyiyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. There are just two very minor comments.

src/noisepy/monitoring/attenuation_utils.py Show resolved Hide resolved
@@ -50,6 +50,7 @@ class ConfigParameters_monitoring(BaseModel):
ratio: float = Field(default=3.0, description="ratio for determining noise level by Mean absolute deviation (MAD)")

# --- paramters for measuring attenuation
single_station: bool = Field(default=True, description="make measurement one one lag or two")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
single_station: bool = Field(default=True, description="make measurement one one lag or two")
single_station: bool = Field(default=True, description="make measurement on one lag or two")

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for noticing this typo. I would need to update the description of this.

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.52%. Comparing base (9fd81c3) to head (4b8a8ed).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/noisepy/seis/noise_module.py 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #320   +/-   ##
=======================================
  Coverage   83.52%   83.52%           
=======================================
  Files           9        9           
  Lines        1973     1973           
  Branches      330      332    +2     
=======================================
  Hits         1648     1648           
  Misses        207      207           
  Partials      118      118           

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

@niyiyu niyiyu merged commit 337c737 into main Oct 1, 2024
22 of 23 checks passed
@niyiyu niyiyu deleted the kuanfu_monito5 branch October 1, 2024 19:41
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.

2 participants