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

Merge EPTA version part 2 #374

Merged
merged 7 commits into from
Apr 9, 2024
Merged

Merge EPTA version part 2 #374

merged 7 commits into from
Apr 9, 2024

Conversation

siyuan-chen
Copy link
Contributor

@siyuan-chen siyuan-chen commented Dec 23, 2023

This pull request is part 2/2 to merge the EPTA enterprise into the NANOGrav version.

It adds more createfourierdesignmatrix functions, for EPTA work and also a general function for chromatic signals. And also associated changes in other functions to pass more arguments.

Copy link
Member

@vhaasteren vhaasteren left a comment

Choose a reason for hiding this comment

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

It needs to be linted and some docstrings need to be added. But overall this looks fine. Thanks!

:param logf: use log frequency spacing
:param fmin: lower sampling frequency
:param fmax: upper sampling frequency
:param modes: option to provide explicit list or array of
Copy link
Member

Choose a reason for hiding this comment

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

The parameter idx needs a docstring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added docstring for the parameter idx


# compute the DM-variation vectors
Dm = (fref / freqs) ** idx * np.sqrt(12) * np.pi / 1400 / 1400 / 2.41e-4

Copy link
Member

Choose a reason for hiding this comment

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

The matrix Dm is normalized differently from the one for createfourierdesignmatrix_red. This is not described in the docstring, and those factors are not explained anywhere.

Please make this consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is the normalization difference between the enterprise and temponest default amplitude normalization for DM power law. There is the 12pi^2 from the definition of A, the scaling to 1MHz vs 1400 MHz and the DM constant. I added a bit of comments to this in the code.

Copy link
Member

@vhaasteren vhaasteren Feb 7, 2024

Choose a reason for hiding this comment

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

Understood, if it's a definition matter we should leave it.

Looking up the origin, this is a really pointless normalization though. This 12pi^2 comes from the definition of the characteristic strain h_c in the red noise spectral density. It has absolutely nothing to do with DM, and it was introduced by mindlessly copying code from the definition of red noise to DM. It makes me cringe. (Not a critique of this PR)


@function
def createfourierdesignmatrix_general(
toas,
Copy link
Member

Choose a reason for hiding this comment

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

Question: is this not just a superset of the regular createfourierdesignmatrix? In other words, could it replace it?

Choose a reason for hiding this comment

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

Yes, it is a superset of "createfourierdesignmatrix_red", "..._dm", "..._dm_tn" and "..._chromatic". Where the "chromatic" is a superset of "dm" by the way.

The "general" also allows to mask toas from chosen flags. It is pretty convenient as it is the only current way to make a selection on spatially correlated common signals (as far as I know).

Copy link
Member

Choose a reason for hiding this comment

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

Actually, selecting on common signals is in another PR as well. Have a look:

#290

Choose a reason for hiding this comment

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

Missed that, very nice ! It still need to be merged if I've understood well.

Copy link
Member

Choose a reason for hiding this comment

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

Correct. I wanted to review it the other day, but I wasn't sure whether it was relevant since it had been 2 years. I should ping @vallis again regarding it.

@vhaasteren
Copy link
Member

Review completed @siyuan-chen, I'm fine with it all. If all the linting is done we can merge to dev.

@vhaasteren vhaasteren merged commit b1b25bb into nanograv:dev Apr 9, 2024
11 checks passed
@siyuan-chen siyuan-chen deleted the gp_bases branch June 12, 2024 09:45
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.

3 participants