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

Add initial_image input type #1237

Merged
merged 4 commits into from
Aug 23, 2023
Merged

Add initial_image input type #1237

merged 4 commits into from
Aug 23, 2023

Conversation

rmjarvis
Copy link
Member

This PR adds the ability for the config processing to read in an initial image from a file and draw additional things onto that. The implementation is pretty simple:

input:
    initial_image:
        file_name: inital_image_file.fits

My test for this is to simulate a supernova time series. It draws a single reference image, and then draws a point source with variable flux 12 times. The SN appears between the 3rd and 4th image. And then it decays exponentially.
Screen Shot 2023-08-15 at 4 11 04 PM

@rmjarvis rmjarvis added this to the v2.5 milestone Aug 15, 2023
@rmjarvis rmjarvis requested a review from cwwalter August 15, 2023 20:50
@rmjarvis rmjarvis added config Related to the config-processing functionality. desc Of possible interest to LSST DESC members looking for a project labels Aug 22, 2023
Copy link
Member

@jmeyers314 jmeyers314 left a comment

Choose a reason for hiding this comment

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

LGTM. Just a have few points around my own curiosity; nothing for you to address in code.



modules:
- numpy
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 needed for the np.exp(-time/50) bit down below? I know import numpy as np is canonical, but I'm a little surprised np.exp works instead of numpy.exp given this line. Just curious how this works.

Copy link
Member Author

Choose a reason for hiding this comment

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

No. I'm not sure why this is here. I think it must be a relic from something that since changed. I removed it.

But to answer your question about np.exp, we automatically import numpy, both as numpy and as np, so those are always available without anything special on the part of the user.

pixel_scale: 0.2
# No noise, which is unrealistic, but makes the test easier.

---
Copy link
Member

Choose a reason for hiding this comment

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

Also just curious: do yaml documents #2 and #3 automatically inherit the contents of document #1?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. This is kind of a different way of doing templates where everything is self-contained in one file. The first document is the base for everything else. Then each other document starts with that as a template and adds modifications. It's described in some detail in demo6.yaml. Then also used by demos 8, 9, 12.

@rmjarvis rmjarvis merged commit 3cdf0fc into main Aug 23, 2023
9 checks passed
@rmjarvis rmjarvis deleted the input_image branch August 23, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Related to the config-processing functionality. desc Of possible interest to LSST DESC members looking for a project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants