Skip to content

STIPS 2.3.1 bug fixes with the documentation updates - #204

Merged
ojustino merged 20 commits into
mainfrom
release-2.3.1
May 8, 2026
Merged

ojustino merged 20 commits into
mainfrom
release-2.3.1

Conversation

@eunkyuh

@eunkyuh eunkyuh commented Dec 17, 2025 •

Copy link
Copy Markdown
Collaborator

Several bug fixes include:

Documentation updates include

  • Remaining mention of WebbPSF to replace with STPSF
  • Removal of 'oversample' key in the example that no longer works in the newer versions of STIPS
  • Removal of JBT mentions since STIPS no longer uses the tool
  • psf_grid_size fixed to 3x3
  • Updated help desk contact instructions (resolves Update the help (for real this time) #202)
  • Alternate package managers to consider in installation instructions (resolves Update to installation instructions #185)

Installation yml updates include pandeia.engine requirements to be 2025.9 or higher and allowing newer versions of poppy than 1.0.3. The utilities infrastructure has also been updated so it can work with newer versions of Pandeia.

Implemented dynamic calculation of zeropoints based on WFI throughput files from the user's local Pandeia reference data. This should help mitigate output flux mismatches between STIPS and Pandeia if a user has installed an unexpected version of the latter. The calculated values from the current Pandeia reference data match those found in the Roman Technical Repo.

@eunkyuh
eunkyuh requested a review from ojustino December 17, 2025 21:51
Comment thread stips/astro_image/astro_image.py Outdated
Comment on lines +606 to +608
ins.detector = self.detector.replace('WFI', 'SCA')
ins.detector = self.detector.replace('SCA', 'WFI')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be left as it was – before v2.1.0, STPSF used SCANN to refer to detectors instead of WFINN. The ins object here comes from STPSF. STIPS supports STPSF v2.0.0, so when that version is installed, we have to revert to calling detectors with "SCA" as this line did before this PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The real bug happens with ins.psf_grid(). STPSF appends its internal detector name to the files generated with that function, so v2.0.0 will append "SCANN.fits". STIPS' AstroImage.make_epsf_array() looks for file names ending in "WFINN.fits". When it doesn't find them, it regenerates the PSF grid, even when psf_cache_enable is on. That causes the extra computation time experienced in #201.

I've added a commit to make the file name check in AstroImage.make_epsf_array() more backward compatible as well since we can't change the behavior of ins.psf_grid().

Comment on lines -493 to +496
ot['x'] = Column(data=xfs+self.out_origin, unit='pixel')
ot['y'] = Column(data=yfs+self.out_origin, unit='pixel')
ot['x_epsf'] = Column(data=xfs+self.out_origin, unit='pixel')
ot['y_epsf'] = Column(data=yfs+self.out_origin, unit='pixel')
ot['x_input'] = Column(data=self.out_origin, unit='pixel')
ot['y_input'] = Column(data=self.out_origin, unit='pixel')

@ojustino ojustino Apr 22, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One of these should remain as 'x' and 'y' instead of being moved to a different name in order to maintain backward compatibility in the headers. I will change 'x_epsf' and 'y_epsf' back and also edit the updated text in bugs.rst.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Looks good to me!

@ojustino
ojustino force-pushed the release-2.3.1 branch 5 times, most recently from 24fad5f to 88688a8 Compare April 23, 2026 15:52
@ojustino

ojustino commented Apr 23, 2026 •

Copy link
Copy Markdown
Collaborator

We would still like this release to start dynamically updating WFI.ZEROPOINTS_AB (based on synphot reference files Pandeia throughput files) instead of hard-coding it. Since STIPS no longer pins Pandeia to a specific version, the possibility exists that a new Pandeia release might incorporate zero points calculated from different synphot reference files Pandeia throughput files than were used with the latest version of STIPS.

Comment thread stips/instruments/instrument.py Outdated
Comment on lines +1143 to +1145
self.photfnu = self.PHOTFNU[self.filter]
self.photplam = self.PHOTPLAM[self.filter]
self.custom_background *= self.convertToCounts('p')

@ojustino ojustino Apr 27, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This function is triggered when Instrument.reset() attempts to set self.background = self.pixel_background. (Users would encounter it when ObservationModule.nextObservation() callsInstrument.reset().)

In Instrument.reset(), self.photfnu and self.photplam are defined just after self.background, but this highlighted snippet needs them to exist beforehand because Instrument.convertToCounts() references them.

I edited Instrument.reset() to define self.photfnu and self.photplam before self.background, removing the need to set them again here in Instrument.pixel_background_unit().

@ojustino ojustino Apr 27, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I also changed the log message to show the converted background value in counts/s.

@ojustino ojustino Apr 27, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If quantum efficiency is always assumed to be 1 across the package, I do still wonder whether Instrument.convertToCounts() should have separate paths for photons and electrons. If not, should we make 'p' and 'e' equivalent in that function (with both being read as 'p'?) and note the change both in the docstring and in docs/using_stips/catalogue_formats.html (especially in the Mixed catalogs section)?

@eunkyuh eunkyuh May 7, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I agree with you that we should make 'p' and 'e' equivalent in that function and note that STIPS assumes QE=1. But all together, I think we are also assuming counts=p=e as well with gain = 1 because in the validation code, we don't do the gain correction to compare the STIPS output to Pandeia (e- and e-/s).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've changed Instrument.convertToCounts() to treat 'e' like 'p' and edited the docs as well.

Comment thread docs/using_stips/config_file.rst Outdated
conversion assumes a quantum yield of 1, where photons are equivalent to
electrons.

* the string value 'jbt', which will use the JBT background tool to

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure if the current STIPS is configured to call JBT. If yes, we want to change that to RBT but if not, I think we need to remove any mention of JBT.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OK, I see the v2.0 changelog includes the removal of JBT. It's still mentioned in stips/data/stips_config.yaml, so I'll remove that as well as the mention in the documentation. observation_jbt_location should also be removed from this docs page as well.

Comment thread docs/installation.rst Outdated

@eunkyuh eunkyuh May 7, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For Pandeia version later than 2025.9, we need this extra environment for Pandeia:

export PSF_DIR="<absolute_path_to_this_folder>/ref_data/pandeia_psfs"

@ojustino

ojustino commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Merging after successful test run and reaching consensus with @eunkyuh.

@ojustino
ojustino merged commit abe1e55 into main May 8, 2026
11 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

2 participants