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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
        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)
Exemplo n.º 4
0
        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)
Exemplo n.º 5
0
                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)
Exemplo n.º 6
0
def main():
    """Hook for setup.py"""
    EO_TASK_FACTORY.parse_and_run()
        self.safe_update(**kwargs)
        stat_type = self.config.stat
        if stat_type in [None, DEFAULT_STAT_TYPE]:
            formatter = SUPERDARK_FORMATTER
        else:
            formatter = SUPERDARK_STAT_FORMATTER
        return self.get_filename_from_format(formatter, '', **kwargs)

    def __call__(self, butler, slot_data, **kwargs):
        """Tie together analysis functions

        Parameters
        ----------
        butler : `Butler`
            The data butler
        data : `dict`
            Dictionary (or other structure) contain the input data
        kwargs
            Used to override default configuration
        """
        self.safe_update(**kwargs)
        self.make_superdark(butler, slot_data)
        if self.config.plot is not None:
            if self._superdark_frame is None:
                self.log_info_slot_msg(self.config, "No superdark, skipping")
                return
            self.make_plots(None)


EO_TASK_FACTORY.add_task_class('SuperdarkStability', SuperdarkStabilityTask)
Exemplo n.º 8
0
                                    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)
Exemplo n.º 9
0
        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)
Exemplo n.º 10
0
        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)
Exemplo n.º 11
0
        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)
Exemplo n.º 12
0
                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)
Exemplo n.º 13
0
            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)
Exemplo n.º 14
0
    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)
Exemplo n.º 15
0
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)
Exemplo n.º 16
0

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)
Exemplo n.º 17
0
                                   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)
Exemplo n.º 18
0
    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)
Exemplo n.º 19
0
        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)
Exemplo n.º 20
0
            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)
Exemplo n.º 21
0
            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)
Exemplo n.º 22
0
            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)
Exemplo n.º 23
0
        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)
Exemplo n.º 24
0
        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)
Exemplo n.º 25
0
        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)
Exemplo n.º 26
0
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)
                # data_dict

                data_dict['slot'].append(islot)
                data_dict['amp'].append(amp)

        self.log_progress("Done!")

        outtables = TableDict()
        outtables.make_datatable("tmplsuffix", 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('Template', TemplateTask)
Exemplo n.º 28
0
        superbias_frame : `MaskedCCD`
            The superbias frame to subtract away
        boundry : `int`
            Size of buffer around edge of overscan region

        Returns
        -------
        overscans : `list`
            The overscan data
        """
        amps = get_amp_list(ccd)
        superbias_frame = kwargs.get('superbias_frame', None)
        overscans = []
        for amp in amps:

            superbias_im = self.get_superbias_amp_image(butler, superbias_frame, amp)
            regions = get_geom_regions(ccd, amp)
            serial_oscan = regions['serial_overscan']

            img = get_raw_image(ccd, amp)
            image = unbias_amp(img, serial_oscan, bias_type=None, superbias_im=superbias_im).image
            oscan_copy = copy.deepcopy(serial_oscan)
            oscan_copy.grow(-self.boundry)
            oscan_data = image[oscan_copy]
            step_x = regions['step_x']
            step_y = regions['step_y']
            overscans.append(oscan_data.getArray()[::step_x, ::step_y])
        return overscans

EO_TASK_FACTORY.add_task_class('OscanCorrel', OscanCorrelTask)