Skip to content

Commit

Permalink
Merge branch 'spacetelescope:main' into drizzlepac_additions
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanand authored Jul 3, 2024
2 parents d77d226 + 4ab99a8 commit 5f29313
Show file tree
Hide file tree
Showing 28 changed files with 33,896 additions and 1,032 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_buildondemand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ on:

jobs:
ExecuteNotebooks:
uses: spacetelescope/notebook-ci-actions/.github/workflows/ci_scheduled.yml@v4
uses: spacetelescope/notebook-ci-actions/.github/workflows/ci_scheduled.yml@multi_dev
with:
python-version: ${{ vars.PYTHON_VERSION }}
20 changes: 20 additions & 0 deletions .github/workflows/ci_execute_single.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Manual Single File Execute w/OS matrix
on:
workflow_dispatch:
inputs:
filename:
description: 'Notebook file name:'
required: true
default: 'notebook.ipynb'

jobs:
GenerateHTML:
uses: spacetelescope/notebook-ci-actions/.github/workflows/ci_execute_single.yml@multi_dev
with:
python-version: ${{ vars.PYTHON_VERSION }}
filename: ${{ github.event.inputs.filename }}
secrets:
CASJOBS_PW: ${{ secrets.CASJOBS_PW }}
CASJOBS_USERID: ${{ secrets.CASJOBS_USERID }}
permissions:
contents: write
2 changes: 1 addition & 1 deletion .github/workflows/ci_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
NotebookExecutionValidation:
uses: spacetelescope/notebook-ci-actions/.github/workflows/ci_runner.yml@v4
with:
python-version: ${{ vars.PYTHON_VERSION }}
python-version: ${{ vars.PYTHON_VERSION || '3.11' }}
permissions:
contents: write

2 changes: 1 addition & 1 deletion .github/workflows/pep8_nb_style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
Notebook_PEP8_Check:
uses: spacetelescope/notebook-ci-actions/.github/workflows/notebook_pep8check.yml@v3
with:
python-version: ${{ vars.PYTHON_VERSION }}
python-version: ${{ vars.PYTHON_VERSION || '3.11' }}
2 changes: 1 addition & 1 deletion .github/workflows/pep8_script_style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
Script_PEP8_Check:
uses: spacetelescope/notebook-ci-actions/.github/workflows/script_pep8check.yml@v3
with:
python-version: ${{ vars.PYTHON_VERSION }}
python-version: ${{ vars.PYTHON_VERSION || '3.11' }}
4 changes: 2 additions & 2 deletions .github/workflows/weekly_pep8_style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
Notebook_PEP8_Check:
uses: spacetelescope/notebook-ci-actions/.github/workflows/all_notebooks_pep8check.yml@v3
with:
python-version: ${{ vars.PYTHON_VERSION }}
python-version: ${{ vars.PYTHON_VERSION || '3.11' }}
Script_PEP8_Check:
uses: spacetelescope/notebook-ci-actions/.github/workflows/all_scripts_pep8check.yml@v3
with:
python-version: ${{ vars.PYTHON_VERSION }}
python-version: ${{ vars.PYTHON_VERSION || '3.11' }}
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ html:
use_issues_button: true
use_repository_button: true
# Exclude notebooks that have as-yet unresolved build failures (see tickets SPB-1153SPB-1160, SPB-1168)
exclude_patterns: [notebooks/DrizzlePac/align_mosaics/align_mosaics.ipynb,
exclude_patterns: [notebooks/DrizzlePac/drizzle_wfpc2/drizzle_wfpc2.ipynb,
notebooks/WFC3/dash/dash.ipynb]
17 changes: 9 additions & 8 deletions _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,16 @@ parts:
- caption: DrizzlePac
chapters:
- file: notebooks/DrizzlePac/README.md
- file: notebooks/DrizzlePac/Initialization/Initialization.ipynb
- file: notebooks/DrizzlePac/using_updated_astrometry_solutions/using_updated_astrometry_solutions.ipynb
- file: notebooks/DrizzlePac/align_to_catalogs/align_to_catalogs.ipynb
# Notebook excluded from build until build failures are fixed (See SPB-1168)
# - file: notebooks/DrizzlePac/align_mosaics/align_mosaics.ipynb
- file: notebooks/DrizzlePac/align_multiple_visits/align_multiple_visits.ipynb
- file: notebooks/DrizzlePac/align_sparse_fields/align_sparse_fields.ipynb
- file: notebooks/DrizzlePac/drizzle_wfpc2/drizzle_wfpc2.ipynb
- file: notebooks/DrizzlePac/mask_satellite/mask_satellite.ipynb
- file: notebooks/DrizzlePac/align_multiple_visits/align_multiple_visits.ipynb
- file: notebooks/DrizzlePac/use_ds9_regions_in_tweakreg/use_ds9_regions_in_tweakreg.ipynb
- file: notebooks/DrizzlePac/optimize_image_sampling/optimize_image_sampling.ipynb
- file: notebooks/DrizzlePac/align_mosaics/align_mosaics.ipynb
- file: notebooks/DrizzlePac/sky_matching/sky_matching.ipynb
- file: notebooks/DrizzlePac/use_ds9_regions_in_tweakreg/use_ds9_regions_in_tweakreg.ipynb
- file: notebooks/DrizzlePac/using_updated_astrometry_solutions/using_updated_astrometry_solutions.ipynb
- file: notebooks/DrizzlePac/mask_satellite/mask_satellite.ipynb
#- file: notebooks/DrizzlePac/drizzle_wfpc2/drizzle_wfpc2.ipynb
- caption: HASP
chapters:
- file: notebooks/HASP/Setup/Setup.ipynb
Expand Down Expand Up @@ -86,3 +84,6 @@ parts:
- file: notebooks/WFC3/uvis_time_dependent_photometry/uvis_timedep_phot.ipynb
- file: notebooks/WFC3/zeropoints/zeropoints.ipynb
- file: notebooks/WFC3/uvis_pam_corrections/WFC3_UVIS_Pixel_Area_Map_Corrections_for_Subarrays.ipynb
- file: notebooks/WFC3/point_spread_function.md
sections:
- file: notebooks/WFC3/point_spread_function/hst_point_spread_function.ipynb
337 changes: 0 additions & 337 deletions notebooks/DrizzlePac/Initialization/Initialization.ipynb

This file was deleted.

2 changes: 0 additions & 2 deletions notebooks/DrizzlePac/Initialization/requirements.txt

This file was deleted.

64 changes: 47 additions & 17 deletions notebooks/DrizzlePac/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,55 @@
# DrizzlePac Jupyter Notebook Tutorials
DrizzlePac Notebooks
=================

An updated set of HST drizzling and alignment tutorials are now available and compatible with the latest STScI distributed software environment [stenv](https://stenv.readthedocs.io/en/latest/). These notebooks include a new recommended workflow for MAST data retrieved after December 2019, which includes updated astrometric information included as additional FITS extensions. Alternatively, the new World Coordinate System (WCS) solutions may be downloaded directly from MAST as small 'headerlet' files and applied to existing data. For example, the Hubble Advanced Product 'Single Visit Mosaics' may have improved relative alignment for different filters acquired in the same visit. These headerlets may be used to update the WCS in the FITS images prior to drizzling. For details on the alignment of HST data in MAST, see Section 4.5 [Absolute Astrometry](https://hst-docs.stsci.edu/drizzpac/chapter-4-astrometric-information-in-the-header/4-5-absolute-astrometry) in the DrizzlePac Handbook.

Improved drizzling tutorials are now available as Jupyter Notebooks and compatible with the latest STScI distributed software as part of AstroConda. Prior drizzling examples were written for the DrizzlePac Handbook in 2012, just after MultiDrizzle was replaced, and supplemental examples were posted to the DrizzlePac Webpage in 2015 to support enhanced features in DrizzlePac 2.0. The new interactive notebooks consolidate information from these prior examples to form a more cohesive set, and any references to outdated software, such as PyRAF, have been removed and replaced with python functionality.
In each notebook, a sample WFC3 or ACS dataset is used to demonstrate how to download the calibrated data, inspect the quality of the alignment, and test whether the observations need to be realigned before combining the data with `AstroDrizzle`. Different workflows are illustrated to enhance the scientific value of the drizzled data products using advanced reprocessing techniques. These notebooks highlight different use cases, e.g. images acquired using small sub-pixel dithers to optimally sample the PSF versus those acquired in multiple pointings to generate large mosaics on the sky.

The notebooks contain live code and visualizations, along with the usual narrative text, making them an ideal training exercise for new users. Each tutorial includes blocks of code demonstrating how to download the calibrated data from the MAST archive, how to align frames and update the image world coordinate system, and how to enhance the scientific value of the drizzled data products using advanced reprocessing techniques.
The notebooks available in this repository include:

The eleven notebooks available in this repository include the following topics:
Alignment Workflows:
- [Improving Absolute and Relative Astrometry Using Alternate WCS Solutions](https://spacetelescope.github.io/hst_notebooks/notebooks/DrizzlePac/using_updated_astrometry_solutions/using_updated_astrometry_solutions.html)
- [Aligning HST images to an Absolute Reference Catalog](https://spacetelescope.github.io/hst_notebooks/notebooks/DrizzlePac/align_to_catalogs/align_to_catalogs.html)
- [Aligning Deep Exposures of Sparse Fields](https://spacetelescope.github.io/hst_notebooks/notebooks/DrizzlePac/align_sparse_fields/align_sparse_fields.html)
- [Aligning Multiple HST Visits](https://spacetelescope.github.io/hst_notebooks/notebooks/DrizzlePac/align_multiple_visits/align_multiple_visits.html)
- [Using DS9 Regions for Source Inclusion/Exclusion](https://spacetelescope.github.io/hst_notebooks/notebooks/DrizzlePac/use_ds9_regions_in_tweakreg/use_ds9_regions_in_tweakreg.html)

* Initializing DrizzlePac
* Aligning observations obtained in multiple HST visits
* Aligning HST images to an absolute reference catalog (e.g. GAIA, SDSS)
* Aligning sparse fields
* Improving alignment with DS9 exclusion regions
* Masking satellite trails in DQ arrays prior to drizzling
* Optimizing the image sampling for dithered datasets
* Drizzling WFPC2 data to use a single zeropoint
* Sky matching features for HST mosaics
* Aligning HST mosaics observed with multiple detectors
* Using the updated astrometry solutions based on _Gaia_ positions
Drizzling Features:
- [Optimizing the Image Sampling for Sub-pixel dithers](https://spacetelescope.github.io/hst_notebooks/notebooks/DrizzlePac/optimize_image_sampling/optimize_image_sampling.html)
- [Creating HST mosaics observed with multiple detectors](https://spacetelescope.github.io/hst_notebooks/notebooks/DrizzlePac/align_mosaics/align_mosaics.html)
- [Using Sky Matching features for HST mosaics](https://spacetelescope.github.io/hst_notebooks/notebooks/DrizzlePac/sky_matching/sky_matching.html)
- [Masking satellite trails prior to drizzling](https://spacetelescope.github.io/hst_notebooks/notebooks/DrizzlePac/mask_satellite/mask_satellite.html)

Additional tutorials will be added to the repository as new software functionality becomes available, especially for advanced use cases. For additional assistance with DrizzlePac tools, users may submit a ticket to the [STScI Help Desk](https://stsci.service-now.com/hst?id=hst_index) or send an email to [email protected].
For more information, see the [DrizzlePac Handbook](https://hst-docs.stsci.edu/drizzpac) and the [readthedocs](https://drizzlepac.readthedocs.io/en/latest/) software documentation. For additional assistance with DrizzlePac tools, users may submit a ticket to the [STScI Help Desk](https://stsci.service-now.com/hst?id=hst_index) and should select the DrizzlePac category.


Special thanks to the authors of these notebooks: J. Mack, S. Hoffmann, R. Avila, V. Bajaj, M. Cara, T. Desjardins, K. Huynh, B. Kuhn, C. Martlin, A. O’Connor, and C. Shanahan
Installation
------------

It is recommended to clone the entire repository. To do so, run the following command in a terminal:

```
git clone https://github.com/spacetelescope/hst_notebooks
```

`stenv` is the preferred base virtual environment for running WFC3 Noteboks since
it contains libraries necessary for processing and analyzing data from the Hubble
Space Telescope (HST) and the James Webb Space Telescope (JWST). To install, see
[stenv readthedocs](https://stenv.readthedocs.io/en/latest/) or
[stenv GitHub](https://github.com/spacetelescope/stenv).

`hst_notebooks/notebooks_env` is the default virtual environment for HST Notebooks,
which contains the same scientific computing libraries in `stenv`, but not the HST and
JWST libraries. This environment can also be used as a base, but is not recommended.

In addition, each notebook contains a `requirements.txt` file that needs to be
installed before running the notebooks. Here is a common set of commands to run
before executing the notebooks (assuming your virtual environment is activated):

```
pip install -r requirements.txt
pip install notebook
```

With the environment activated and additional libraries installed based on the
individual requirement files, you will be able to complete the notebooks.
Loading

0 comments on commit 5f29313

Please sign in to comment.