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

having trouble simulating an image for a NIRcam observation... #823

Open
kdhuga opened this issue Jan 6, 2023 · 13 comments
Open

having trouble simulating an image for a NIRcam observation... #823

kdhuga opened this issue Jan 6, 2023 · 13 comments

Comments

@kdhuga
Copy link

kdhuga commented Jan 6, 2023

c/o Mirage Team:

I've been trying to simulate a simple image for a NIRcam observation but without success. I've attached the script I'm running along with a couple of log files that list the errors that I run into. The log files refer to 2 cases:
a) a run with a single yaml testfile, and
b) a run with glob read of all yaml files

The main script has been constructed following the directions per miarge/web guidelines; the basic input is taken from the xml and pointing files initially exported from the APT file.

Both runs generate errors in the catalog_seed-image stage of the code.

For option (a) I get the following:
File "/opt/anaconda3/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity

For option (b) I get the following:
File "/opt/anaconda3/lib/python3.9/site-packages/mirage/seed_image/catalog_seed_image.py", line 163, in make_seed
used_cats = determine_used_cats(self.params['Inst']['mode'], self.params['simSignals'])
KeyError: 'Inst'

Any help to straighten this out would be very much appreciated.
best,
kalvir dhuga
GW astro group
[email protected]

Attached files follow:
NIRcam-sims.pdf
[mirage_latest_single_test_f
mirage_latest_glob-read-all_yamlfiles.log
ile.log](https://github.com/spacetelescope/mirage/files/10358795/mirage_latest_single_test_file.log)

@bhilbert4
Copy link
Collaborator

Hmm. It's not obvious to me from the logs why the Inst keyword is missing. Can you send one of your yaml files? If there are details in the yaml that you'd rather not post here, you can also create a new ticket at the JWST Help desk (jwsthelp.stsci.edu). If you select the "JWST General" or "NIRCam" categories, I'll get the ticket.

@kdhuga
Copy link
Author

kdhuga commented Jan 6, 2023 via email

@bhilbert4
Copy link
Collaborator

HI Kalvir,
It looks like your attached files didn't make it from your email into the github comment. You might want to try coming to the github issue itself and attaching the files that way.

@kdhuga
Copy link
Author

kdhuga commented Jan 7, 2023

Dear Bryan:

Okay, file attached;
yaml-files.zip

kalvir

@bhilbert4
Copy link
Collaborator

Ah I think I see the problem. You don't have any source catalogs specified in the yaml files. Sorry, the code should explicitly look for that, but it doesn't. Anyway, you can specify source catalog names when running the yaml generator: https://mirage-data-simulator.readthedocs.io/en/latest/yaml_generator.html#source-catalogs

@bhilbert4
Copy link
Collaborator

Or, of course, you can manually add your catalogs to the yaml files.

@kdhuga
Copy link
Author

kdhuga commented Jan 7, 2023 via email

@bhilbert4
Copy link
Collaborator

The error indicates that "Inst" is not in the yaml file at all. Are you using glob to produce a list of yaml files to run? The log makes it look like it's treating observation_list.yaml as one of your exposure yaml files. Could that be it? If you ignore that file does it work?

@kdhuga
Copy link
Author

kdhuga commented Jan 23, 2023 via email

@bhilbert4
Copy link
Collaborator

I haven't updated Mirage to use a cosmic ray rate that matches what's been observed in flight, but I think the rate at the moment is ~reasonable. These should all be removed during the line-fitting step of the JWST calibration pipeline. What readpattern and number of groups are you using for your simulations? In general the NIRCam team recommends keeping individual integrations under about 1000 seconds in order to prevent too many pixels from being affected by cosmic rays.

For the second issue, if you take one yaml file for each target, can you confirm that the catalog entries are correct, and also that the telescope pointing (ra, dec entries) are roughly correct? I'm assuming that your targets are not close enough to each other that the same background sources would be visible in both?

@kdhuga
Copy link
Author

kdhuga commented Jan 23, 2023 via email

@bhilbert4
Copy link
Collaborator

That all looks reasonable. But you're saying the scenes for these two exposures look identical in terms of the astronomical source on the detector? Is the scene correct for one of the targets?

@kdhuga
Copy link
Author

kdhuga commented Jan 23, 2023 via email

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

No branches or pull requests

2 participants