Ch/psmodel#82
Open
cahofer wants to merge 6 commits into
Open
Conversation
distributed point sources
ljgray
approved these changes
Jul 25, 2025
ljgray
left a comment
Contributor
There was a problem hiding this comment.
I have no intuition about the constants defined here, but it looks good overall to me. Just some comments about removing commented code and adding docstrings in a couple of places.
| k1 : scalar | ||
| The amplitude of the luminosity function (number of sources / | ||
| Jy / deg^2 at the pivot). | ||
| The amplitude of the sourc count function (number of sources / |
Contributor
There was a problem hiding this comment.
Suggested change
| The amplitude of the sourc count function (number of sources / | |
| The amplitude of the source count function (number of sources / |
| powerlaw_2 = self.k2 * (flux / self.S_0) ** (-self.gamma2) | ||
|
|
||
| return self.k1 / (s**self.gamma1 + s**self.gamma2) | ||
| # return self.k1 / (s**self.gamma1 + s**self.gamma2) |
Contributor
There was a problem hiding this comment.
Suggested change
| # return self.k1 / (s**self.gamma1 + s**self.gamma2) |
| poisson = True | ||
|
|
||
| def __init__(self): | ||
|
|
Comment on lines
+674
to
+678
| # use np.where and use vector integrator (?) | ||
| # if flux <= self.source_pivot: | ||
| # return self.k1 * (flux / self.S_0) ** (-self.gamma1) | ||
| # else: | ||
| # return self.k2 * (flux / self.S_0) ** (-self.gamma2) |
Contributor
There was a problem hiding this comment.
Can probably remove this if it isn't needed anymore
| # return self.k2 * (flux / self.S_0) ** (-self.gamma2) | ||
|
|
||
| def angular_ps(self, larray): | ||
|
|
|
|
||
| # Calculate the background intensity in units of sr^{-1} Jy^{-1} | ||
| background_intensity = integrate.quad(integrand, 0.0, self.flux_max) | ||
| # background_intensity = integrate.quad_vec(integrand, 0.0, self.flux_max) |
Contributor
There was a problem hiding this comment.
Suggested change
| # background_intensity = integrate.quad_vec(integrand, 0.0, self.flux_max) |
|
|
||
| # Calculate the power due to poisson noise | ||
| poisson_noise = integrate.quad(integrand, 0.0, self.flux_max) | ||
| # poisson_noise = integrate.quad_vec(integrand, 0.0, self.flux_max) |
Contributor
There was a problem hiding this comment.
Suggested change
| # poisson_noise = integrate.quad_vec(integrand, 0.0, self.flux_max) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is actually some of my "old" work with the point source model by DiMatteo and bug fixes. More importantly, the LOFAR_NCP class is Gaussian style foreground with parameters informed by LOFAR data.