def __init__(self, parent, configKey):
     super().__init__(parent=parent)
     self.configKey = configKey
     sizer = wx.GridSizer(2, 2, 2, 2)
     ## Maps strings to TextCtrls describing how to configure 
     # response curve experiments.
     self.settings = self.loadSettings()
     self.responseArgs = {}
     for key, label, helperString, validator in [
             ('responseMapNumExposures', 'Number of exposures', 
                 "How many exposures to take for each exposure time.",
              INTVALIDATOR),
             ('responseMapExposureTimes', 'Exposure times', 
                 "Comma-separated list of exposure times at which to collect data.",
              CSVVALIDATOR),
             ('responseMapCosmicRayThreshold', 
                 'Cosmic ray threshold',
                 "If any pixels in an image are more than this many standard deviations from the median, then the image is discarded.",
              FLOATVALIDATOR)]:
         control = guiUtils.addLabeledInput(self, sizer, 
             label = label, defaultValue = self.settings[key],
             helperString = helperString)
         if validator is not None: control.SetValidator(validator)
         self.responseArgs[key] = control
     rowSizer = wx.BoxSizer(wx.HORIZONTAL)
     control = wx.CheckBox(self, label = 'Preserve intermediary files')
     control.SetValue(self.settings['responseMapShouldPreserveIntermediaryFiles'])
     rowSizer.Add(control)
     guiUtils.addHelperString(self, rowSizer, 
             "Keep the raw data in addition to the averaged files.")
     self.responseArgs['responseMapShouldPreserveIntermediaryFiles'] = control
     sizer.Add(rowSizer)
     self.SetSizerAndFit(sizer)
Example #2
0
    def __init__(self, parent, configKey):
        super().__init__(parent=parent)

        self.configKey = configKey
        self.settings = self.loadSettings()

        sizer = wx.GridSizer(3, 2, 2, 2)
        ## Maps strings to TextCtrls describing how to configure
        # correction file experiments.
        self.correctionArgs = {}
        for key, label, helperString, validator in [
            ('correctionNumExposures', 'Number of exposures',
             "How many exposures to take for each exposure time.",
             INTVALIDATOR),
            ('correctionNumCollections', 'Number of collections',
             "Maximum number of exposure times to collect data for.",
             INTVALIDATOR),
            ('correctionExposureMultiplier', 'Exposure multiplier',
             "Multiplicative factor that governs how quickly we increase exposure time for measuring the camera's response.",
             FLOATVALIDATOR),
            ('correctionMaxIntensity', 'Max intensity',
             'Any images above this value are discarded; if we complete imaging and no images "survive", then we are done with data collection.',
             FLOATVALIDATOR),
            ('correctionCosmicRayThreshold', 'Cosmic ray threshold',
             "If any pixels in an image are more than this many standard deviations from the median, then the image is discarded.",
             FLOATVALIDATOR)
        ]:
            control = guiUtils.addLabeledInput(self,
                                               sizer,
                                               label=label,
                                               defaultValue=self.settings[key],
                                               helperString=helperString)
            control.SetValidator(validator)
            self.correctionArgs[key] = control
        rowSizer = wx.BoxSizer(wx.HORIZONTAL)
        control = wx.CheckBox(self, label='Preserve intermediary files')
        control.SetValue(
            self.settings['correctionShouldPreserveIntermediaryFiles'])
        rowSizer.Add(control)
        guiUtils.addHelperString(
            self, rowSizer,
            "Keep the raw data in addition to the averaged files.")
        self.correctionArgs[
            'correctionShouldPreserveIntermediaryFiles'] = control
        sizer.Add(rowSizer)
        self.SetSizerAndFit(sizer)