Skip to content

Ch/psmodel#82

Open
cahofer wants to merge 6 commits into
mainfrom
ch/psmodel
Open

Ch/psmodel#82
cahofer wants to merge 6 commits into
mainfrom
ch/psmodel

Conversation

@cahofer

@cahofer cahofer commented Jul 25, 2025

Copy link
Copy Markdown

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.

@cahofer cahofer requested review from ljgray and sjforeman July 25, 2025 19:35

@ljgray ljgray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 /

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
# return self.k1 / (s**self.gamma1 + s**self.gamma2)

poisson = True

def __init__(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Docstring

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can probably remove this if it isn't needed anymore

# return self.k2 * (flux / self.S_0) ** (-self.gamma2)

def angular_ps(self, larray):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Docstring


# 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
# poisson_noise = integrate.quad_vec(integrand, 0.0, self.flux_max)

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.

2 participants