-
Notifications
You must be signed in to change notification settings - Fork 309
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
Modified lumfunc to include cumulative distributions #75
base: main
Are you sure you want to change the base?
Conversation
astroML/lumfunc.py
Outdated
@@ -98,7 +98,7 @@ def Cminus(x, y, xmax, ymax): | |||
return Nx, Ny, cuml_x, cuml_y | |||
|
|||
|
|||
def binned_Cminus(x, y, xmax, ymax, xbins, ybins, normalize=False): | |||
def binned_Cminus(x, y, xmax, ymax, xbins, ybins, normalize=False, get_cumulative=False): |
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.
Let's change get_cumulative
to return_cumulative
Looks good! Last thing we need is unit tests for the new functionality. |
I didn't test the binned and bootstrapped functions separately since one builds on the other. I also didn't test the bootstrapped function with and without the "return_cumulative" param set to True, as whether it's true or false the output uses the same lines of code right up until the very last bit |
# Find the interpolated midpoints for those same | ||
# stated bin boundaries | ||
Icumx_mid = _sorted_interpolate(x_sort, cuml_x, 0.5*(xbins[1:] + xbins[:-1])) | ||
Icumy_mid = _sorted_interpolate(y_sort, cuml_y, 0.5*(xbins[1:] + ybins[:-1])) |
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.
should be ybins[1:] + ybins[:-1]
, yes?
The cumulative distribution can be accessed by setting the parameter get_cumulative to True. It defaults to False so that it doesn't break any existing code that generates functions from the old lumfunc.py