Step Arguments
The wfss_contam step uses the following optional arguments.
--save_simulated_imageA boolean indicating whether the full-frame simulated grism image containing all simulated spectra within the field-of-view should be saved to a file. The file name uses a product type suffix of “simul”. Defaults to
False.--save_contam_imagesA boolean indicating whether the estimated contamination images for each source cutout should be saved to a file. The file name uses a product type suffix of “contam”. The resulting file has one SCI extension for each source contained in the input grism image. Defaults to
False.--maximum_coresThe number of available cores that will be used for multi-processing in this step. The default value is ‘1’, which does not use multi-processing. The other options are either an integer, ‘quarter’, ‘half’, or ‘all’. Note that these fractions refer to the total available cores and on most CPUs these include physical and virtual cores.
--ordersA list indicating which grism orders to simulate. The default value is None, which means all orders that are defined in the wavelength and specwcs reference files for that instrument will be simulated. To specify a single order from the command line, use e.g. “0,” or “1,” (the comma allows the code to identify this as a list).
--magnitude_limitA float indicating the magnitude limit for sources to be included in the simulation. The magnitude limit is taken from the input source catalog’s isophotal AB magnitude column. The limit is scaled according to the relative sensitivity of each spectral order, such that fewer sources are included in orders with lower sensitivity. The default value is None, which means no magnitude limit is applied to any of the orders and all sources are included.
--wl_oversampleIndicates the oversampling factor for the wavelength grid used in the simulation of the dispersed spectra. Defaults to 2.
--max_pixels_per_chunkSets the maximum number of direct image pixels to run through the grism transforms at once. Decreasing this value will typically reduce the memory usage of the step. The effect on runtime depends on the machine hardware and whether multi-processing is enabled. Defaults to 5,000.
Polynomial fitting parameters
--polyfit_degreeAn integer specifying the maximum degree of the polynomial used to fit the spectral shape of each source before computing the contamination estimate. If
None(the default), no polynomial fitting is applied and the direct image flux values are used as-is (i.e., a “flat” spectrum).--n_iterationsAn integer specifying the number of contamination-correction iterations to perform. On each iteration the contamination estimate is recomputed using the flux-modeled spectra from the previous iteration. Defaults to 1 (a single, non-iterative correction). Has no effect if
polyfit_degreeisNone.--l2_alphaA float specifying the alpha parameter for L2 regularization in the polynomial fitting. This is used to prevent the fitted coefficients from blowing up in cases of severe contamination. Default is 0.1.
--rejection_thresholdA float specifying a threshold for rejecting polynomial fits based on the fitted constant term coefficient. If the absolute value of that coefficient deviates from unity by more than this threshold, the fit is rejected and the contamination estimate for that source is not updated on that iteration. This is used to avoid fits “blowing up” in cases where the polynomial fit has returned an unphysical total flux level, which typically occurs if background subtraction was imperfect or if the source sits in a highly contaminated region. If set to None, no rejection will be performed. Default is 0.1.