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

Use the minimum of image.nobjects and the number of objects available to be rendered. #463

Merged
merged 4 commits into from
Apr 17, 2024

Conversation

jchiang87
Copy link
Collaborator

Mike's suggested fix seems to work. However, I don't know how to write an isolated unit test for this. The only way I can see to test it would be to run a full simulation and checking the outputs. Even running with just a couple of objects takes a long time. Suggestions welcome.

@rmjarvis
Copy link
Contributor

rmjarvis commented Apr 17, 2024

I think you can use the truth catalog output to test.
Case 1:
instcat with say 10 objects, and output.nobjects=3 -> check that there are 3 items in the output truth catalog.
Case 2:
instcat with 3 objects and output.nobjects=10 -> check that there are again 3 items in the truth catalog.
Case 3:
instcat with 3 objects and no output.nobjects specified -> same output as case 2.
And if the first 3 objects in case 1 are the same as the 3 in cases 2,3, all three output files should be identical. Both the truth catalog and image.

@jchiang87
Copy link
Collaborator Author

Sure, but I think that still involves running full simulations. I was hoping there would be something that could be done to test the setting of LSST_ImageBuilder.nobjects directly for the different yaml inputs.

@rmjarvis
Copy link
Contributor

There are ways to do that with mock, but I always prefer just running a full integration test if possible. You can make the fluxes quite small, so the run time could be very quick.

@jchiang87 jchiang87 requested a review from rmjarvis April 17, 2024 21:36
@jchiang87 jchiang87 merged commit 59b20ab into main Apr 17, 2024
3 checks passed
@jchiang87 jchiang87 deleted the u/jchiang/image_nobjects branch April 17, 2024 21:47
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