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-43297: Add visitInfo to exposures #96

Merged
merged 1 commit into from Mar 13, 2024
Merged

Conversation

mfisherlevine
Copy link
Contributor

No description provided.

viDict = {}
viDict["exposureTime"] = header.get("EXPTIME")

# set the midpoint of BEG and END as the DATE

Choose a reason for hiding this comment

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

Why? Is this "our" convention??

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 might well not be in DM, but this is what we want for StarTracker images when building the pointing model.

begin = datetime.datetime.fromisoformat(header.get("DATE-BEG"))
end = datetime.datetime.fromisoformat(header.get("DATE-END"))
duration = end - begin
mid = begin + duration / 2

Choose a reason for hiding this comment

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

Could just do mid = begin + (end - begin) / 2 if you care about file length.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yeah, I was going to cross-check duration against expTime but it seems like it's a non-issue, so I'll fix that up.


data = np.asarray(data, dtype=np.float32)
img = afwImage.ImageF(data)
maskedIm = afwImage.MaskedImageF(img)

Choose a reason for hiding this comment

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

Could just do maskedIm = afwImage.MaskedImageF(afwImage.ImageF(data)) if you care about file length.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's getting a little much and harder to read 🙂

@mfisherlevine mfisherlevine merged commit dddaf95 into main Mar 13, 2024
4 checks passed
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