-
Notifications
You must be signed in to change notification settings - Fork 235
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
notes/warnings fixes in data.atmosphere package #3218
notes/warnings fixes in data.atmosphere package #3218
Conversation
702c370
to
3801a32
Compare
3801a32
to
7997829
Compare
639ba4e
to
f51d9df
Compare
modules/data.atmosphere/R/met_temporal_downscale.Gaussian_ensemble.R
Outdated
Show resolved
Hide resolved
Co-authored-by: Chris Black <[email protected]>
It is still in the dependency chain, of course, but we use it only for `%>%` which is re-exported by dplyr, so we do not need to be listing megrittr as a direct import
# TODO: Why do we divide by n? | ||
# isn't precipitation_flux already an intensity? | ||
precipitation_flux = rep(df$precipitation_flux / n, each = n), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CF units on precipitation_flux
are documented as kg m^-2 s^-1, so I would have expected it to be an average rate across the day and therefore to not need dividing by n
. Is the division incorrect or am I missing something else? Is there a chance this input quantity was supposed to be named precipitation_amount
(with units kg m^-2 = mm)?
# TODO: Computation of solarR above already multiplies by resC2. | ||
# Is multiplying it again here really correct? | ||
# That's how the old data.table version did it | ||
# (once when computing `solarR` and again when computing `SolarR`), | ||
# so keeping it until proven wrong. | ||
downwelling_photosynthetic_photon_flux = .data$solarR * light$resC2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know radiation calculations well enough to know if this is correct or not, just seemed odd to me especially since they're done in two separate steps. Can a met expert weigh in here, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(see line 142 for the first multiplication by resC2
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(And see deleted lines 136 and 138 for the same calculations as implemented before this PR)
No description provided.