### Install Drizzlepac from Source Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/getting_started/installation.md Install Drizzlepac after cloning the repository and navigating to the project directory. ```shell python setup.py install ``` -------------------------------- ### Install Drizzlepac from Source Source: https://github.com/spacetelescope/drizzlepac/blob/main/README.md Installs Drizzlepac after cloning the repository, using pip. ```bash $ pip install . ``` -------------------------------- ### Install Documentation Dependencies Source: https://github.com/spacetelescope/drizzlepac/blob/main/CONTRIBUTING.rst Install the necessary dependencies for building documentation, including Sphinx and its themes, using pip. ```bash pip install -e "'.[docs]'" ``` -------------------------------- ### Astrometric Solution Naming Convention Example Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/astrometry.md Illustrates the naming convention for a priori astrometric solutions, combining a starting WCS with an astrometric catalog. ```default - For example, 'IDC_0461802ej-GSC240' ``` -------------------------------- ### Install Documentation Dependencies Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/CONTRIBUTING.md Install the necessary dependencies for building documentation, including Sphinx and its themes. This command should be run from the top-level directory of the Drizzlepac project. ```bash >> pip install -e ".[docs]" ``` -------------------------------- ### TweakReg Python Example with Dict Constructor Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/api/drizzlepac.tweakreg.TweakReg.md Aligns calibrated images using IMAGEFIND, similar to the previous example but using the dict constructor for configuration parameters. Saves residual offsets to a file. ```pycon >>> import drizzlepac >>> from drizzlepac import tweakreg >>> tweakreg.TweakReg('*flt.fits', ... imagefindcfg=dict(threshold=200, conv_width=3.5), ... refimagefindcfg=dict(threshold=400, conv_width=2.5), ... updatehdr=False, shiftfile=True, outshifts='shift.txt') ``` -------------------------------- ### Install Test Dependencies Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/CONTRIBUTING.md Install the optional 'test' dependencies required for running unit tests. This includes pytest and other necessary packages. ```bash >> pip install -e ".[test]" ``` -------------------------------- ### Import adrizzle Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/api/drizzlepac.adrizzle.drizzle.md Import the adrizzle module to use its functionalities. This is a basic setup step. ```pycon >>> from drizzlepac import adrizzle ``` -------------------------------- ### Alignment Parameters Example Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/astrometry_api.md Example dictionary for alignment parameters used in the AlignmentTable class. Includes settings for source finding, background computation, and object detection. ```python { 'fwhmpsf': 0.12, # kernel defining, source finding par # background computing pars 'box_size': BKG_BOX_SIZE, 'win_size': BKG_FILTER_SIZE, 'bkg_estimator': SExtractorBackground, 'rms_estimator': StdBackgroundRMS, 'nsigma': 5., 'threshold_flag': None, # object finding pars 'source_box': 7, 'classify': True, 'centering_mode': "starfind", 'nlargest': None, 'plot': False, 'vmax': None, 'deblend': False } ``` -------------------------------- ### Example Output Dictionary Structure Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/run_singlehap.md Illustrates the expected format of the output dictionary for single exposure products, filter products, and total detection products. ```default obs_info_dict["single exposure product 00": {"info": '11665 06 wfc3 uvis empty_aperture ib4606c5q f555w drc', "files": ['ib4606c5q_flc.fits']} . . . obs_info_dict["single exposure product 08": {"info": '11665 06 wfc3 ir empty_aperture ib4606clq f110w drz', "files": ['ib4606clq_flt.fits']} obs_info_dict["filter product 00": {"info": '11665 06 wfc3 uvis empty_aperture ib4606c5q f555w drc', "files": ['ib4606c5q_flc.fits', 'ib4606c6q_flc.fits']}, . . . obs_info_dict["filter product 01": {"info": '11665 06 wfc3 ir empty_aperture ib4606cmq f160w drz', "files": ['ib4606cmq_flt.fits', 'ib4606crq_flt.fits']}, obs_info_dict["total detection product 00": {"info": '11665 06 wfc3 uvis empty_aperture ib4606c5q f555w drc', "files": ['ib4606c5q_flc.fits', 'ib4606c6q_flc.fits']} . . . obs_info_dict["total detection product 01": {"info": '11665 06 wfc3 ir empty_aperture ib4606cmq f160w drz', "files": ['ib4606cmq_flt.fits', 'ib4606crq_flt.fits']} ``` -------------------------------- ### TweakReg Python Example with Config File Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/api/drizzlepac.tweakreg.TweakReg.md Runs the TweakReg task by specifying all parameters in an external configuration file named 'myparam.cfg'. ```pycon >>> tweakreg.TweakReg('*flt.fits', configobj='myparam.cfg') ``` -------------------------------- ### Example MVM Filter-Level Filename Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/mvm_utilities.md Provides a concrete example of a filter-level drizzled filename. ```default hst_skycell-p0081x14y14_wfc3_uvis_f225w_all_drc.fits ``` -------------------------------- ### Create Static Mask with Default Parameters Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/api/drizzlepac.staticMask.createMask.md This example demonstrates how to call the `createMask` function from a Python command line using its default parameters. It assumes input files matching the pattern '*flt.fits'. ```python from drizzlepac import staticMask staticMask.createMask('*flt.fits') ``` -------------------------------- ### Install Drizzlepac with pip Source: https://github.com/spacetelescope/drizzlepac/blob/main/README.md Installs Drizzlepac using pip. The `--no-use-pep517` option might be necessary for older pip versions. ```bash $ pip install git+https://github.com/spacetelescope/drizzlepac.git ``` -------------------------------- ### Example FITS File Info Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/mvm_utilities.md Demonstrates how to open a combined FITS file and inspect its HDU information using astropy.io.fits. This is useful for verifying the structure and content of the output files. ```python import astropy.io.fits as fits hdu = fits.open("hst_combined_skycells-ra84d9402-decs69d8514_acs_wfc_f658n.fits") hdu.info() ``` -------------------------------- ### TweakReg Python Example with Image Finding Config Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/api/drizzlepac.tweakreg.TweakReg.md Aligns a set of calibrated images using IMAGEFIND. Specifies source finding parameters for input and reference images, disables header updates, and saves residual offsets to a file. ```pycon >>> import drizzlepac >>> from drizzlepac import tweakreg >>> tweakreg.TweakReg('*flt.fits', ... imagefindcfg={'threshold' : 200, 'conv_width' : 3.5}, ... refimagefindcfg={'threshold' : 400, 'conv_width' : 2.5}, ... updatehdr=False, shiftfile=True, outshifts='shift.txt') ``` -------------------------------- ### OutputImage Class Initialization Optional Exposure Time Parameters Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/drizzlepac_api/outimage.md Optional parameters for 'plist' to pass overall exposure time information during OutputImage initialization. These include total exposure time, start, and end times. ```default plist['texptime'] - total exptime for output plist['expstart'] - start time of combined exposure plist['expend'] - end time of combined exposure ``` -------------------------------- ### Exclusion Catalog Format Example 1 Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/api/drizzlepac.tweakreg.TweakReg.md Specifies exclusion files for input images. The first image has no exclusion file, while the second has one. The first file can be omitted if no exclusions are needed. ```default j99da1emq_flt.fits j99da1f2q_flt.fits test_exclusion.reg ``` -------------------------------- ### Exclusion Catalog Format Example 2 Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/api/drizzlepac.tweakreg.TweakReg.md Specifies exclusion files for input images, explicitly indicating no exclusion file for the first chip of the second image using 'None'. ```default j99da1emq_flt.fits j99da1f2q_flt.fits None test_sci2_exclusion.reg ``` -------------------------------- ### Get DrizzlePac Version Source: https://github.com/spacetelescope/drizzlepac/blob/main/CHANGELOG.rst Identify the installed version of DrizzlePac using a Python interpreter. ```python import drizzlepac >>> drizzlepac.__version__ ``` -------------------------------- ### drizzlepac.tweakback.help Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/user_reprocessing/tweakback.md Prints syntax help for running the tweakback command-line tool. ```APIDOC ## drizzlepac.tweakback.help(file=None) ### Description Print out syntax help for running `tweakback`. ### Parameters * **file** (string, optional) - If given, write out help to the filename specified by this parameter. Any previously existing file with this name will be deleted before writing out the help. Defaults to None. ``` -------------------------------- ### Build Documentation Locally Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/CONTRIBUTING.md Build the project documentation locally using the Make utility. This command generates HTML files in the `_build/html` directory, allowing you to preview documentation changes before committing. ```bash >> make html ``` -------------------------------- ### Get Headerlet WCS Names with STWCS Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/astrometry.md Retrieves a list of WCS names from a FITS file using the STWCS library. Ensure STWCS is installed. ```python from stwcs.wcsutil import headerlet headerlet.get_headerlet_kw_names("j95y04hq_flc.fits", kw='WCSNAME') ``` -------------------------------- ### Initialize HAPCatalogs Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/run_singlehap.md Generates photometric sourcelists for specified TOTAL or FILTER product images. Requires the input FITS file, parameter dictionaries for catalog generation and QC, a mask for image areas, and the log level. ```python from drizzlepac.haputils.catalog_utils import HAPCatalogs # Example usage: # hap_catalogs = HAPCatalogs(fitsfile='image.fits', param_dict={}, param_dict_qc={}, num_images_mask=None, log_level='INFO') ``` -------------------------------- ### Build Documentation Locally Source: https://github.com/spacetelescope/drizzlepac/blob/main/CONTRIBUTING.rst Navigate to the docs directory and build the HTML documentation locally. This helps catch errors before submitting a pull request. ```bash make html ``` -------------------------------- ### List installed packages in Conda environment Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/CONTRIBUTING.md Use this command to verify that the development versions of Drizzlepac and its dependencies are correctly installed in your environment. ```bash >> conda list ``` -------------------------------- ### main Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/make_custom_mosaic.md Command-line interface for creating custom mosaics. ```APIDOC ## main ### Description Command-line interface for creating custom mosaics. ### Method `make_custom_mosaic.main()` ### Parameters None ### Returns - **return_value** (integer) - return value from the run. 0 for successful run, something else otherwise. ``` -------------------------------- ### UserCatalog Initialization Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/object_classes/catalogs.md Instantiate UserCatalog with WCS, catalog source, and interpretation parameters. ```python UserCatalog(wcs, catalog_source, **kwargs) ``` -------------------------------- ### Install Drizzlepac Test Dependencies Source: https://github.com/spacetelescope/drizzlepac/blob/main/CONTRIBUTING.rst Installs optional dependencies required for running tests, including pytest. This is necessary for local development and testing. ```bash pip install -e ".[test"] ``` -------------------------------- ### Sample Catfile Format Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/api/drizzlepac.tweakreg.TweakReg.md Illustrates the expected format for the 'catfile', which lists input images and their associated catalog files. Each line specifies an input image followed by catalog files for each science extension. ```default image1_flt.fts cat1_sci1.coo cat1_sci2.coo image2_flt.fts cat2_sci1.coo cat2_sci2.coo ``` -------------------------------- ### Check Development Environment Package Versions Source: https://github.com/spacetelescope/drizzlepac/blob/main/CONTRIBUTING.rst Lists all installed packages in the current Conda environment, useful for verifying that development versions of dependencies are correctly installed. ```bash conda list ``` -------------------------------- ### Run photeq with Default Parameters Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/utilities/photeq.md Use this snippet for most cases where default parameters are sufficient for HST images. Ensure the input files match the pattern. ```python from drizzlepac import photeq photeq.photeq(files='*_flt.fits', readonly=False) ``` -------------------------------- ### Install Drizzlepac in Editable Mode Source: https://github.com/spacetelescope/drizzlepac/blob/main/CONTRIBUTING.rst Installs the Drizzlepac package in editable mode from the local source code. Changes made to the source code will be immediately reflected without reinstallation. ```bash >> pip install -e . ``` -------------------------------- ### Automated Poller Input File Format Example Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/svm_processing.md Example of the automated processing file format used by STScI. Each line represents an exposure with comma-separated values detailing its properties. ```default ic0s17h4q_flt.fits,12861,C0S,17,602.937317,F160W,IR,ic0s/ic0s17h4q/ic0s17h4q_flt.fits ic0s17h5q_flt.fits,12861,C0S,17,602.937317,F160W,IR,ic0s/ic0s17h5q/ic0s17h5q_flt.fits ic0s17h7q_flt.fits,12861,C0S,17,602.937317,F160W,IR,ic0s/ic0s17h7q/ic0s17h7q_flt.fits ic0s17hhq_flt.fits,12861,C0S,17,602.937317,F160W,IR,ic0s/ic0s17hhq/ic0s17hhq_flt.fits ``` -------------------------------- ### getMdriztabPars Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/drizzlepac_api/process.md High-level function for getting the parameters from MDRIZTAB, primarily used for the TEAL interface. ```APIDOC ## drizzlepac.processInput.getMdriztabPars(input) ### Description High-level function for getting the parameters from MDRIZTAB. Used primarily for the TEAL interface. ### Parameters #### Path Parameters - **input** (str) - Description of input parameter ``` -------------------------------- ### drizzlepac.pixreplace.help Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/utilities/pixreplace.md Prints out syntax help for running the pixreplace utility. ```APIDOC ## drizzlepac.pixreplace.help ### Description Print out syntax help for running `pixreplace`. ### Method `help(file=None)` ### Parameters #### Path Parameters - **file** (string) - Optional - If given, write out help to the filename specified by this parameter. Any previously existing file with this name will be deleted before writing out the help. ``` -------------------------------- ### drizzlepac.tweakutils.build_pos_grid Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/user_reprocessing/tweakutils.md Returns a grid of positions between a start and end point, with a specified step interval. This function is deprecated. ```APIDOC ## drizzlepac.tweakutils.build_pos_grid(start, end, nstep, mesh=False) ### Description Returns a grid of positions starting at X,Y given by ‘start’, and ending at X,Y given by ‘end’. The grid will be completely filled in X and Y by every ‘step’ interval. ### Parameters * **start** (tuple) - The starting X,Y coordinates. * **end** (tuple) - The ending X,Y coordinates. * **nstep** (int) - The number of steps to take between start and end. * **mesh** (bool, optional) - If True, returns a meshgrid. Defaults to False. ### Deprecated Deprecated since version 3.0.0: The build_pos_grid function is deprecated and may be removed in a future version. ``` -------------------------------- ### RefCatalog Initialization Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/object_classes/catalogs.md Instantiate RefCatalog, a subclass of UserCatalog for managing reference catalogs. ```python RefCatalog(wcs, catalog_source, **kwargs) ``` -------------------------------- ### Importing Necessary Libraries Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/astrometry.md Import all required libraries for working with Drizzlepac, Astropy, and STWCS. Ensure these packages are installed in your Python environment. ```python from drizzlepac.haputils import astroquery_utils as aqutils from drizzlepac.haputils import astrometric_utils as amutils from astropy.io import fits from stwcs.wcsutil import headerlet ``` -------------------------------- ### Initialize HAPPointCatalog Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/run_singlehap.md Generates photometric sourcelists for specified image(s) using aperture photometry of point sources. Requires the image object, parameter dictionaries, and diagnostic mode settings. ```python from drizzlepac.haputils.catalog_utils import HAPPointCatalog # Example usage: # point_catalog = HAPPointCatalog(image=None, param_dict={}, param_dict_qc={}, diagnostic_mode=False, tp_sources={}) ``` -------------------------------- ### Create Conda Environment Source: https://github.com/spacetelescope/drizzlepac/blob/main/CONTRIBUTING.rst Creates a new conda environment named 'drizzlepac_dev' with Python installed. This is recommended for isolating development dependencies. ```bash >> conda create -n drizzlepac_dev python ``` -------------------------------- ### Initialize CatalogImage Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/run_singlehap.md Represents an image for catalog generation. Requires the filename, a mask indicating valid image areas, and the desired log level. ```python from drizzlepac.haputils.catalog_utils import CatalogImage # Example usage: # catalog_image = CatalogImage('image.fits', num_images_mask=None, log_level='INFO') ``` -------------------------------- ### Locate MVM Parameter Files Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/mast_data_products/mvm_processing.md Use this Python code to navigate to the directory containing MVM parameter files. These files are installed with the drizzlepac package. ```python import os import drizzlepac # # Directory is: drizzlepac/pars/hap_pars/mvm_parameters # os.chdir(os.path.join(drizzlepac.__path__, 'pars', 'hap_pars', 'mvm_parameters')) ``` -------------------------------- ### Drizzlepac Python Dependencies Source: https://github.com/spacetelescope/drizzlepac/blob/main/doc/source/DEPENDENCIES.md Specifies the minimum version requirements for various Python packages used by Drizzlepac. Ensure these versions are installed for correct operation. ```text "astropy>=6.1", "fitsblender>=0.4.2", "scipy>=1.11", "matplotlib", "stsci.tools>=4.0", "stsci.image>=2.3.7", "stsci.imagestats>=1.8.2", "stsci.skypac>=1.0.11", "stsci.stimage", "stwcs>=1.7.4", "tweakwcs>=0.8.7", "requests", "scikit-learn>=0.20", "simplify-polyline", "bokeh", "pandas", "spherical_geometry>=1.2.22", "astroquery>=0.4", "astrocut", "photutils", "lxml", "pypdf", "scikit-image>=0.14.2", "numpy>2.0", "regions" ```