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

Fix problems related to missing pol argument when using calc_R_from_A, also did some minor cleanup of example notebook #116

Merged
merged 18 commits into from Mar 17, 2023

Conversation

cchwala
Copy link
Contributor

@cchwala cchwala commented Mar 15, 2023

Things that were done in this PR:

  • it is now forced to pass pol to calc_R_from_A when passing f_GHz, which is the way we commonly use this function. One can also pass a and b parameters instead of f_GHz and pol. There are now also tests that check this behavior.
  • The WAA function waa_leijnse_2008_from_A_obs and waa_pastorek_2021_from_A_obs which use calc_R_from_A internally, have been adjusted to require a pol argument.
  • Docstrings of the functions have been adjusted and also improved in some parts
  • tests have been adjusted accordingly and new tests added
  • black formating in files that were touched in this PR
  • updated notebook on basic example workflow
    • use pol correctly (which is no enforce anyway, see above)
    • removed some unnecessary cells
    • improves some markdown text
    • changed the way resampling to 5-min and 1-h is done, which we do now after concatenating the list of CML Datasets to one large Dataset because resampling is much faster like this
    • made plotting of interpolated maps a bit nicer (in my opinion)
    • made plotting of time series more consistent (same figure width, removing unnecessary labels, better colors in some places)
    • use cml['A'].values[cml.A < 0] = 0 instead of cml['A'] = cml.A.where(cml.A > 0, 0), see Do not use cml.A.where(cml.A > 0, 0) to set values smaller zero to zero #117
    • added interpolation of short gaps in trsl, up to 5 minutes, which improves comparison with reference for high rain rates (I think we had this interpolation in the example notebook some time ago, but maybe it was removed to replace it with the more sophisticated blackout gap filling, which is not there yet..)

@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.08 🎉

Comparison is base (bcc59ff) 71.62% compared to head (e8bb815) 71.71%.

❗ Current head e8bb815 differs from pull request most recent head 103a9bf. Consider uploading reports for the commit 103a9bf to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #116      +/-   ##
==========================================
+ Coverage   71.62%   71.71%   +0.08%     
==========================================
  Files          28       28              
  Lines        1008     1011       +3     
==========================================
+ Hits          722      725       +3     
  Misses        286      286              
Flag Coverage Δ
unittests 71.71% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pycomlink/processing/k_R_relation.py 78.84% <100.00%> (+1.29%) ⬆️
pycomlink/processing/wet_antenna.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@cchwala cchwala requested a review from nblettner March 16, 2023 07:59
Copy link
Contributor

@nblettner nblettner left a comment

Choose a reason for hiding this comment

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

Looks fine to me. I only marked some typos and a small possible extension in the docstrings.

pycomlink/processing/k_R_relation.py Outdated Show resolved Hide resolved
pycomlink/processing/k_R_relation.py Outdated Show resolved Hide resolved
pycomlink/processing/k_R_relation.py Outdated Show resolved Hide resolved
pycomlink/processing/k_R_relation.py Outdated Show resolved Hide resolved
pycomlink/processing/k_R_relation.py Outdated Show resolved Hide resolved
cchwala and others added 3 commits March 16, 2023 16:15
Co-authored-by: Nico Blettner <72550190+nblettner@users.noreply.github.com>
@cchwala
Copy link
Contributor Author

cchwala commented Mar 16, 2023

@nblettner thanks for the feedback. I adjusted the code accordingly.

Sorry, that I forgot to push my last update of the notebook. It is now here in 21ed485. I just removed cells were all code was commented out. I also change the relevant parts of the code to use the solution with cml.A.values[cml.A.values < 0] = 0, see #117 (we can change to a different solution once we agree which one is the best...)

@cchwala cchwala changed the title Fix missing pol argument in example processing and do some other minor improvements Fix problems related to missing pol argument when using calc_R_from_A, also did some minor cleanup of example notebook Mar 17, 2023
@cchwala cchwala merged commit ff2d879 into pycomlink:master Mar 17, 2023
@cchwala cchwala deleted the fix_some_example_processing_errors branch March 17, 2023 20:57
cchwala added a commit to cchwala/pycomlink that referenced this pull request Oct 23, 2023
This is required since pycomlink#116

I actually thought I had fixed that during some of the last PRs, but
apparently the problem was still there in this notebook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants