def plot(self, dtables, figs, **kwargs): """Plot the summary data from the PTC analyses Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) sumtable = dtables['ptc_sum'] runtable = dtables['runs'] yvals = sumtable['gain'].flatten().clip(0., 2.) yerrs = sumtable['gain_error'].flatten().clip(0., 0.5) runs = runtable['runs'] figs.plot_run_chart("ptc-gain", runs, yvals, yerrs=yerrs, ylabel="Gain") EO_TASK_FACTORY.add_task_class('PTC', PTCTask) EO_TASK_FACTORY.add_task_class('PTCStats', PTCStatsTask) EO_TASK_FACTORY.add_task_class('PTCSummary', PTCSummaryTask)
_DefaultName = "SuperbiasStabilityTask" iteratorClass = SummaryAnalysisBySlotIterator def __init__(self, **kwargs): """C'tor Parameters ---------- kwargs Used to override configruation """ SuperbiasTask.__init__(self, **kwargs) @staticmethod def get_input_files(data): """Get the input files This is useful to specialize sub-classes that do slightly different things Parameters ---------- data : `dict` Dictionary (or other structure) contain the input data Returns ------- """ return data EO_TASK_FACTORY.add_task_class('SuperbiasStability', SuperbiasStabilityTask)
# by the analysis # dtables = TableDict() dtables.make_datatable('files', make_file_dict(butler, tmpl_files)) for key, val in data_dict.items(): dtables.make_datatable(key, val) return dtables def plot(self, dtables, figs, **kwargs): """Make plots Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) # Analysis goes here. # you should use the data in dtables to make a bunch of figures in figs EO_TASK_FACTORY.add_task_class('Template', TemplateTask)
yvals_p_min_mean = sumtable['p_col_min_mean'] yvals_p_min_std = sumtable['p_col_min_std'] yvals_p_max_mean = sumtable['p_col_max_mean'] yvals_p_max_std = sumtable['p_col_max_std'] runs = runtable['runs'] yvals_s_diff = (yvals_s_max_mean - yvals_s_min_mean).clip(0, 100) yvals_s_err = np.sqrt(yvals_s_min_std**2 + yvals_s_max_std**2).clip( 0, 10) yvals_p_diff = (yvals_p_max_mean - yvals_p_min_mean).clip(0, 100) yvals_p_err = np.sqrt(yvals_p_min_std**2 + yvals_p_max_std**2).clip( 0, 10) figs.plot_run_chart("s-row", runs, yvals_s_diff, yerrs=yvals_s_err, ylabel="Amplitude of Row-wise amp stack [ADU]") figs.plot_run_chart("p-col", runs, yvals_p_diff, yerrs=yvals_p_err, ylabel="Amplitude of Col-wise amp stack [ADU]") EO_TASK_FACTORY.add_task_class('OscanAmpStack', OscanAmpStackTask) EO_TASK_FACTORY.add_task_class('OscanAmpStackStats', OscanAmpStackStatsTask) EO_TASK_FACTORY.add_task_class('OscanAmpStackSummary', OscanAmpStackSummaryTask)
figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) sumtable = dtables['fe55_gain_sum'] runtable = dtables['runs'] yvals = sumtable['gain'].flatten().clip(0., 2.) yerrs = sumtable['gain_error'].flatten().clip(0., 0.5) runs = runtable['runs'] figs.plot_run_chart("gain", runs, yvals, yerrs=yerrs, ylabel="Gain") yvals = sumtable['sigmax_median'].flatten().clip(0., 2.) figs.plot_run_chart("sigmax", runs, yvals, ylabel="Cluster width [pixels]") yvals = sumtable['ngood'] / sumtable['ncluster'] figs.plot_run_chart("fgood", runs, yvals, ylabel="Fraction of good clusters") EO_TASK_FACTORY.add_task_class('Fe55GainStats', Fe55GainStatsTask) EO_TASK_FACTORY.add_task_class('Fe55GainSummary', Fe55GainSummaryTask)
norm_frac_resid -= np.median(norm_frac_resid) figs.plot_hist('delta-hist', amp-1, norm_delta[20:-20], xmin=-10, xmax=10., nbins=100) figs.plot('delta', amp-1, xvals, norm_delta) figs.plot('mean-ref', amp-1, xvals, norm_frac_resid) figs.plot('mean', amp-1, xvals, frac_resid) figs.plot('std', amp-1, xvals, std_delta) rows = ((tab_stab['AMP%02i_FLAT_ROWMEAN' % amp].T - refs) / flux).T cols = ((tab_stab['AMP%02i_FLAT_COLMEAN' % amp].T - refs) / flux).T axes_scat = figs.get_amp_axes('delta-v-std', amp-1) axes_scat.set_xlim(-5., 5.) axes_scat.set_ylim(-0.005, 0.005) axes_scat.scatter(norm_delta, std_delta) #nrow = len(rows[0]) #xrow = np.linspace(0, nrow-1, nrow) #ncol = len(cols[0]) #xcol = np.linspace(0, ncol-1, ncol) med_row = np.median(rows, axis=0) med_col = np.median(cols, axis=0) figs.plot_2d_color("row", amp-1, rows-med_row, origin='low', interpolation='none') figs.plot_2d_color("col", amp-1, cols-med_col, origin='low', interpolation='none') EO_TASK_FACTORY.add_task_class('Stability', StabilityTask)
primary_hdu = fits.PrimaryHDU() primary_hdu.header['NAMPS'] = 16 dtables = TableDict(primary=primary_hdu) dtables.make_datatable('files', make_file_dict(butler, flat1_files + flat2_files)) dtables.make_datatable('flat', data_dict) return dtables def plot(self, dtables, figs, **kwargs): """Make plots Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) # Analysis goes here. # you should use the data in dtables to make a bunch of figures in figs EO_TASK_FACTORY.add_task_class('FlatPair', FlatPairTask)
qe_curves_data_dict = qe_data.make_qe_curves_data_dict() bands_data_dict = qe_data.make_bands_data_dict() dtables = TableDict() dtables.make_datatable('qe_curves', qe_curves_data_dict) dtables.make_datatable('bands', bands_data_dict) return dtables def plot(self, dtables, figs, **kwargs): """Make plots Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) # Analysis goes here. # you should use the data in dtables to make a bunch of figures in figs EO_TASK_FACTORY.add_task_class('QE', QETask)
class SummaryAnalysisConfig(MetaConfig): """Configuration for SummaryAnalysisTask""" dataset = EOUtilOptions.clone_param('dataset') runs = EOUtilOptions.clone_param('runs') plot = EOUtilOptions.clone_param('plot') skip = EOUtilOptions.clone_param('skip') SummaryAnalysisConfig.add_task('_BiasFFTSummary', BiasFFTSummaryTask) SummaryAnalysisConfig.add_task('_OscanAmpStackSummary', OscanAmpStackSummaryTask) SummaryAnalysisConfig.add_task('_SuperbiasSummary', SuperbiasSummaryTask) SummaryAnalysisConfig.add_task('_DarkCurrentSummary', DarkCurrentSummaryTask) SummaryAnalysisConfig.add_task('_Fe55GainSummary', Fe55GainSummaryTask) SummaryAnalysisConfig.add_task('_PTCSummary', PTCSummaryTask) SummaryAnalysisConfig.add_task('_EOResultsSummary', EOResultsSummaryTask) SummaryAnalysisConfig.add_task('_CorrelWRTOscanSummary', CorrelWRTOscanSummaryTask) class SummaryAnalysisTask(MetaTask): """Chain together all the summary-level analyses""" ConfigClass = SummaryAnalysisConfig _DefaultName = "SummaryAnalysis" EO_TASK_FACTORY.add_task_class('SummaryAnalysis', SummaryAnalysisTask)
figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) sumtable = dtables['biasoscorr_sum'] runtable = dtables['runs'] yvals_s = sumtable['s_correl_mean'].flatten().clip(0., 1.) yvals_p = sumtable['p_correl_mean'].flatten().clip(0., 1.) runs = runtable['runs'] figs.plot_run_chart( "mean-s", runs, yvals_s, ylabel="Correlation between serial overscan and imaging") figs.plot_run_chart( "mean-p", runs, yvals_p, ylabel="Correlation between parallel overscan and imaging") EO_TASK_FACTORY.add_task_class('CorrelWRTOscan', CorrelWRTOscanTask) EO_TASK_FACTORY.add_task_class('CorrelWRTOscanStats', CorrelWRTOscanStatsTask) EO_TASK_FACTORY.add_task_class('CorrelWRTOscanSummary', CorrelWRTOscanSummaryTask)
ymax=4.) def plot(self, dtables, figs, **kwargs): """Plot the summary data Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) if self.config.teststand == 'ts8': self.plot_ts8(dtables, figs, **kwargs) elif self.config.teststand == 'bot': sumtable = dtables['eo_results_sum'] rafts = np.unique(sumtable['raft']) for raft in rafts: mask = sumtable['raft'] == raft subtable = sumtable[mask] self.plot_by_raft(raft, subtable, figs, **kwargs) EO_TASK_FACTORY.add_task_class('EOResultsRaft', EOResultsRaftTask) EO_TASK_FACTORY.add_task_class('EOResultsRun', EOResultsRunTask) EO_TASK_FACTORY.add_task_class('EOResultsSummary', EOResultsSummaryTask)
if superbias is None: return None self.log_info_slot_msg(self.config, "") biasstruct_data = {} dim_array_dict = get_dimension_arrays_from_ccd(superbias) for key, val in dim_array_dict.items(): biasstruct_data[key] = {key: val} self.get_ccd_data(superbias, biasstruct_data, slot=slot, bias_type=None, std=self.config.std, superbias_frame=None) self.log_progress("Done!") dtables = TableDict() dtables.make_datatable('files', make_file_dict(None, [slot])) for key, val in biasstruct_data.items(): dtables.make_datatable('biasst-%s' % key, val) return dtables EO_TASK_FACTORY.add_task_class('BiasStruct', BiasStructTask) EO_TASK_FACTORY.add_task_class('SuperbiasStruct', SuperbiasStructTask)
value = self.median(image) data_dict['AMP%02i_MEDIAN' % (i + 1)].append(value) self.log_progress("Done!") dtables = TableDict() dtables.make_datatable('files', make_file_dict(butler, qe_files)) dtables.make_datatable('qe_med', data_dict) return dtables def plot(self, dtables, figs, **kwargs): """Make plots Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) # Analysis goes here. # you should use the data in dtables to make a bunch of figures in figs EO_TASK_FACTORY.add_task_class('QEMedian', QEMedianTask)
data_dict['CTI_LOW_PARALLEL_ERROR'].append(pcti_l[amp].error) data_dict['CTI_HIGH_PARALLEL'].append(pcti_h[amp].value) data_dict['CTI_HIGH_PARALLEL_ERROR'].append(pcti_h[amp].error) self.log_progress("Done!") dtables = TableDict() dtables.make_datatable('cte', data_dict) return dtables def plot(self, dtables, figs, **kwargs): """Make plots Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) # Analysis goes here. # you should use the data in dtables to make a bunch of figures in figs EO_TASK_FACTORY.add_task_class('CTE', CTETask)
xlabel='Flux [e-]', ylabel='Overscan Noise [e-]') axs = f_dict['axes'] for i, amp in enumerate(range(1, 17)): if i >= 10: marker = 's' else: marker = '^' data = dtables['amp{0:02d}'.format(amp)] sorted_indices = np.argsort(data['FLUX']) noise = data['NOISE'][sorted_indices] flux = data['FLUX'][sorted_indices] axs.semilogx(flux[flux <= self.maxflux], noise[flux <= self.maxflux], label="Amp {0}".format(i + 1), marker=marker) axs.set_ylim(0.0, 10.0) axs.grid(True, which='major', axis='both') leg_h, leg_l = axs.get_legend_handles_labels() axs.legend(leg_h, leg_l, loc='lower right', ncol=4, fontsize=12) EO_TASK_FACTORY.add_task_class('FlatOverscan', FlatOverscanTask)
tablename_format = RUN_SUPERDARK_FORMATTER plotname_format = RUN_SUPERDARK_FORMATTER datatype = 'superdark' class SuperdarkStatMosaicConfig(CameraMosaicConfig): """Configuration for SuperdarkMosaicTask""" stat = EOUtilOptions.clone_param('stat', default='stdevclip') class SuperdarkStatMosaicTask(CameraMosaicTask): """Make a mosaic from a superbias frames""" ConfigClass = SuperdarkStatMosaicConfig _DefaultName = "SuperdarkMosaicTask" intablename_format = SUPERDARK_STAT_FORMATTER tablename_format = RUN_SUPERDARK_STAT_FORMATTER plotname_format = RUN_SUPERDARK_STAT_FORMATTER datatype = 'superdark' EO_TASK_FACTORY.add_task_class('Superdark', SuperdarkTask) EO_TASK_FACTORY.add_task_class('SuperdarkRaft', SuperdarkRaftTask) EO_TASK_FACTORY.add_task_class('SuperdarkOutlierSummary', SuperdarkOutlierSummaryTask) EO_TASK_FACTORY.add_task_class('SuperdarkMosaic', SuperdarkMosaicTask) EO_TASK_FACTORY.add_task_class('SuperdarkStatMosaic', SuperdarkStatMosaicTask)
sys.stdout.flush() dtables = TableDict() dtables.make_datatable('files', make_file_dict(butler, qe_files)) #dtables.make_datatable('dust_color', data_dict) dtables.make_datatable('dust_color_hack', data_dict) return dtables def plot(self, dtables, figs, **kwargs): """Make plots Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) # Analysis goes here. # you should use the data in dtables to make a bunch of figures in figs EO_TASK_FACTORY.add_task_class('DustColor', DustColorTask)
Used to override default configuration """ self.safe_update(**kwargs) sumtable = dtables['stats'] runtable = dtables['runs'] config_table = get_run_config_table(kwargs.get('config_table', 'dark_config.fits'), 'config') if self.config.teststand == 'ts8': yvals = sumtable['current'] yerrs = (sumtable['stdev'] / sumtable['exptime']).clip(0., 0.05) runs = runtable['runs'] figs.plot_run_chart("val", runs, yvals, yerrs=yerrs, ylabel="Dark Current [ADU/s]") elif self.config.teststand == 'bot': rafts = np.unique(sumtable['raft']) #nrun = sumtable['irun'].max() + 1 runs = np.unique(sumtable['run']) for raft in rafts: mask = sumtable['raft'] == raft subtable = sumtable[mask] figs.plot_run_chart_by_slot("val_%s" % raft, subtable, "current", #yerrs="std", ylabel="Dark Current [ADU/s]", ymin=0., ymax=0.05, raft='config', config_table=config_table) EO_TASK_FACTORY.add_task_class('DarkCurrent', DarkCurrentTask) EO_TASK_FACTORY.add_task_class('DarkCurrentSummary', DarkCurrentSummaryTask)
Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) # Analysis goes here. # you should use the data in dtables to make a bunch of figures in figs fp_table = dtables['footprints'] figs.setup_amp_plots_grid( 'median', title="Median signal at dust spot by amp median", xlabel="amp flux", ylabel="dust flux") for iax, axes in enumerate(figs['dust_linearity']['axs'].ravel()): axes.scatter(fp_table[fp_table['amp'] == iax]['amp_median'], fp_table[fp_table['amp'] == iax]['med_flux_full']) EO_TASK_FACTORY.add_task_class('DustLinearityAnalysis', DustLinearityAnalysisTask)
data_dict['full_well'].append(full_well_data[0]) data_dict['max_dev'].append(linearity_data[0]) self.log_progress("Done!") outtables = TableDict() outtables.make_datatable("flat_lin", data_dict) return outtables def plot(self, dtables, figs, **kwargs): """Plot the summary data Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) # Analysis goes here. # you should use the data in dtables to make a bunch of figures in figs EO_TASK_FACTORY.add_task_class('FlatLinearity', FlatLinearityTask)
continue self._mask_file_dict[slot] = self.get_mask_files(slot=slot) self._sflat_file_dict_l[slot] = basename.replace( '.fits', '_l.fits') self._sflat_file_dict_h[slot] = basename.replace( '.fits', '_h.fits') self._sflat_file_dict_r[slot] = basename.replace( '.fits', '_r.fits') class SuperflatMosaicConfig(CameraMosaicConfig): """Configuration for SuperbiasMosaicTask""" class SuperflatMosaicTask(CameraMosaicTask): """Make a mosaic from a superbias frames""" ConfigClass = SuperflatMosaicConfig _DefaultName = "SuperflatMosaicTask" intablename_format = SUPERFLAT_SPEC_FORMATTER tablename_format = RUN_SUPERFLAT_FORMATTER plotname_format = RUN_SUPERFLAT_FORMATTER datatype = 'superflat' EO_TASK_FACTORY.add_task_class('Superflat', SuperflatTask) EO_TASK_FACTORY.add_task_class('SuperflatRaft', SuperflatRaftTask) EO_TASK_FACTORY.add_task_class('SuperflatMosaic', SuperflatMosaicTask)
data_dict = my_traps.make_data_dict() self.log_progress("Done!") dtables = TableDict() dtables.make_datatable('files', make_file_dict(butler, ppump_files)) dtables.make_datatable('traps', data_dict) return dtables def plot(self, dtables, figs, **kwargs): """Make plots Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) # Analysis goes here. # you should use the data in dtables to make a bunch of figures in figs EO_TASK_FACTORY.add_task_class('Trap', TrapTask)
from lsst.eo_utils.dark import SuperdarkTask from lsst.eo_utils.sflat import SuperflatTask class CalibStackConfig(MetaConfig): """Configuration for CalibStackTask""" dataset = EOUtilOptions.clone_param('dataset') runs = EOUtilOptions.clone_param('runs') rafts = EOUtilOptions.clone_param('rafts') slots = EOUtilOptions.clone_param('slots') outdir = EOUtilOptions.clone_param('outdir') skip = EOUtilOptions.clone_param('skip') plot = EOUtilOptions.clone_param('plot') stats_hist = EOUtilOptions.clone_param('stats_hist') CalibStackConfig.add_task('_Superbias', SuperbiasTask) CalibStackConfig.add_task('_Superdark', SuperdarkTask) CalibStackConfig.add_task('_Superflat', SuperflatTask) class CalibStackTask(MetaTask): """Construct Superbias Superdark and Superflat frames""" ConfigClass = CalibStackConfig _DefaultName = "CalibStack" EO_TASK_FACTORY.add_task_class('CalibStack', CalibStackTask)
class RaftAnalysisConfig(MetaConfig): """Configuration for RaftAnalysisTask""" dataset = EOUtilOptions.clone_param('dataset') runs = EOUtilOptions.clone_param('runs') rafts = EOUtilOptions.clone_param('rafts') skip = EOUtilOptions.clone_param('skip') plot = EOUtilOptions.clone_param('plot') RaftAnalysisConfig.add_task('_OscanCorrel', OscanCorrelTask) RaftAnalysisConfig.add_task('_SuperbiasStats', SuperbiasStatsTask) RaftAnalysisConfig.add_task('_OscanAmpStackStats', OscanAmpStackStatsTask) RaftAnalysisConfig.add_task('_BiasFFTStats', BiasFFTStatsTask) RaftAnalysisConfig.add_task('_DarkCurrent', DarkCurrentTask) RaftAnalysisConfig.add_task('_Fe55GainStats', Fe55GainStatsTask) RaftAnalysisConfig.add_task('_FlatLinearity', FlatLinearityTask) RaftAnalysisConfig.add_task('_PTC', PTCTask) RaftAnalysisConfig.add_task('_CorrelWRTOscanStats', CorrelWRTOscanStatsTask) RaftAnalysisConfig.add_task('_EOResultsRaft', EOResultsRaftTask) class RaftAnalysisTask(MetaTask): """Chain together all the raft-based analyses""" ConfigClass = RaftAnalysisConfig _DefaultName = "RaftAnalysis" EO_TASK_FACTORY.add_task_class('RaftAnalysis', RaftAnalysisTask)
Used to override default configuration """ self.safe_update(**kwargs) config_table = get_run_config_table( kwargs.get('config_table', 'seq_list.fits'), 'seq') plot_outlier_summary(self, dtables, figs, config_table) class SuperbiasMosaicConfig(CameraMosaicConfig): """Configuration for SuperbiasMosaicTask""" class SuperbiasMosaicTask(CameraMosaicTask): """Make a mosaic from a superbias frames""" ConfigClass = SuperbiasMosaicConfig _DefaultName = "SuperbiasMosaicTask" intablename_format = SUPERBIAS_FORMATTER tablename_format = RUN_SUPERBIAS_FORMATTER plotname_format = RUN_SUPERBIAS_FORMATTER datatype = 'superbias' EO_TASK_FACTORY.add_task_class('Superbias', SuperbiasTask) EO_TASK_FACTORY.add_task_class('SuperbiasRaft', SuperbiasRaftTask) EO_TASK_FACTORY.add_task_class('SuperbiasOutlierSummary', SuperbiasOutlierSummaryTask) EO_TASK_FACTORY.add_task_class('SuperbiasMosaic', SuperbiasMosaicTask)
kwargs Used to override default configuration """ self.safe_update(**kwargs) #config_table = get_run_config_table(kwargs.get('config_table', 'seq_list.fits'), 'seq') config_table = get_run_config_table(kwargs.get('config_table', 'nbias_full_bot.fits'), 'nbias') sumtable = dtables['stats'] if self.config.teststand == 'ts8': runtable = dtables['runs'] yvals = sumtable['mean'].flatten().clip(0., 30.) yerrs = sumtable['std'].flatten().clip(0., 10.) runs = runtable['runs'] figs.plot_run_chart("stats", runs, yvals, yerrs=yerrs, ylabel="Superbias STD [ADU]") elif self.config.teststand == 'bot': rafts = np.unique(sumtable['raft'].flatten()) for raft in rafts: mask = sumtable['raft'].flatten() == raft subtable = sumtable[mask] figs.plot_run_chart_by_slot("stats_%s" % raft, subtable, "mean", #yerrs="std", ylabel="Superbias STD [ADU]", ymin=0., ymax=10., raft='nbias', config_table=config_table) EO_TASK_FACTORY.add_task_class('SuperbiasStats', SuperbiasStatsTask) EO_TASK_FACTORY.add_task_class('SuperbiasSummary', SuperbiasSummaryTask)
The data we are updating Keywords -------- slot : `str` The slot name ifile : `int` The file index nfiles_used : `int` Total number of files """ slot = self.config.slot bias_type = self.get_bias_algo() ifile = kwargs['ifile'] nfiles = kwargs['nfiles'] amps = get_amp_list(ccd) for i, amp in enumerate(amps): regions = get_geom_regions(ccd, amp) serial_oscan = regions['serial_overscan'] img = get_raw_image(ccd, amp) bimg = imutil.bias_image(img, serial_oscan, bias_method=bias_type) bimg_row_mean = bimg[serial_oscan].getArray().mean(1) key_str = "biasval_%s_a%02i" % (slot, i) if key_str not in data: data[key_str] = np.ndarray((len(bimg_row_mean), nfiles)) data[key_str][:, ifile] = bimg_row_mean EO_TASK_FACTORY.add_task_class('BiasVRow', BiasVRowTask)
class SlotAnalysisConfig(MetaConfig): """Configuration for SlotAnalysisTask""" dataset = EOUtilOptions.clone_param('dataset') runs = EOUtilOptions.clone_param('runs') teststand = EOUtilOptions.clone_param('teststand') overwrite = EOUtilOptions.clone_param('overwrite') rafts = EOUtilOptions.clone_param('rafts') slots = EOUtilOptions.clone_param('slots') skip = EOUtilOptions.clone_param('skip') plot = EOUtilOptions.clone_param('plot') SlotAnalysisConfig.add_task('_BiasFFT', BiasFFTTask) SlotAnalysisConfig.add_task('_BiasStruct', BiasStructTask) SlotAnalysisConfig.add_task('_BiasVRow', BiasVRowTask) SlotAnalysisConfig.add_task('_CorrelWRTOscan', CorrelWRTOscanTask) SlotAnalysisConfig.add_task('_OscanAmpStack', OscanAmpStackTask) SlotAnalysisConfig.add_task('_FlatOverscan', FlatOverscanTask) SlotAnalysisConfig.add_task('_BF', BFTask) SlotAnalysisConfig.add_task('_FlatPair', FlatPairTask) SlotAnalysisConfig.add_task('_QEMedian', QEMedianTask) class SlotAnalysisTask(MetaTask): """Chain together all the slot-based image analyses""" ConfigClass = SlotAnalysisConfig _DefaultName = "SlotAnalysis" EO_TASK_FACTORY.add_task_class('SlotAnalysis', SlotAnalysisTask)
from lsst.eo_utils.sflat import SuperflatRaftTask from lsst.eo_utils.ppump import TrapTask class DefectAnalysisConfig(MetaConfig): """Configuration for DefectAnalysisTask""" dataset = EOUtilOptions.clone_param('dataset') runs = EOUtilOptions.clone_param('runs') rafts = EOUtilOptions.clone_param('rafts') slots = EOUtilOptions.clone_param('slots') plot = EOUtilOptions.clone_param('plot') skip = EOUtilOptions.clone_param('skip') mosaic = EOUtilOptions.clone_param('mosaic') DefectAnalysisConfig.add_task('_SuperbiasRaft', SuperbiasRaftTask) DefectAnalysisConfig.add_task('_SuperdarkRaft', SuperdarkRaftTask) DefectAnalysisConfig.add_task('_SuperflatRaft', SuperflatRaftTask) DefectAnalysisConfig.add_task('_Trap', TrapTask) class DefectAnalysisTask(MetaTask): """Analyze Superbias Superdark and Superflat frames to identify defects and outliers""" ConfigClass = DefectAnalysisConfig _DefaultName = "DefectAnalysis" EO_TASK_FACTORY.add_task_class('DefectAnalysis', DefectAnalysisTask)
axes_nonlin_stack.legend() def plot(self, dtables, figs, **kwargs): """Plot the summary data Parameters ---------- dtables : `TableDict` The data produced by this task figs : `FigureDict` The resulting figures kwargs Used to override default configuration """ self.safe_update(**kwargs) tab_flatlin = dtables['flat_lin'] flux_1 = tab_flatlin['flux_1'] flux_2 = tab_flatlin['flux_2'] flux = np.hstack([flux_1, flux_2]) slit_widths = tab_flatlin['monoch_slit_b'] slit_widths = np.hstack([slit_widths, slit_widths]) self._plot_nonlinearity(flux, slit_widths, dtables, figs) self._plot_nonlinearity(flux, slit_widths, dtables, figs, inverse=True) EO_TASK_FACTORY.add_task_class('Nonlinearity', NonlinearityTask)