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-49175: Adjust configs/warnings for LSSTCam dense PTC #301

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

Alex-Broughton
Copy link
Contributor

No description provided.

@Alex-Broughton Alex-Broughton force-pushed the tickets/DM-49175 branch 7 times, most recently from a94acef to 486a7e8 Compare March 20, 2025 16:20
@@ -1211,6 +1211,7 @@ def errFunc(p, x, y):
& (np.abs(np.nan_to_num(sigResids)) < sigmaCutPtcOutliers)
& mask
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this newline (there are no changes to this file on this PR)

Copy link
Contributor

Choose a reason for hiding this comment

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

Noting this

# There are no exposures left, so set trap so that
# there is no correction
self.log.warning("All exposures brighter than config.maxImageMean are excluded. "
"Setting zero-sized serial trap for amp {ampName}.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix the warning to "amp %s", ampName)

raise RuntimeError("All exposures brighter than config.maxSignalForCti and excluded.")
# There are no exposures left, set globalCTI to 0
self.log.warning("All exposures brighter than config.maxSignalForCti are excluded. "
f"Setting {ampName} global CTI to zero.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix warning to "Setting %s global CTI to zero.", ampName)

# All exposures excluded, set the calibration so that
# there is no correction
self.log.warning("All exposures brighter than config.maxImageMean are excluded. "
"Setting local offset drift scale to zero for amp {ampName}.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix warning to "...for amp %s.", ampName

Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be fixed.


payload:
payloadName: "${INSTRUMENT}_${TICKET}_ptc"
output: "${USER_CALIB_PREFIX}${INSTRUMENT}/calib/${TICKET}/${TAG}/ptcGen.${RERUN}"
butlerConfig: "${REPO}"
inCollection: "${USER_CALIB_PREFIX}${INSTRUMENT}/calib/${TICKET},${RAW_COLLECTION},${CALIB_COLLECTIONS}"
inCollection: ${USER_CALIB_PREFIX}${INSTRUMENT}/calib/${TICKET}/${TAG},${RAW_COLLECTION},${CALIB_COLLECTIONS}"
Copy link
Contributor

Choose a reason for hiding this comment

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

You lost a quote here, it will crash. Also this should not have the tag.


payload:
payloadName: "${INSTRUMENT}_${TICKET}_ptc"
output: "${USER_CALIB_PREFIX}${INSTRUMENT}/calib/${TICKET}/${TAG}/ptcGen.${RERUN}"
butlerConfig: "${REPO}"
inCollection: "${USER_CALIB_PREFIX}${INSTRUMENT}/calib/${TICKET},${RAW_COLLECTION},${CALIB_COLLECTIONS}"
inCollection: ${USER_CALIB_PREFIX}${INSTRUMENT}/calib/${TICKET},${RAW_COLLECTION},${CALIB_COLLECTIONS}"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is still wrong, it lost a quote.

@@ -312,9 +312,20 @@ def solveLocalOffsets(self, inputMeasurements, calib, detector):
data.append(exposureDict[ampName]['SERIAL_OVERSCAN_VALUES'][start:stop+1])
else:
Nskipped += 1
self.log.info(f"Skipped {Nskipped} exposures brighter than {self.config.maxImageMean}.")
self.log.info("Skipped %d exposures brighter than %f.",
Nskipped, self.config.maxImageMean)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're in here can you fix Nskipped (against the dev guide) to nSkipped?

# All exposures excluded, set the calibration so that
# there is no correction
self.log.warning("All exposures brighter than config.maxImageMean are excluded. "
"Setting local offset drift scale to zero for amp {ampName}.")
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be fixed.

@@ -697,9 +713,17 @@ def findTraps(self, inputMeasurements, calib, detector):
new_signal.append(exposureDict[ampName]['LAST_COLUMN_MEAN'])
else:
Nskipped += 1
self.log.info(f"Skipped {Nskipped} exposures brighter than {self.config.maxImageMean}.")
self.log.info("Skipped %d exposures brighter than %f.",
Nskipped, self.config.maxImageMean)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here for Nskipped

@@ -821,7 +845,8 @@ def calcEper(self, mode, inputMeasurements, amp):
# Number of parallel shifts = nRows
nShifts = amp.getRawDataBBox().getHeight()
else:
raise RuntimeError(f"{mode} is not a known orientation for the EPER calculation.")
raise RuntimeError("%s is not a known orientation for the EPER "
"calculation.", mode)
Copy link
Contributor

Choose a reason for hiding this comment

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

Here f-strings are okay, and also this doesn't work with raising, just logs; please revert.

@@ -1211,6 +1211,7 @@ def errFunc(p, x, y):
& (np.abs(np.nan_to_num(sigResids)) < sigmaCutPtcOutliers)
& mask
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Noting this

project: "${TICKET}"
campaign: "${TICKET}"
submitPath: $SCRATCH/submit/{outputRun}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please protect these (and below) with quotes.

@Alex-Broughton Alex-Broughton force-pushed the tickets/DM-49175 branch 2 times, most recently from 7e662f8 to fcfcdb5 Compare March 20, 2025 18:57
@@ -304,17 +304,29 @@ def solveLocalOffsets(self, inputMeasurements, calib, detector):
# leaks into the overscan region.
signal = []
data = []
Nskipped = 0
NSkipped = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

nSkipped. Must start lower case.

@Alex-Broughton Alex-Broughton force-pushed the tickets/DM-49175 branch 2 times, most recently from 99a1e83 to 9c063e8 Compare March 20, 2025 19:09
@erykoff
Copy link
Contributor

erykoff commented Mar 20, 2025

Please update the name of the PR to be more descriptive (e.g., add clustering to bps templates and LSSTCam config overrides)

@Alex-Broughton Alex-Broughton changed the title DM-49175: Create LSSTCam calibrations DM-49175: Adjust configs/warnings for LSSTCam dense PTC Mar 20, 2025
@Alex-Broughton Alex-Broughton force-pushed the tickets/DM-49175 branch 3 times, most recently from d883f67 to 94dd0dc Compare March 26, 2025 07:05
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