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-24738: Add background offset tracking to fgcmcal #77

Merged
merged 4 commits into from Feb 11, 2022
Merged

Conversation

erykoff
Copy link
Contributor

@erykoff erykoff commented Jan 28, 2022

By default, only the per-star and global offsets are computed because of the extra computation time. These values can also be easily computed in a post-processing step.

Copy link
Member

@arunkannawadi arunkannawadi left a comment

Choose a reason for hiding this comment

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

Leaving these as just comments now, since I know some more pushes are coming

# Ignore warnings, we will filter infinites and nans below
np.warnings.simplefilter("ignore")

instMagIn = -2.5*np.log10(df[self.config.apertureInnerInstFluxField].values[use])
Copy link
Member

Choose a reason for hiding this comment

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

Please call it instMagInner and instMagOuter to not confuse the variables with input and output magnitudes

deltaAperOuterRadiusArcsec = pexConfig.Field(
doc="Outer radius used to compute deltaMagAper (arcseconds).",
dtype=float,
default=0.0,
Copy link
Member

Choose a reason for hiding this comment

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

Is this a sensible default? I'd have hoped that both deltaAperInnerRadiusArcsec and deltaAperOuterRadiusArcsec be positive and not equal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fgcmcal itself doesn't know the radii so I don't want to set to an arbitrary number. (Though this is actually gettable through a complicated metadata transaction that I did not want to add, though it could be.). The fgcm code will take 0s to mean that the output should be "unnormalized" units and I added this to the docstring. I think that the key is that these should be set in the various pipeline configs for a given dataset.

Copy link
Member

Choose a reason for hiding this comment

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

In that case, the optional keyword argument should be set to False to indicate that a user must ensure that this is provided (I don't know what default would do for a non-optional config field though)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about that. You don't need to set this if you aren't doing any of the delta-aper computations. And the code will run. But maybe what I need to do is put some code in the validation field that ensures that these are set to positive numbers if any of the do options are set. So I'll do that.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, that is tricky then. Checking for positivity within a validate method sounds good.

dtype=bool,
default=False,
)
doComputeDeltaAperStars = pexConfig.Field(
Copy link
Member

Choose a reason for hiding this comment

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

The stars in the name can be misleading, making one expect there is an equivalent config for galaxies perhaps? May be this should be doComputeDeltaAperMean as the doc says?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, there are no galaxies in fgcmcal, so and "stars" is used all over the place. I think that maybe the confusion is the same as below ... this should be doComputeDeltaAperPerStar I think, to go with doComputeDeltaAperPerVisit, doComputeDeltaAperPerCcd.

dtype=bool,
default=False,
)
doComputeDeltaAperPerCcd = pexConfig.Field(
Copy link
Member

Choose a reason for hiding this comment

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

At the visit level, there was no "per" in config name. I don't have a strong inclination either way, but either both or neither should have "per".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm adding per across the board.

default=True,
)
doComputeDeltaAperMap = pexConfig.Field(
doc="Do the computation of delta-aper maps?",
Copy link
Member

Choose a reason for hiding this comment

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

The doc should says that this config matters only when doComputeDeltaAperStars is True. Similarly for doComputeDeltaAperPerCcd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good point, I'll add that. And on further review I realized that it can compute the per-ccd values even if the per-star values weren't computed. So I've updated the fgcm code, and I'm going to make sure the docstrings are clear here.

dtype=int,
default=2,
)
deltaAperFitPerCcdNx = pexConfig.Field(
Copy link
Member

Choose a reason for hiding this comment

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

Do these kick in only when doComputeDeltaAperPerCcd is True?

@erykoff erykoff merged commit cb8269e into main Feb 11, 2022
@erykoff erykoff deleted the tickets/DM-24738 branch February 11, 2022 19:11
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