class adjustWCSToReferenceConfig(config.Config): suffix = config.Field("Filename suffix", str, "_wcsCorrected", optional=True) method = config.ChoiceField("Alignment method", str, allowed={ "header": "Use WCS in header", "sources": "Match sources in images" }, default="sources") fallback = config.ChoiceField("Fallback method", str, allowed={"header": "Use WCS in header"}, default="header", optional=True) first_pass = config.RangeField( "Search radius for source matching (arcseconds)", float, 5., min=0) min_sources = config.RangeField( "Minimum number of sources required to use source matching", int, 3, min=1) cull_sources = config.Field("Use only point sources for alignment?", bool, False) rotate = config.Field("Allow rotation for alignment?", bool, False) scale = config.Field("Allow magnification for alignment?", bool, False)
class removePatternNoiseConfig(config.Config): suffix = config.Field("Filename suffix", str, "_patternNoiseRemoved", optional=True) force = config.Field("Force cleaning even if noise increases?", bool, False) hsigma = config.RangeField("High rejection threshold (sigma)", float, 3., min=0) lsigma = config.RangeField("Low rejection threshold (sigma)", float, 3., min=0) pattern_x_size = config.RangeField("Pattern x size (pixels)", int, 16, min=4) pattern_y_size = config.RangeField("Pattern y size (pixels)", int, 4, min=4) subtract_background = config.Field( "Subtract median from each pattern box?", bool, True)
class makeBPMConfig(config.Config): override_thresh = config.ChoiceField( "Apply user-specified thresholds, overriding any default calculation?", bool, {True: 'Must be True where no default algorithm is implemented'}, default=True, optional=False) dark_lo_thresh = config.Field("Low rejection threshold for dark (ADU)", float, None, optional=True) dark_hi_thresh = config.Field("High rejection threshold for dark (ADU)", float, None, optional=True) flat_lo_thresh = config.RangeField( "Low rejection threshold for normalized flat", float, None, max=1.0, optional=True) flat_hi_thresh = config.RangeField( "High rejection threshold for normalized flat", float, None, min=1.0, optional=True) def validate(self): config.Config.validate(self) if self.dark_lo_thresh is not None and \ self.dark_hi_thresh is not None and \ self.dark_lo_thresh >= self.dark_hi_thresh: raise ValueError( "dark_hi_thresh must be greater than dark_lo_thresh")
class rejectInputsConfig(config.Config): at_start = config.RangeField( "Number of files to remove from start of list", int, 0, min=0) at_end = config.RangeField("Number of files to remove from end of list", int, 0, min=0)
class extract1DSpectraConfig(config.Config): suffix = config.Field("Filename suffix", str, "_extracted", optional=True) method = config.ChoiceField("Extraction method", str, allowed={ "standard": "no weighting", "weighted": "inverse-variance weighted", "optimal": "optimal extraction" }, default="standard") width = config.RangeField("Width of extraction aperture (pixels)", float, None, min=1, optional=True) grow = config.RangeField("Source aperture avoidance region (pixels)", float, 10, min=0, optional=True) subtract_sky = config.Field( "Subtract sky spectra if the data have not been sky corrected?", bool, True) debug = config.Field("Draw extraction apertures on image display?", bool, False)
class applyDQPlaneConfig(config.Config): suffix = config.Field("Filename suffix", str, "_dqPlaneApplied", optional=True) replace_flags = config.RangeField("DQ bitmask for pixels to replace", int, 65529, min=0) replace_value = config.Field("Replacement value [mean|median|<value>]", (str, float), "median", check=replace_valueCheck) inner = config.RangeField("Inner filter radius (pixels)", float, None, min=1, optional=True) outer = config.RangeField("Outer filter radius (pixels)", float, None, min=1, optional=True) max_iters = config.RangeField("Maximum number of iterations", int, 1, min=1) def validate(self): config.Config.validate(self) if self.inner is not None and self.outer is not None and self.outer < self.inner: raise ValueError("Outer radius must be larger than inner radius")
class resampleToCommonFrameConfig(config.Config): suffix = config.Field("Filename suffix", str, "_align", optional=True) w1 = config.RangeField("Starting wavelength (nm)", float, None, min=0., optional=True) w2 = config.RangeField("Ending wavelength (nm)", float, None, min=0., optional=True) dw = config.RangeField("Dispersion (nm/pixel)", float, None, min=0.01, optional=True) npix = config.RangeField("Number of pixels in spectrum", int, None, min=2, optional=True) conserve = config.Field("Conserve flux?", bool, False) order = config.RangeField("Order of interpolation", int, 1, min=0, max=5) trim_data = config.Field("Trim to field of view of reference image?", bool, False) def validate(self): config.Config.validate(self) if [self.w1, self.w2, self.dw, self.npix].count(None) == 0: raise ValueError("Maximum 3 of w1, w2, dw, npix must be specified") if self.w1 is not None and self.w2 is not None and self.w2 <= self.w1: raise ValueError( "Ending wavelength must be greater than starting wavelength")
class linearizeSpectraConfig(config.Config): suffix = config.Field("Filename suffix", str, "_linearized", optional=True) w1 = config.RangeField("Starting wavelength (nm)", float, None, min=0., optional=True) w2 = config.RangeField("Ending wavelength (nm)", float, None, min=0., optional=True) dw = config.RangeField("Dispersion (nm/pixel)", float, None, min=0.01, optional=True) npix = config.RangeField("Number of pixels in spectrum", int, None, min=2, optional=True) conserve = config.Field("Conserve flux?", bool, False) def validate(self): config.Config.validate(self) if [self.w1, self.w2, self.dw, self.npix].count(None) not in (1, 4): raise ValueError( "Exactly 0 or 3 of w1, w2, dw, npix must be specified") if self.w1 is not None and self.w2 is not None and self.w2 <= self.w1: raise ValueError( "Ending wavelength must be greater than starting wavelength")
class normalizeFlatConfig(config.core_1Dfitting_config): suffix = config.Field("Filename suffix", str, "_normalized", optional=True) center = config.RangeField("Central row/column to extract", int, None, min=1, optional=True) nsum = config.RangeField("Number of lines to sum", int, 10, min=1) def setDefaults(self): self.order = 20
class subtractOverscanConfig(config.core_1Dfitting_config): suffix = config.Field("Filename suffix", str, "_overscanSubtracted", optional=True) function = config.ChoiceField("Fitting function", str, allowed={ "none": "Row-by-row values", "spline3": "Cubic spline", "chebyshev": "Chebyshev polynomial" }, default="spline3", optional=False) order = config.RangeField("Order of fitting function", int, None, min=0, optional=True) nbiascontam = config.RangeField( "Number of columns to exclude from averaging", int, 0, min=0) def validate(self): config.Config.validate(self) if self.function == "poly" and self.order is None: raise ValueError("Polynomial order must be specified") if self.function == "spline" and self.order == 0: raise ValueError("Must specify a positive spline order, or None")
class associateSkyConfig(config.Config): suffix = config.Field("Filename suffix", str, "_skyAssociated", optional=True) time = config.RangeField("Maximum association time (seconds)", float, 600., min=0) distance = config.RangeField("Minimum association distance (arcsec)", float, 3., min=0) min_skies = config.RangeField("Minimum number of sky frames to associate", int, 3, min=0, optional=True) max_skies = config.RangeField("Maximum number of sky frames to associate", int, None, min=1, optional=True) use_all = config.Field("Use all frames as skies?", bool, False)
class flagCosmicRaysByStackingConfig(config.Config): suffix = config.Field("Filename suffix", str, "_CRMasked", optional=True) hsigma = config.RangeField("High rejection threshold (sigma)", float, 7., min=0) dilation = config.RangeField("CR dilation radius (pixels)", float, 1., min=0)
class thresholdFlatfieldConfig(config.Config): suffix = config.Field("Filename suffix", str, "_thresholdFlatfielded", optional=True) upper = config.RangeField("Upper limit of valid pixels", float, 10., min=1) lower = config.RangeField("Lower limit of valid pixels", float, 0.01, max=1)
class distortionCorrectConfig(config.Config): suffix = config.Field("Filename suffix", str, "_distortionCorrected", optional=True) arc = config.ListField("Arc(s) with distortion map", (AstroData, str), None, optional=True, single=True) order = config.RangeField("Interpolation order", int, 3, min=0, max=5) subsample = config.RangeField("Subsampling", int, 1, min=1)
class applyStackedObjectMaskConfig(config.Config): suffix = config.Field("Filename suffix", str, "_stackedObjMaskApplied", optional=True) source = config.Field("Stream containing stacked image", str, None) order = config.RangeField("Order of interpolation", int, 1, min=0, max=5) threshold = config.RangeField("Threshold for flagging pixels", float, 0.01, min=0., max=1.)
class skyCorrectFromSlitConfig(config.Config): suffix = config.Field("Filename suffix", str, "_skyCorrected", optional=True) order = config.RangeField("Sky spline fitting order", int, 5, min=1, optional=True) grow = config.RangeField("Aperture growth distance (pixels)", float, 0, min=0)
class detectSourcesConfig(config.Config): suffix = config.Field("Filename suffix", str, "_sourcesDetected", optional=True) mask = config.Field("Replace DQ-flagged pixels with median of image?", bool, False) replace_flags = config.RangeField("DQ bitmask for flagging if mask=True", int, 249, min=0) set_saturation = config.Field("Inform SExtractor of saturation level?", bool, False) detect_minarea = config.RangeField( "Minimum object detection area (pixels)", int, 8, min=1) detect_thresh = config.RangeField( "Detection threshold (standard deviations)", float, 2., min=0.1) analysis_thresh = config.RangeField( "Analysis threshold (standard deviations)", float, 2., min=0.1) deblend_mincont = config.RangeField("Minimum deblending contrast", float, 0.005, min=0.) phot_min_radius = config.RangeField( "Minimum radius for photometry (pixels)", float, 3.5, min=1.0) back_size = config.RangeField("Background mesh size (pixels)", int, 32, min=1) back_filtersize = config.RangeField("Filtering scale for background", int, 8, min=1)
class addOIWFSToDQConfig(config.Config): suffix = config.Field("Filename suffix", str, "_oiwfsDqAdded", optional=True) contrast = config.RangeField("Fractional decrease in sky level", float, 0.2, min=0.001, max=1.) convergence = config.RangeField( "Convergence required in sky level to stop dilation", float, 2.0, min=0.001)
class addIllumMaskToDQConfig(parameters_standardize.addIllumMaskToDQConfig): shift = config.RangeField("User-defined shift for illumination mask", int, None, min=-100, max=100, inclusiveMax=True, optional=True) max_shift = config.RangeField( "Maximum (unbinned) pixel shift for illumination mask", int, 20, min=0, max=100, inclusiveMax=True)
class resampleToCommonFrameConfig(config.Config): suffix = config.Field("Filename suffix", str, "_align", optional=True) order = config.RangeField("Order of interpolation", int, 1, min=0, max=5) trim_data = config.Field("Trim to field of view of reference image?", bool, False) clean_data = config.Field("Clean bad pixels before interpolation?", bool, False)
class calculateSensitivityConfig(config.Config): suffix = config.Field("Filename suffix", str, "_sensitivityCalculated", optional=True) filename = config.Field("Name of spectrophotometric data file", str, None, optional=True) order = config.RangeField("Order of spline fit", int, 6, min=1) bandpass = config.RangeField("Bandpass width (nm) if not suuplied", float, 5., min=0.1, max=10.) debug_plot = config.Field("Plot sensitivity curve?", bool, False)
class adjustWCSToReferenceConfig(config.Config): suffix = config.Field("Filename suffix", str, "_wcsCorrected", optional=True) method = config.ChoiceField("Alignment method", str, allowed={ "sources_wcs": "Match sources using WCS", "sources_offsets": "Match sources using telescope offsets", "offsets": "Use telescope offsets only" }, default="sources_wcs") fallback = config.ChoiceField("Fallback method", str, allowed={ "sources_offsets": "Match sources using telescope offsets", "offsets": "Use telescope offsets only" }, default="offsets", optional=True) tolerance = config.RangeField( "Maximum distance from the header offset, " "for the correlation method (arcsec)", float, 1, min=0., optional=True)
class getListConfig(config.Config): purpose = config.Field("Purpose of list", str, None, optional=True) max_frames = config.RangeField("Maximum number of frames", int, None, min=1, optional=True)
class addLatencyToDQConfig(config.Config): suffix = config.Field("Filename suffix", str, "_latencyAdded", optional=True) non_linear = config.Field("Flag non-linear pixels?", bool, False) time = config.RangeField("Persistence time (seconds)", float, 120., min=0.)
class resampleToCommonFrameConfig( parameters_resample.resampleToCommonFrameConfig): pixel_scale = config.RangeField( "Output pixel scale (arcseconds) if no reference provided", float, 0.02, min=0.01, max=1.0) pa = config.RangeField( "Output position angle (E of N) if no reference provided", float, 0.0, min=-180, max=360) def setDefaults(self): self.force_affine = False
class findSourceAperturesConfig(config.Config): suffix = config.Field("Filename suffix", str, "_aperturesFound", optional=True) max_apertures = config.RangeField("Maximum number of sources to find", int, None, min=1, optional=True) percentile = config.RangeField( "Percentile to determine signal for each spatial pixel", float, 95, min=1, max=100, optional=True) section = config.Field( "Pixel section(s) for measuring the spatial profile", str, None, optional=True, check=check_section) min_sky_region = config.RangeField( "Minimum number of contiguous pixels " "between sky lines", int, 20, min=1) use_snr = config.Field( "Use signal-to-noise ratio rather than data to find peaks?", bool, True) threshold = config.RangeField( "Threshold for automatic width determination", float, 0.01, min=0, max=1) sizing_method = config.ChoiceField( "Method for automatic width determination", str, allowed={ "peak": "height relative to peak", "integral": "integrated flux" }, default="peak")
class normalizeFlatConfig(config.Config): suffix = config.Field("Filename suffix", str, "_normalized", optional=True) spectral_order = config.Field("Fitting order in spectral direction", (int, str), 20, check=flat_order_check) threshold = config.RangeField( "Threshold for flagging unilluminated pixels", float, 0.01, min=0) hsigma = config.RangeField("High rejection threshold (sigma)", float, 3., min=0) lsigma = config.RangeField("Low rejection threshold (sigma)", float, 3., min=0) grow = config.RangeField("Growth radius for bad pixels", int, 0, min=0)
class determineAstrometricSolutionConfig(config.Config): suffix = config.Field("Filename suffix", str, "_astrometryCorrected", optional=True) initial = config.RangeField( "Search radius for cross-correlation (arcseconds)", float, 5., min=1) final = config.RangeField("Search radius for object matching (arcseconds)", float, 1., min=0) # None => False if 'qa' in mode else True full_wcs = config.Field( "Recompute positions using full WCS rather than offsets?", bool, None, optional=True)
class dilateObjectMaskConfig(config.Config): suffix = config.Field("Filename suffix", str, "_objmaskDilated", optional=True) dilation = config.RangeField("Dilation radius (pixels)", float, 1., min=0) repeat = config.Field("Allow dilation of already-dilated image?", bool, False)
class calculateSensitivityConfig(config.core_1Dfitting_config): suffix = config.Field("Filename suffix", str, "_sensitivityCalculated", optional=True) filename = config.Field("Name of spectrophotometric data file", str, None, optional=True) bandpass = config.RangeField("Bandpass width (nm) if not supplied", float, 5., min=0.1, max=10.) debug_airmass0 = config.Field("Calculate sensitivity curve at zero airmass?", bool, False) regions = config.Field("Sample regions", str, None, optional=True, check=validate_regions_float) debug_plot = config.Field("Plot sensitivity curve?", bool, False) interactive_spline = config.Field("Interactive spline selection?", bool, False) niter = config.RangeField("Maximum number of clipping iterations to perform of spline fit", int, 3, min=1) grow = config.RangeField("Radius to reject pixels adjacent to masked pixels of spline fit", int, 0, min=0) interactive = config.Field("Display interactive fitter?", bool, False) def setDefaults(self): del self.grow