Examples
In the examples below, img is either a string with the filename of a Roman ASDF file
or a Roman datamodel ImageModel.
To run TweakReg in a Python session with the default parameters:
from romancal.tweakreg.tweakreg_step import TweakRegStep step = TweakRegStep() step.run([img])
Note
If the input is a single Roman
DataModel, eitherstep.run([img])orstep.run(img)will work. For multiple elements as input, they must be passed in as either a list or a ModelLibrary.To run TweakReg in a Python session on an association file with the default parameters:
from romancal.tweakreg.tweakreg_step import TweakRegStep step = TweakRegStep() step.run("asn_file.json")
To run TweakReg on a Roman’s exposure with default astrometric parameters and save the absolute catalog data:
from romancal.tweakreg.tweakreg_step import TweakRegStep step = TweakRegStep() step.save_abs_catalog = True # save the catalog data used for absolute astrometry step.abs_refcat = 'GAIADR3' # use Gaia DR3 for absolute astrometry step.catalog_path = '/path/for/the/abs/catalog' # save the Gaia catalog to this path step.run([img])