spacetelescope / romanisim

Nancy Grace Roman Space Telescope WFI Data Simulator
https://romanisim.readthedocs.io
Other
15 stars 13 forks source link

Metadata keyword values in Roman I-Sim (some are also related to Romancal) #136

Open stscijgbot-rstdms opened 2 months ago

stscijgbot-rstdms commented 2 months ago

Issue RCAL-883 was created on JIRA by Andrea Bellini:

The "fix" list:

-- meta.guidestar.gw_window_xsize (): the value should should be 16 for imaging and 170 for spectroscopy, and should depend on selected optical element -- meta.guidestar.gw_window_ysize (): the value should should be 16 for imaging and 24 for spectroscopy, and should depend on selected optical element -- meta.photometry.conversion_microjanskys: Romancal outputs the correct value. It should come from the photom ref file. -- meta.photometry.conversion_megajanskys: Romancal outputs the correct value. It should come from the photom ref file. -- meta.photometry.pixelarea_steradians: Romancal outputs the correct value. -- meta.photometry.pixelarea_arcsecsq: Romancal outputs the correct value. -- meta.photometry.conversion_megajanskys_uncertainty: Romancal outputs the correct value. -- meta.photometry.conversion_microjanskys_uncertainty: Romancal outputs the correct value. -- meta.ref_file.dark: Romancal outputs the correct value. it should come from CRDS -- meta.ref_file.distortion: Romancal outputs the correct value. it should come from CRDS -- meta.ref_file.flat: Romancal outputs the correct value. it should come from CRDS -- meta.ref_file.gain: Romancal outputs the correct value. it should come from CRDS -- meta.ref_file.linearity: Romancal outputs the correct value. it should come from CRDS -- meta.ref_file.mask: Romancal outputs the correct value. it should come from CRDS -- meta.ref_file.photom: Romancal outputs the correct value. it should come from CRDS -- meta.ref_file.readnoise: Romancal outputs the correct value. it should come from CRDS -- meta.ref_file.saturation: Romancal outputs the correct value. it should come from CRDS -- meta.wcs: Romancal outputs the correct value. -- meta.wcsinfo.s_region: Romancal outputs the correct value.

The "eventually remove" list:

-- meta.exposure.gain_factor () -- meta.exposure.framer_divisor () -- meta.exposure.group_time () -- meta.pointing.pa_v3 () -- meta.target.type () -- meta.target.ra () -- meta.target.dec () -- meta.target.ra_uncertainty () -- meta.target.dec_uncertainty () -- meta.target.proper_motion_ra () -- meta.target.proper_motion_dec () -- meta.target.proper_motion_epoch () -- meta.target.proposer_ra () -- meta.target.proposer_dec ()

The "check consistency" list:

-- amp33 -- border_ref_pix_left: -- border_ref_pix_right: -- border_ref_pix_top: -- border_ref_pix_bottom:

schlafly commented 2 months ago

Hi @AndreaBellini , @tddesjardins ,

Can you specify which of these you consider blockers for the next release?

Some notes:

sanjibs commented 2 months ago

It was not obvious that meta.wcs in romancal and romanisim generated files are the same object.

schlafly commented 2 months ago

I feel like we have tests that show that the WCSes after tweakreg agree at the 1 mas level, which may be the chief requirement in terms of "do the WCSes match?" If you think that's not true, then I'm interested in learning more.

If in fact the WCSes agree in the sense that they are gwcs objects that represent very similar mappings between the detector and the sky, I feel like that is the only kind of agreement that is relevant? I do not want to simulate the tweakreg process and be careful to insert the same number of layers in the gwcs object reflecting the steps that go on there?

tddesjardins commented 2 months ago
schlafly commented 2 months ago

Re the WCS: yes, there is no way that we constructed the gwcs objects in exactly the same way, but that level of equivalence should not be a goal here.

The simulator benefits from the full bandpass information when simulating chromatic sources. We don't usually do that and the present implementation is only partial, but it's not something that CRDS will currently allow us to do. If you want to put the whole bandpasses in CRDS I am happy to source them from there---though even in that case I would probably want a fall back for people not using CRDS mode. While I can think of other approaches there, let's not tie them to science validation.

I will go ahead and populate the reference information et al. into the special romanisim stanza.

Re the guide window size, we "sort of" allow simulating dispersed images via --pretend-spectral GRISM.
https://github.com/spacetelescope/romanisim/blob/03fa06880ffa6918c71574330ff4078a052cc394/scripts/romanisim-make-image#L102-L104 This mode is of course garbage because the only thing it does is update one or two metadata keywords to allow some downstream tests to claim that they process spectral files. Obviously if we were doing anything with the guide windows and wanted to exercise it I would want this case and the imaging case to be well handled. In the current situation where we never touch the guide window stanza and have clearly garbage information in it, I don't really want to propagate special logic setting the size of this right for the different cases. But I guess I will if required.

The reference arrays in the L1 products have the correct shape. The reference arrays in the L2 products have the wrong size because they're never touched and take default values from roman_datamodels. I'm mildly sympathetic to getting the right sizes in general---e.g., for the L1s, if I had the wrong sizes the reference pixel correction step would break. For the L2s where we're not using these products in any way and we have no requirements, while I can change the shape it's not obvious to me what I'm buying.

But the most important thing to me is really which of these are needed to pass science validation and which of these are suggestions for things that we can do when they make more sense---e.g., when the reference pixels start getting simulated, I will of course want them to have the right shape, and if we start figuring out which stars are guide stars, then of course I should put the guide windows around them and give them the right shape.

AndreaBellini commented 2 months ago

Hi Eddie,

But the most important thing to me is really which of these are needed to pass science validation and which of these are suggestions for things that we can do when they make more sense---e.g., when the reference pixels start getting simulated, I will of course want them to have the right shape, and if we start figuring out which stars are guide stars, then of course I should put the guide windows around them and give them the right shape.

The keywords under “eventually remove” are not immediately critical.

Cheers,

Andrea

-- Dr. Andrea Bellini Space Telescope Science Institute 3700 San Martin Drive Baltimore, MD, 21218, USA Office: +1 (410) 338-4431