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-30130: Establish a 1-1 correspondence between exposures and input dimensions in cpPtcExtract #89

Merged
merged 4 commits into from May 19, 2021

Conversation

plazas
Copy link
Contributor

@plazas plazas commented May 12, 2021

No description provided.

@plazas plazas requested a review from czwa May 13, 2021 10:28
Copy link
Contributor

@czwa czwa left a comment

Choose a reason for hiding this comment

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

Let me know if this suggested change makes sense.

# and inputs['inputDims']. This will be used in `run` when saving partial datasets.
expIdToInputDim = {}
for exp, dim in zip(inputs['inputExp'], inputs['inputDims']):
expId = exp.getInfo().getVisitInfo().getExposureId()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want to get away from using getInfo().getVisitInfo().getExposureId(). Is it possible to just pass the inputDims to the arrange functions, and have them be sorted as well? This would future-proof this part of the code in case the info/VisitInfo objects change. This would also remove the need to pass a third mapping object to the run method.

Copy link
Member

Choose a reason for hiding this comment

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

The DataId will have the detector number and exposure ID in it already. This is not the same thing as getExposureId because getExposureId is the detector exposure ID not the exposure ID. We are actively discussing changing getExposureId so it would be best not to use it here. I think for grouping you are better off creating a tuple of exposure+detector -- then you are being explicit in how you are doing your grouping using gen3 concepts and not relying on the visitInfo at all.

Copy link
Member

Choose a reason for hiding this comment

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

If I'm not clear, I mean that you use the tuple of the exposure and detector dataId values as the key in your grouping algorithm.

# Below, np.where(expId1 == np.array(inputDims)) (and the other analogous
# comparisons) returns a tuple with a single-element array, so [0][0]
# Below, np.where(expId1 == np.array(inputDims)) returns a tuple
# with a single-element array, so [0][0]
Copy link
Contributor

Choose a reason for hiding this comment

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

This logic would also be replaced by simply pulling the exposure values at the same time as the exposures in the loop above.

Copy link
Contributor

@czwa czwa left a comment

Choose a reason for hiding this comment

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

This looks like what I was thinking. This will hopefully avoid id confusion.

outputs = self.run(**inputs)
butlerQC.put(outputs, outputRefs)

def run(self, inputExp, inputDims):
def run(self, inputDims, inputExp):
Copy link
Contributor

Choose a reason for hiding this comment

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

This switch seems unnecessary now.

@plazas plazas merged commit 07df93d into master May 19, 2021
@plazas plazas deleted the tickets/DM-30130 branch May 19, 2021 21:36
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

3 participants