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

STIPS 2.1 Pull Request #167

Merged
merged 34 commits into from
Oct 31, 2023
Merged

Conversation

gmzsebastian
Copy link
Collaborator

  • Fixed generic bugs
  • Updated background to use Pandeia
  • Fixed flux values to correct zeropoints

@gmzsebastian gmzsebastian requested a review from ojustino July 17, 2023 18:26
@gmzsebastian
Copy link
Collaborator Author

Additional changes:

  • Updated the code to make sure it works with the latest version of Pandeia, 3.0
  • Updated the documentation to make sure all the new changes are reflected properly, and that they match what RDox says.

Copy link
Collaborator

@ojustino ojustino left a comment

Choose a reason for hiding this comment

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

Hi @gmzsebastian, thanks for your work on this release and your patience with the review. I left a few review comments on specific lines of code and have included some larger questions as a checklist here. I'll update the list as each line is resolved.

  • I have opened a PR against your branch that will a) change bullet characters back to normal in the docs after stsci_rtd_theme fixed an issue that led us to change them during the 2.0.0 release, and b) update the package version in setup.cfg and stips/__init__.py to match our intended release number. If you approve, please accept and merge it into this PR branch.

  • Are you able to fully run the "Basic" and "Advanced I" tutorial notebooks while off the VPN? While both are OK for me on the VPN, if I'm not connected, cells that feature calls to ObservationModule() trigger a warning saying "Vega spectrum from /grp/hst/cdbs//calspec/alpha_lyr_stis_010.fits" is missing and an error saying that the COMPFILES list in the RomanInstrument class is empty.

  • An extra touch to the "Advanced II" notebook that I think would be helpful is for the tick labels of the 60x60-pixel cutout region to match their corresponding pixel numbers in the original FITS image. If you agree, you can adapt the following code for the cells that need it in the notebook:

# add this import to the first cell
# (and alphabetize all of them as indicated in PR code review comments)
import matplotlib.ticker as ticker

...

# in cutout plots, try the following:
x_mid = 88
y_mid = 88
half = 30

# to plot cutout region:
fig0, ax0 = plt.subplots(figsize=(4,4))
ax0.imshow(test_psf[x_mid - half:x_mid + half,
                    y_mid - half:y_mid + half])

# create custom formatter for cutout region axes (run once)
ticks_x = ticker.FuncFormatter(lambda x, pos: f"{x + x_mid - half:.0f}")
ticks_y = ticker.FuncFormatter(lambda y, pos: f"{y + y_mid - half:.0f}")

# replace default tick labels with cutout pixel indices
# (run in every cell that shows a plot of the cutout region)
ax0.set_xticks([x for x in ax0.get_xticks() if 0 <= x < half*2])
ax0.xaxis.set_major_formatter(ticks_x)
ax0.yaxis.set_major_formatter(ticks_y)
  • What do you think of putting psf_WFI_2.0.0_F129_sca01.fits into a "notebook_data" directory or something similar so notebooks/ contains only that folder and the tutorial notebooks? If we go this route, I don't modifying the notebooks so the data files they generate also go in that folder.

  • Since you updated the name of the Basic Tutorial notebook, we need to ensure that other pages that reference it don't end up with broken links. One example is the end of the introductory paragraph in the RDox "STIPS Basic Use Tutorial." Can you think of any others?

  • Since stips/utilities/tests/test_makePSF.py is new and stips/instruments/wfi.py has almost been entirely remade, please do a PEP8 code style check on these files and commit the edits. Other places in STIPS are not strictly PEP8-compliant, but we should at least endeavor to follow the style guide when we introduce new code. If you're not already familiar with how to do this, I have used the flake8 Python package and can give support it if needed.

stips/instruments/instrument.py Outdated Show resolved Hide resolved
stips/instruments/instrument.py Show resolved Hide resolved
stips/instruments/wfi.py Outdated Show resolved Hide resolved
stips/utilities/__init__.py Outdated Show resolved Hide resolved
stips/utilities/tests/test_makePSF.py Outdated Show resolved Hide resolved
@gmzsebastian gmzsebastian merged commit 938f445 into spacetelescope:master Oct 31, 2023
5 checks passed
@gmzsebastian
Copy link
Collaborator Author

I've gone through all the updates and suggestions for the STIPS 2.1 code review. I'll do some final tests and after that we should be ready for release!

@gmzsebastian
Copy link
Collaborator Author

Accidentally merged PR167 into Master

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.

3 participants