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

Modified lumfunc to include cumulative distributions #75

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nhuntwalker
Copy link
Contributor

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

@@ -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):
Copy link
Member

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

@jakevdp
Copy link
Member

jakevdp commented Aug 5, 2015

Looks good! Last thing we need is unit tests for the new functionality.

@nhuntwalker
Copy link
Contributor Author

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]))
Copy link
Member

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?

Base automatically changed from master to main February 24, 2021 16:27
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.

None yet

2 participants