diff --git a/docs/romanisim/ff_va_WFI02.png b/docs/romanisim/ff_va_WFI02.png new file mode 100644 index 0000000..baa48a7 Binary files /dev/null and b/docs/romanisim/ff_va_WFI02.png differ diff --git a/docs/romanisim/l1.rst b/docs/romanisim/l1.rst index 5a59392..d03515e 100644 --- a/docs/romanisim/l1.rst +++ b/docs/romanisim/l1.rst @@ -47,7 +47,26 @@ Gain ---- L1 files are in units of DN. We convert from photons to DN using gains from CRDS or a default values of 2 electron per DN, treating electrons and photons as equivalent. This neglects the possibility that the quantum yield may be different from 1 at certain wavelengths, in particular in the blue, where `Givans+2022 `_ find a quantum field of up to 1.05. +.. _velocity-aberration: + +Velocity Aberration +------------------- + +Velocity (or stellar) aberration is the amount of change in an object's apparent +location on the sky due to motion of the observer in relation to the object. For +observers orbiting the Sun at approximately 1 AU, the absolute correction can be +up to 26 arcsec. For Roman, this absolute difference will be handled by +spacecraft operations. However, this is true for only the target; the aberration +changes across the FOV, varying in both position and time. This differential +aberration is implemented as a scale factor from the reference point of each +detector. For Roman, this scale is approximately one-fifth of an arcsec at the +corners. + +For simulation, since the Roman orbit is undefined and would be dominated by the +Earth's motion anyways, Earth barycentric velocity is used. + .. automodapi:: romanisim.l1 .. automodapi:: romanisim.nonlinearity .. automodapi:: romanisim.persistence -.. automodapi:: romanisim.cr +.. automodapi:: romanisim.cr +.. automodapi:: romanisim.velocity_aberration diff --git a/docs/romanisim/running.rst b/docs/romanisim/running.rst index 72e701f..bbcedde 100644 --- a/docs/romanisim/running.rst +++ b/docs/romanisim/running.rst @@ -15,12 +15,7 @@ The ``romanisim-make-image`` command line interface (CLI) has a number of argume this functionality:: romanisim-make-image -h - usage: romanisim-make-image [-h] [--bandpass BANDPASS] [--boresight] [--catalog CATALOG] [--config CONFIG] - [--date DATE] [--level LEVEL] [--ma_table_number MA_TABLE_NUMBER] [--nobj NOBJ] - [--previous PREVIOUS] [--radec RADEC RADEC] [--rng_seed RNG_SEED] [--roll ROLL] - [--sca SCA] [--usecrds] [--webbpsf] [--truncate TRUNCATE] - [--pretend-spectral PRETEND_SPECTRAL] [--drop-extra-dq] - filename + usage: romanisim-make-image [-h] [--bandpass BANDPASS] [--boresight] [--catalog CATALOG] [--config CONFIG] [--date DATE] [--level LEVEL] [--ma_table_number MA_TABLE_NUMBER] [--nobj NOBJ] [--previous PREVIOUS] [--radec RADEC RADEC] [--rng_seed RNG_SEED] [--roll ROLL] [--sca SCA] [--usecrds] [--webbpsf] [--truncate TRUNCATE] [--pretend-spectral PRETEND_SPECTRAL] [--drop-extra-dq] [--scale-factor SCALE_FACTOR] filename Make a demo image. @@ -37,21 +32,20 @@ this functionality:: --level LEVEL 1 or 2, for L1 or L2 output (default: 2) --ma_table_number MA_TABLE_NUMBER --nobj NOBJ - --previous PREVIOUS previous simulated file in chronological order used for persistence modeling. (default: - None) + --previous PREVIOUS previous simulated file in chronological order used for persistence modeling. (default: None) --radec RADEC RADEC ra and dec (deg) (default: None) --rng_seed RNG_SEED - --roll ROLL Position angle (North towards YIdl) measured at the V2Ref/V3Ref of the aperture used. - (default: 0) - --sca SCA SCA to simulate. Use -1 to generate images for all SCAs; include {} in filename for this - mode to indicate where the SCA number should be filled, e.g. l1_wfi{}.asdf (default: 7) + --roll ROLL Position angle (North towards YIdl) measured at the V2Ref/V3Ref of the aperture used. (default: 0) + --sca SCA SCA to simulate. Use -1 to generate images for all SCAs; include {} in filename for this mode to indicate where the SCA number should be filled, e.g. + l1_wfi{}.asdf (default: 7) --usecrds Use CRDS for distortion map (default: False) --webbpsf Use webbpsf for PSF (default: False) --truncate TRUNCATE If set, truncate the MA table at given number of resultants. (default: None) --pretend-spectral PRETEND_SPECTRAL - Pretend the image is spectral. exposure.type and instrument.element are updated to be - grism / prism. (default: None) + Pretend the image is spectral. exposure.type and instrument.element are updated to be grism / prism. (default: None) --drop-extra-dq Do not store the optional simulated dq array. (default: False) + --scale-factor SCALE_FACTOR + Velocity aberration-induced scale factor. If negative, use given time to calculated based on orbit ephemeris. (default: -1.0) EXAMPLE: romanisim-make-image output_image.asdf diff --git a/docs/romanisim/wcs.rst b/docs/romanisim/wcs.rst index c9f645b..c64fc20 100644 --- a/docs/romanisim/wcs.rst +++ b/docs/romanisim/wcs.rst @@ -5,5 +5,28 @@ The simulator has two options for modeling distortion and world coordinate syste The latter system works by grabbing reference distortion maps for the appropriate detector and filter combinations from the Roman CRDS server. These distortion maps are then wrapped into a galsim WCS object and fed to galsim's rendering pipeline. +Velocity Aberration +------------------- + +When using a distortion model, either provided or through CRDS, there is also +opportunity to apply velocity aberration: See :ref:`velocity-aberration` for a +general discussion. As discussed, the aberration can introduce an up-to +one-fifth of an arcsec change across the FOV for any particular detector. + +The scale factor can be specified, or the simulator can calculate one. Though +the exact orbit of Roman is unknown, it will be orbiting around the L2 point, as +Webb does. The predominant velocity is very similar to that of Earth's at this +point, so Earth is used, using a scale factor increase 1.01 to approximate the +L2 orbit. + +In the simulator, there is an additional uncertainty introduced by including +velocity aberration correction. On-orbit, the scale is calculated from the +reference point of each detector. However, the simulator does not calculate a +separate WCS for each detector, but computes a single WCS for the FOV of all the +detectors, centered either on the boresight or the center of the full WFI, +WFI_CEN. As a result, the velocity aberration can introduce ~10^-6 arcsec +effect. Below shows a typical error vector across a detector. + +.. image:: ff_va_WFI02.png .. automodapi:: romanisim.wcs diff --git a/pyproject.toml b/pyproject.toml index 2bf6fd8..3efd043 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,8 @@ dependencies = [ # "rad >=0.19.2", # "roman_datamodels >=0.19.1", "rad @ git+https://github.com/spacetelescope/rad.git", - "roman_datamodels @ git+https://github.com/spacetelescope/roman_datamodels.git", + # "roman_datamodels @ git+https://github.com/spacetelescope/roman_datamodels.git", + "roman_datamodels @ git+https://github.com/stscieisenhamer/roman_datamodels.git@rcal-853-velocity", "gwcs >=0.19.0", "jsonschema >=4.8", "numpy >=1.22", diff --git a/romanisim/image.py b/romanisim/image.py index 59cfc88..a7ffbf5 100644 --- a/romanisim/image.py +++ b/romanisim/image.py @@ -879,10 +879,6 @@ def make_asdf(slope, slopevar_rn, slopevar_poisson, metadata=None, # ref_file: conceptually sound when we work from crds reference # files # target: can push forward from APT file - # velocity_aberration: I guess to first order, - # ignore the detailed orbit around L2 and just project - # the earth out to L2, and use that for the velocity - # aberration? Don't do until someone asks. # visit: start_time, end_time, total_exposures, ...? # wcsinfo: v2_ref, v3_ref, vparity, v3yangle, ra_ref, dec_ref # roll_ref, s_region diff --git a/romanisim/parameters.py b/romanisim/parameters.py index d2d70e5..69f9865 100644 --- a/romanisim/parameters.py +++ b/romanisim/parameters.py @@ -161,6 +161,14 @@ 'detector': 'WFI07', 'optical_element': 'F184', }, + 'ephemeris': {'time': Time('2026-01-01').mjd, + 'spatial_x': 0., + 'spatial_y': 0., + 'spatial_z': 0., + 'velocity_x': 0., + 'velocity_y': 0., + 'velocity_z': 0. + }, 'exposure': {'start_time': Time('2026-01-01T00:00:00'), 'type': 'WFI_IMAGE', 'ma_table_number': 4, @@ -171,7 +179,10 @@ 'target_dec': 66.0, 'target_aperture': 'WFI_CEN', }, - 'wcsinfo': {'ra_ref': 270.0, + 'velocity_aberration': {'scale_factor': 1.0}, + 'wcsinfo': {'aperture_name': 'WFI_CEN', + 'pa_aperture': 0., + 'ra_ref': 270.0, 'dec_ref': 66.0, 'v2_ref': 0, 'v3_ref': 0, diff --git a/romanisim/ris_make_utils.py b/romanisim/ris_make_utils.py index 576c95c..ff7b347 100755 --- a/romanisim/ris_make_utils.py +++ b/romanisim/ris_make_utils.py @@ -10,12 +10,14 @@ from astropy import table from astropy import time from astropy import coordinates +from astropy import units as u import galsim from galsim import roman import roman_datamodels from roman_datamodels import stnode from romanisim import catalog, image, wcs from romanisim import parameters, log +from romanisim.util import calc_scale_factor import romanisim NMAP = {'apt': 'http://www.stsci.edu/Roman/APT'} @@ -46,7 +48,7 @@ def merge_nested_dicts(dict1, dict2): def set_metadata(meta=None, date=None, bandpass='F087', sca=7, - ma_table_number=4, truncate=None): + ma_table_number=4, truncate=None, scale_factor=1.0): """ Set / Update metadata parameters @@ -62,6 +64,8 @@ def set_metadata(meta=None, date=None, bandpass='F087', sca=7, Integer identifier of the detector to simulate (starting at 1) ma_table_number : int Integer specifying which MA Table entry to use + scale_factor : float + Velocity aberration-induced scale factor Returns ------- @@ -90,6 +94,23 @@ def set_metadata(meta=None, date=None, bandpass='F087', sca=7, else: meta['exposure']['truncated'] = False + # Velocity aberration + if scale_factor <= 0.: + scale_factor = calc_scale_factor(meta['exposure']['start_time'], meta['wcsinfo']['ra_ref'], meta['wcsinfo']['dec_ref']) + meta['velocity_aberration']['scale_factor'] = scale_factor + + # Fill out some ephemeris information, presuming all is earth. + position, velocity = coordinates.get_body_barycentric_posvel('earth', meta['exposure']['start_time']) + position = position.xyz.to(u.km) + velocity = velocity.xyz.to(u.km / u.s) + meta['ephemeris']['time'] = meta['exposure']['start_time'].mjd + meta['ephemeris']['spatial_x'] = position.value[0] + meta['ephemeris']['spatial_y'] = position.value[1] + meta['ephemeris']['spatial_z'] = position.value[2] + meta['ephemeris']['velocity_x'] = velocity.value[0] + meta['ephemeris']['velocity_y'] = velocity.value[1] + meta['ephemeris']['velocity_z'] = velocity.value[2] + return meta diff --git a/romanisim/tests/test_wcs.py b/romanisim/tests/test_wcs.py index 1f63a6e..c9ed3a9 100644 --- a/romanisim/tests/test_wcs.py +++ b/romanisim/tests/test_wcs.py @@ -98,7 +98,7 @@ def test_wcs(): # should be close to the reference v2 & v3 offset. assert np.abs(cc3.separation(cc4).to(u.arcsec).value - np.hypot(*parameters.v2v3_wficen)) < 1 - metadata = dict(pointing=dict(), instrument=dict(), wcsinfo=dict()) + metadata = dict(pointing=dict(), instrument=dict(), wcsinfo=dict(), velocity_aberration=dict()) metadata['instrument']['detector'] = 'WFI01' util.update_pointing_and_wcsinfo_metadata(metadata, wcs.GWCS(gwcs)) assert metadata['wcsinfo']['aperture_name'] == 'WFI01_FULL' @@ -149,3 +149,25 @@ def test_wcs_crds_match(): # Expect a GWCS object as opposed to a dictionary assert type(twcs) is wcs.GWCS + + +def test_scale_factor(): + """Test that specifying a scale factor actually calculates a new wcs""" + + # Truth aiming for. + cc = SkyCoord(ra=0 * u.deg, dec=0 * u.deg) + scale_factor = 1.1 + truth = SkyCoord([(0. , 0. ), (0.03361111, 0.0336111 ), + (0.0672222 , 0.06722216), (0.10083325, 0.10083312), + (0.13444424, 0.13444393)], + unit='deg') + + # Make a simple grid of pixel coordinates to calculate sky for + grid = range(0, 4096, 1000) + + # Create the wcs and generate results + distortion = make_fake_distortion_function() + gwcs = wcs.make_wcs(cc, distortion, scale_factor=scale_factor) + sky = gwcs.pixel_to_world(grid, grid) + + assert all(truth.separation(sky).to(u.arcsec).value < 1e-3) diff --git a/romanisim/util.py b/romanisim/util.py index 8d1ac98..1528136 100644 --- a/romanisim/util.py +++ b/romanisim/util.py @@ -2,15 +2,33 @@ """ import numpy as np -from astropy.coordinates import SkyCoord +from astropy.coordinates import SkyCoord, get_body_barycentric_posvel from astropy import units as u from astropy.time import Time import galsim import gwcs as gwcsmod from romanisim import parameters, wcs, bandpass +from romanisim.velocity_aberration import compute_va_effects from scipy import integrate +__all__ = ["skycoord", + "celestialcoord", + "scalergb", + "random_points_in_cap", + "random_points_in_king", + "random_points_at_radii", + "add_more_metadata", + "update_pointing_and_wcsinfo_metadata", + "king_profile", + "sample_king_distances", + "decode_context_times", + "default_image_meta", + "update_photom_keywords", + "merge_dicts", + "calc_scale_factor", +] + def skycoord(celestial): """Turn a CelestialCoord into a SkyCoord. @@ -252,7 +270,7 @@ def update_pointing_and_wcsinfo_metadata(metadata, gwcs): v2v3 = distortion(*center) radec = gwcs(*center) t2sky = gwcs.get_transform('v2v3', 'world') - radecn = t2sky(v2v3[0], v2v3[1] + 1) + radecn = t2sky(v2v3[0], v2v3[1] + 100) roll_ref = ( SkyCoord(radec[0] * u.deg, radec[1] * u.deg).position_angle( SkyCoord(radecn[0] * u.deg, radecn[1] * u.deg))) @@ -282,6 +300,10 @@ def update_pointing_and_wcsinfo_metadata(metadata, gwcs): pa_v3 = pa_v3.to(u.deg).value metadata['pointing']['pa_v3'] = pa_v3 + # Update velocity aberration meta for the reference point + metadata['velocity_aberration']['ra_reference'] = radec[0] + metadata['velocity_aberration']['dec_reference'] = radec[1] + def king_profile(r, rc, rt): """Compute the King profile. @@ -539,3 +561,34 @@ def merge_dicts(a, b): else: a[key] = b[key] return a + + +def calc_scale_factor(date, ra, dec): + """Calculate velocity aberration scale factor + + The L2 orbit is just a delta on the Earth's orbit. At the moment, there is no ephemeris for + Roman yet, the Earth's barycentric velocity is used to calculate velocity aberration. A scale + of 1.01 is applied to the velocity to scale, approximately, to what would be Roman's velocity. + + Parameters + ---------- + date : str or astropy.Time + The date at which to calculate the velocity. + + ra, dec: float + The right ascension and declination of the target (or some other + point, such as the center of a detector) in the barycentric coordinate + system. The equator and equinox should be the same as the coordinate + system for the velocity. In degrees. + + Returns + ------- + scale_factor : float + The velocity aberration scale factor + """ + _, velocity = get_body_barycentric_posvel('earth', date) + velocity = 1.01 * velocity # Move from earth to Roman. + xyz_velocity = velocity.xyz.to(u.km / u.s) + scale_factor, _, _ = compute_va_effects(*xyz_velocity.value, ra, dec) + + return scale_factor diff --git a/romanisim/velocity_aberration.py b/romanisim/velocity_aberration.py new file mode 100644 index 0000000..93b209e --- /dev/null +++ b/romanisim/velocity_aberration.py @@ -0,0 +1,89 @@ +"""Calculate velocity aberration based on velocities""" +import numpy as np +from gwcs.geometry import SphericalToCartesian, CartesianToSpherical +from scipy.constants import speed_of_light + +from romanisim import log + +SPEED_OF_LIGHT = speed_of_light / 1000 # km / s + + +def compute_va_effects_vector(velocity_x, velocity_y, velocity_z, u): + """ Computes constant scale factor due to velocity aberration as well as + corrected ``RA`` and ``DEC`` values, in vector form + + Parameters + ---------- + velocity_x, velocity_y, velocity_z : float + The components of the orbital velocity. These are celestial coordinates, with x toward the + vernal equinox, y toward right ascension 90 degrees and declination + 0, z toward the north celestial pole. + + u : numpy.array([u0, u1, u2]) + The vector form of right ascension and declination of the target (or some other + point, such as the center of a detector) in the barycentric coordinate + system. The equator and equinox should be the same as the coordinate + system for the velocity. + + Returns + ------- + scale_factor: float + Multiply the nominal image scale (e.g. in degrees per pixel) by + this value to obtain the image scale corrected for the "aberration + of starlight" due to the velocity of JWST with respect to the Sun. + + u_corr : numpy.array([ua0, ua1, ua2]) + Apparent position vector in the moving telescope frame. + """ + beta = np.array([velocity_x, velocity_y, velocity_z]) / SPEED_OF_LIGHT + beta2 = np.dot(beta, beta) # |beta|^2 + if beta2 == 0.0: + log.warning('Observatory speed is zero. Setting VA scale to 1.0') + return 1.0, u + + u_beta = np.dot(u, beta) + igamma = np.sqrt(1.0 - beta2) # inverse of usual gamma + scale_factor = (1.0 + u_beta) / igamma + + # Algorithm below is from Colin Cox notebook. + # Also see: Instrument Science Report OSG-CAL-97-06 by Colin Cox (1997). + u_corr = (igamma * u + beta * (1.0 + (1.0 - igamma) * u_beta / beta2)) / (1.0 + u_beta) + + return scale_factor, u_corr + + +def compute_va_effects(velocity_x, velocity_y, velocity_z, ra, dec): + """ Computes constant scale factor due to velocity aberration as well as + corrected ``RA`` and ``DEC`` values. + + Parameters + ---------- + velocity_x, velocity_y, velocity_z: float + The components of the velocity. These are celestial coordinates, with x toward the + vernal equinox, y toward right ascension 90 degrees and declination + 0, z toward the north celestial pole. + + ra, dec: float + The right ascension and declination of the target (or some other + point, such as the center of a detector) in the barycentric coordinate + system. The equator and equinox should be the same as the coordinate + system for the velocity. In degrees + + Returns + ------- + scale_factor: float + Multiply the nominal image scale (e.g. in degrees per pixel) by + this value to obtain the image scale corrected for the "aberration + of starlight" due to the velocity of JWST with respect to the Sun. + + apparent_ra: float + Apparent star position in the moving telescope frame. + + apparent_dec: float + Apparent star position in the moving telescope frame. + + """ + u = np.asanyarray(SphericalToCartesian()(ra, dec)) + scale_factor, u_corr = compute_va_effects_vector(velocity_x, velocity_y, velocity_z, u) + apparent_ra, apparent_dec = CartesianToSpherical()(*u_corr) + return scale_factor, apparent_ra, apparent_dec diff --git a/romanisim/wcs.py b/romanisim/wcs.py index f547730..59e9f5d 100644 --- a/romanisim/wcs.py +++ b/romanisim/wcs.py @@ -142,7 +142,8 @@ def get_wcs(image, usecrds=True, distortion=None): wcs = make_wcs(util.skycoord(world_pos), distortion, v2_ref=image_mod.meta.wcsinfo.v2_ref, v3_ref=image_mod.meta.wcsinfo.v3_ref, - roll_ref=image_mod.meta.wcsinfo.roll_ref) + roll_ref=image_mod.meta.wcsinfo.roll_ref, + scale_factor=image_mod.meta.velocity_aberration.scale_factor) shape = image_mod.data.shape wcs.bounding_box = ((-0.5, shape[-1] - 0.5), (-0.5, shape[-2] - 0.5)) wcs = GWCS(wcs) @@ -165,6 +166,7 @@ def make_wcs(targ_pos, v3_ref=0, wrap_v2_at=180, wrap_lon_at=360, + scale_factor=1.0, ): """Create a gWCS from a target position, a roll, and a distortion map. @@ -188,6 +190,9 @@ def make_wcs(targ_pos, v3_ref : float The v3 coordinate (arcsec) corresponding to targ_pos + scale_factor : float + The scale factor induced by velocity aberration + Returns ------- gwcs.wcs object representing WCS for observation @@ -223,11 +228,21 @@ def make_wcs(targ_pos, unit=(u.pix, u.pix)) v2v3 = cf.Frame2D(name="v2v3", axes_order=(0, 1), axes_names=("v2", "v3"), unit=(u.arcsec, u.arcsec)) + v2v3vacorr = cf.Frame2D(name='v2v3vacorr', axes_order=(0, 1), + axes_names=('v2', 'v3'), unit=(u.arcsec, u.arcsec)) world = cf.CelestialFrame(reference_frame=astropy.coordinates.ICRS(), name='world') + # Compute differential velocity aberration (DVA) correction: + va_corr = dva_corr_model( + va_scale=scale_factor, + v2_ref=v2_ref, + v3_ref=v3_ref + ) + pipeline = [gwcs.wcs.Step(detector, distortion), - gwcs.wcs.Step(v2v3, tel2sky), + gwcs.wcs.Step(v2v3, va_corr), + gwcs.wcs.Step(v2v3vacorr, tel2sky), gwcs.wcs.Step(world, None)] return gwcs.wcs.WCS(pipeline) @@ -474,7 +489,7 @@ def create_tangent_plane_gwcs(center, scale, center_coord): pixel scale (arcsec) center_coord : SkyCoord or CelestialCoord coordinates of center pixel - + Returns ------- GWCS object corresponding to tangent plane projection @@ -526,3 +541,62 @@ def create_s_region(wcs, shape=None): rd = np.array([[r, d] for r, d in zip(racorn, deccorn)]) s_region = "POLYGON ICRS " + " ".join([str(x) for x in rd.ravel()]) return s_region + + +def dva_corr_model(va_scale, v2_ref, v3_ref): + """ + Create transformation that accounts for differential velocity aberration + (scale). + + Parameters + ---------- + va_scale : float, None + Ratio of the apparent plate scale to the true plate scale. When + ``va_scale`` is `None`, it is assumed to be identical to ``1`` and + an ``astropy.modeling.models.Identity`` model will be returned. + + v2_ref : float, None + Telescope ``v2`` coordinate of the reference point in ``arcsec``. When + ``v2_ref`` is `None`, it is assumed to be identical to ``0``. + + v3_ref : float, None + Telescope ``v3`` coordinate of the reference point in ``arcsec``. When + ``v3_ref`` is `None`, it is assumed to be identical to ``0``. + + Returns + ------- + va_corr : astropy.modeling.CompoundModel, astropy.modeling.models.Identity + A 2D compound model that corrects DVA. If ``va_scale`` is `None` or 1 + then `astropy.modeling.models.Identity` will be returned. + + """ + if va_scale is None or va_scale == 1: + return models.Identity(2) + + if va_scale <= 0: + raise ValueError("'Velocity aberration scale must be a positive number.") + + va_corr = models.Scale(va_scale, name="dva_scale_v2") & models.Scale( + va_scale, name="dva_scale_v3" + ) + + if v2_ref is None: + v2_ref = 0 + + if v3_ref is None: + v3_ref = 0 + + if v2_ref == 0 and v3_ref == 0: + return va_corr + + # NOTE: it is assumed that v2, v3 angles and va scale are small enough + # so that for expected scale factors the issue of angle wrapping + # (180 degrees) can be neglected. + v2_shift = (1 - va_scale) * v2_ref + v3_shift = (1 - va_scale) * v3_ref + + va_corr |= models.Shift(v2_shift, name="dva_v2_shift") & models.Shift( + v3_shift, name="dva_v3_shift" + ) + va_corr.name = "DVA_Correction" + return va_corr diff --git a/scripts/romanisim-make-image b/scripts/romanisim-make-image index 59da4da..3250162 100755 --- a/scripts/romanisim-make-image +++ b/scripts/romanisim-make-image @@ -39,7 +39,7 @@ def go(args): metadata = ris.set_metadata( date=args.date, bandpass=args.bandpass, sca=args.sca, ma_table_number=args.ma_table_number, - truncate=args.truncate) + truncate=args.truncate, scale_factor=args.scale_factor) if args.radec is not None: coord = SkyCoord(ra=args.radec[0] * u.deg, dec=args.radec[1] * u.deg, @@ -106,6 +106,8 @@ if __name__ == '__main__': 'are updated to be grism / prism.')) parser.add_argument('--drop-extra-dq', default=False, action='store_true', help=('Do not store the optional simulated dq array.')) + parser.add_argument('--scale-factor', type=float, default=-1., + help=('Velocity aberration-induced scale factor. If negative, use given time to calculated based on orbit ephemeris.')) args = parser.parse_args()