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

DM-43959: Add npatch field to BinnedCorr2Config #240

Merged
merged 6 commits into from Apr 19, 2024
Merged

Conversation

arunkannawadi
Copy link
Member

No description provided.

@rmjarvis
Copy link

I'll just mention that the term BinnedCorr2 isn't a thing in TreeCorr anymore (as of v5.0). Probably should just use Corr2Config to avoid confusion going forward.

@rmjarvis
Copy link

@arunkannawadi
Copy link
Member Author

We're still on v4.3.3 as of this week (this might change next week if rubin-env gets an update). But now that I'm passing this around for almost all calls to treecorr methods, I could make this a TreecorrConfig or something like that.

@arunkannawadi arunkannawadi force-pushed the tickets/DM-43959 branch 3 times, most recently from 3d20760 to c34bc14 Compare April 19, 2024 16:48
@arunkannawadi arunkannawadi marked this pull request as ready for review April 19, 2024 16:48
ra_units=raUnits,
dec_units=decUnits,
logger=_LOG,
patch_centers=catA.patch_centers,
Copy link
Member Author

Choose a reason for hiding this comment

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

I tried swapping npatch from the config with patch_centers after they are first computed. But the config only supports filenames and not arrays directly. I suppose we don't care if we get different patches for different cross-correlations but that we have the same patches for both the catalogs that we are doing cross-correlations, correct?

Choose a reason for hiding this comment

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

Yes. If there is a catB, it needs to have the same patches as catA. But it's ok if other correlations use different patches in this context. It would matter if you ever wanted covariances of derived quantities that come from multiple 2pt correlation functions, but I don't think you are planning to do that.


# Swap rng_seed with an rng instance in treecorr config.
rng = np.random.RandomState(treecorr_config_dict.pop("rng_seed"))
treecorr_config_dict["rng"] = rng
Copy link
Member Author

Choose a reason for hiding this comment

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

The rng_seed remains the same for all the runs for now, but a new rng is generated for each tract, patch, band combo. I suppose the actual patches themselves depends on the data (since it uses kmeans) and it's not the case where we get the same patch every single run, right?

Choose a reason for hiding this comment

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

Yes. That should be ok.

Copy link

@rmjarvis rmjarvis left a comment

Choose a reason for hiding this comment

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

Code looks fine to me. Should there be some new tests though? Or is this just a functionality preserving change for now?


# Swap rng_seed with an rng instance in treecorr config.
rng = np.random.RandomState(treecorr_config_dict.pop("rng_seed"))
treecorr_config_dict["rng"] = rng

Choose a reason for hiding this comment

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

Yes. That should be ok.

Keyword arguments to be passed to `treecorr.KKCorrelation`.
treecorr_config_dict: `dict`, optional
Config dictionary to be passed to `treecorr`
()`treecorr.KKCorrelation` or `treecorr.Catalog`).

Choose a reason for hiding this comment

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

I believe the first closing paren here a typo.

ra_units=raUnits,
dec_units=decUnits,
logger=_LOG,
patch_centers=catA.patch_centers,

Choose a reason for hiding this comment

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

Yes. If there is a catB, it needs to have the same patches as catA. But it's ok if other correlations use different patches in this context. It would matter if you ever wanted covariances of derived quantities that come from multiple 2pt correlation functions, but I don't think you are planning to do that.

@arunkannawadi
Copy link
Member Author

We have tests for PSF residual calculations, but nothing for RhoStatistics now. In general, this has a lot less test coverage than many of the other DM repos, since it's mostly plot oriented. The plot I produced with the changes here (and activating them) is on the Jira ticket.

@arunkannawadi arunkannawadi merged commit 293b899 into main Apr 19, 2024
8 checks passed
@arunkannawadi arunkannawadi deleted the tickets/DM-43959 branch April 19, 2024 21:03
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