TweakRegStep
- class jwst.tweakreg.TweakRegStep(name=None, parent=None, config_file=None, _validate_kwds=True, **kws)[source]
Bases:
JwstStepPerform image alignment based on catalogs of sources detected in input images.
Create a
Stepinstance.- Parameters:
- namestr
The name of the Step instance. Used in logging messages and in cache filenames. If not provided, one will be generated based on the class name.
- parent
Step The parent step of this step. Used to determine a fully-qualified name for this step, and to determine the mode in which to run this step.
- config_filestr or pathlib.Path
The path to the config file that this step was initialized with. Use to determine relative path names of other config files.
- _validate_kwdsbool
Validate given
kwsagainst specs/config.- **kwsdict
Additional parameters to set. These will be set as member variables on the new Step instance.
Attributes Summary
Methods Summary
process(input_data)Perform image alignment based on catalogs of sources detected in input images.
Attributes Documentation
- class_alias = 'tweakreg'
- spec = '\n save_catalogs = boolean(default=False) # Write out catalogs?\n use_custom_catalogs = boolean(default=False) # Use custom user-provided catalogs?\n catalog_format = string(default=\'ecsv\') # Catalog output file format\n catfile = string(default=\'\') # Name of the file with a list of custom user-provided catalogs\n starfinder = option(\'dao\', \'iraf\', \'segmentation\', default=\'iraf\') # Star finder to use.\n\n # general starfinder options\n snr_threshold = float(default=10.0) # SNR threshold above the bkg for star finder\n kernel_fwhm = float(default=2.5) # Gaussian kernel FWHM in pixels\n bkg_boxsize = integer(default=400) # The background mesh box size in pixels.\n\n # kwargs for DAOStarFinder and IRAFStarFinder, only used if starfinder is \'dao\' or \'iraf\'\n minsep_fwhm = float(default=0.0) # Minimum separation between detected objects in FWHM\n sigma_radius = float(default=1.5) # Truncation radius of the Gaussian kernel, units of sigma\n sharplo = float(default=0.5) # The lower bound on sharpness for object detection.\n sharphi = float(default=2.0) # The upper bound on sharpness for object detection.\n roundlo = float(default=0.0) # The lower bound on roundness for object detection.\n roundhi = float(default=0.2) # The upper bound on roundness for object detection.\n brightest = integer(default=200) # Keep top ``brightest`` objects\n peakmax = float(default=None) # Filter out objects with pixel values >= ``peakmax``\n\n # kwargs for SourceCatalog and SourceFinder, only used if starfinder is \'segmentation\'\n npixels = integer(default=10) # Minimum number of connected pixels\n connectivity = option(4, 8, default=8) # The connectivity defining the neighborhood of a pixel\n nlevels = integer(default=32) # Number of multi-thresholding levels for deblending\n contrast = float(default=0.001) # Fraction of total source flux an object must have to be deblended\n multithresh_mode = option(\'exponential\', \'linear\', \'sinh\', default=\'exponential\') # Multi-thresholding mode\n localbkg_width = integer(default=0) # Width of rectangular annulus used to compute local background around each source\n apermask_method = option(\'correct\', \'mask\', \'none\', default=\'correct\') # How to handle neighboring sources\n kron_params = float_list(min=2, max=3, default=None) # Parameters defining Kron aperture\n deblend = boolean(default=True) # deblend sources?\n\n # align wcs options\n enforce_user_order = boolean(default=False) # Align images in user specified order?\n expand_refcat = boolean(default=False) # Expand reference catalog with new sources?\n minobj = integer(default=15) # Minimum number of objects acceptable for matching\n fitgeometry = option(\'shift\', \'rshift\', \'rscale\', \'general\', default=\'rshift\') # Fitting geometry\n nclip = integer(min=0, default=3) # Number of clipping iterations in fit\n sigma = float(min=0.0, default=3.0) # Clipping limit in sigma units\n\n # xyxymatch options\n searchrad = float(default=2.0) # The search radius in arcsec for a match\n use2dhist = boolean(default=True) # Use 2d histogram to find initial offset?\n separation = float(default=1.0) # Minimum object separation for xyxymatch in arcsec\n tolerance = float(default=0.7) # Matching tolerance for xyxymatch in arcsec\n xoffset = float(default=0.0), # Initial guess for X offset in arcsec\n yoffset = float(default=0.0) # Initial guess for Y offset in arcsec\n\n # Absolute catalog options\n abs_refcat = string(default=\'\') # Catalog file name or one of: "\'GAIAREFCAT\'", "\'GAIADR3\'", "\'GAIADR2\'", or "\'GAIADR1\'", or None, or \'\'\n save_abs_catalog = boolean(default=False) # Write out used absolute astrometric reference catalog as a separate product\n\n # Absolute catalog align wcs options\n abs_minobj = integer(default=15) # Minimum number of objects acceptable for matching when performing absolute astrometry\n abs_fitgeometry = option(\'shift\', \'rshift\', \'rscale\', \'general\', default=\'rshift\')\n abs_nclip = integer(min=0, default=3) # Number of clipping iterations in fit when performing absolute astrometry\n abs_sigma = float(min=0.0, default=3.0) # Clipping limit in sigma units when performing absolute astrometry\n\n # absolute catalog xyxymatch options\n abs_searchrad = float(default=6.0) # The search radius in arcsec for a match when performing absolute astrometry\n abs_use2dhist = boolean(default=True) # Use 2D histogram to find initial offset when performing absolute astrometry? We encourage setting this parameter to True. Otherwise, xoffset and yoffset will be set to zero.\n abs_separation = float(default=1) # Minimum object separation in arcsec when performing absolute astrometry\n abs_tolerance = float(default=0.7) # Matching tolerance for xyxymatch in arcsec when performing absolute astrometry\n\n # SIP approximation options, should match assign_wcs\n sip_approx = boolean(default=True) # enables SIP approximation for imaging modes.\n sip_max_pix_error = float(default=0.01) # max err for SIP fit, forward.\n sip_degree = integer(max=6, default=None) # degree for forward SIP fit, None to use best fit.\n sip_max_inv_pix_error = float(default=0.01) # max err for SIP fit, inverse.\n sip_inv_degree = integer(max=6, default=None) # degree for inverse SIP fit, None to use best fit.\n sip_npoints = integer(default=12) # number of points for SIP\n\n # stpipe general options\n output_use_model = boolean(default=True) # When saving use `DataModel.meta.filename`\n in_memory = boolean(default=True) # If False, preserve memory using temporary files at expense of runtime\n '
Methods Documentation
- process(input_data)[source]
Perform image alignment based on catalogs of sources detected in input images.
- Parameters:
- input_data
ModelLibrary A collection of data models. This can also be an ASN-type input to be read into a
ModelLibrary.
- input_data
- Returns:
- output
ModelLibrary The aligned input data models.
- output