Exemplo n.º 1
0
    def make_psana_cfg_file_for_cora_split_v1(self):
        self.path_in = apputils.AppDataPath(
            'CorAna/scripts/psana-cora-split.cfg').path()
        self.path_out = fnm.path_cora_split_psana_cfg()

        self.d_subs = {
            'FNAME_XTC': fnm.path_data_xtc_cond(),
            'SKIP': str(cp.bat_data_start.value() - 1),
            'EVENTS':
            str(cp.bat_data_end.value() - cp.bat_data_start.value() + 1),
            'IMG_REC_MODULE': str(cp.bat_img_rec_mod.value()),
            'DETINFO': str(cp.bat_det_info.value()),
            'PATH_PREFIX_CORA': str(fnm.path_prefix_cora()),
            'IMG_NPARTS': str(cp.bat_img_nparts.value()),
            'FNAME_PEDS_AVE': fnm.path_pedestals_ave(),
            'FNAME_DATA_AVE': fnm.path_data_ave(),
            'FNAME_DATA_RMS': fnm.path_data_rms()
        }

        fname_imon_cfg = fnm.path_cora_split_imon_cfg()
        self.make_imon_cfg_file(fname_imon_cfg)
        self.d_subs['FNAME_IMON_CFG'] = str(fname_imon_cfg)

        if cp.lld_type.value() == 'ADU':  #  ['NONE', 'ADU', 'RMS']
            self.d_subs['THRESHOLD_ADU'] = str(cp.lld_adu.value())
            self.d_subs['DO_CONST_THR'] = 'true'
            self.d_subs['THRESHOLD_NRMS'] = '0'
            self.d_subs['FNAME_PEDS_RMS'] = ''

        elif cp.lld_type.value() == 'RMS':
            self.d_subs['THRESHOLD_ADU'] = '0'
            self.d_subs['DO_CONST_THR'] = 'false'
            self.d_subs['THRESHOLD_NRMS'] = str(cp.lld_rms.value())
            self.d_subs['FNAME_PEDS_RMS'] = fnm.path_pedestals_rms()

        else:
            self.d_subs['THRESHOLD_ADU'] = '0'
            self.d_subs['DO_CONST_THR'] = 'false'
            self.d_subs['THRESHOLD_NRMS'] = '0'
            self.d_subs['FNAME_PEDS_RMS'] = ''

        if os.path.lexists(fnm.path_cora_split_map_static_q()):
            self.d_subs['FNAME_MAP_BINS'] = fnm.path_cora_split_map_static_q()
        else:
            self.d_subs['FNAME_MAP_BINS'] = ''
        self.d_subs['FNAME_INT_BINS'] = fnm.path_cora_split_int_static_q()
        self.d_subs['NUMBER_OF_BINS'] = str(cp.ana_stat_part_q.value())

        #self.print_substitution_dict()
        #self.make_cfg_file()
        txt_cfg = self.text_for_section()
        self.save_cfg_file(txt_cfg, self.path_out)
Exemplo n.º 2
0
    def make_psana_cfg_file_for_data_aver (self) :
        self.path_in  = apputils.AppDataPath('CorAna/scripts/psana-data-aver.cfg').path()
        self.path_out = fnm.path_data_aver_psana_cfg()
        self.d_subs   = {'SKIP'           : str( cp.bat_data_start.value() - 1 ),
                         'EVENTS'         : str( cp.bat_data_end.value() - cp.bat_data_start.value() + 1 ),
                         'IMG_REC_MODULE' : str( cp.bat_img_rec_mod.value() ),
                         'DETINFO'        : str( cp.bat_det_info.value() ),
                         'FILE_AVE'       : fnm.path_data_ave(),
                         'FILE_RMS'       : fnm.path_data_rms()
                         }

        self.print_substitution_dict()
        self.make_cfg_file()
Exemplo n.º 3
0
    def make_psana_cfg_file_for_cora_split_v1 (self) :
        self.path_in  = apputils.AppDataPath('CorAna/scripts/psana-cora-split.cfg').path()
        self.path_out = fnm.path_cora_split_psana_cfg()

        self.d_subs   = {'FNAME_XTC'       : fnm.path_data_xtc_cond(),
                         'SKIP'            : str( cp.bat_data_start.value() - 1 ),
                         'EVENTS'          : str( cp.bat_data_end.value() - cp.bat_data_start.value() + 1 ),
                         'IMG_REC_MODULE'  : str( cp.bat_img_rec_mod.value() ),
                         'DETINFO'         : str( cp.bat_det_info.value() ),
                         'PATH_PREFIX_CORA': str( fnm.path_prefix_cora() ),
                         'IMG_NPARTS'      : str( cp.bat_img_nparts.value() ),
                         'FNAME_PEDS_AVE'  : fnm.path_pedestals_ave(),
                         'FNAME_DATA_AVE'  : fnm.path_data_ave(),
                         'FNAME_DATA_RMS'  : fnm.path_data_rms()
                         }

        fname_imon_cfg = fnm.path_cora_split_imon_cfg()
        self.make_imon_cfg_file (fname_imon_cfg)
        self.d_subs['FNAME_IMON_CFG' ] = str( fname_imon_cfg )


        if cp.lld_type.value() == 'ADU' : #  ['NONE', 'ADU', 'RMS']
            self.d_subs['THRESHOLD_ADU' ] = str( cp.lld_adu.value() )
            self.d_subs['DO_CONST_THR'  ] = 'true'
            self.d_subs['THRESHOLD_NRMS'] = '0'
            self.d_subs['FNAME_PEDS_RMS'] = ''

        elif cp.lld_type.value() == 'RMS' : 
            self.d_subs['THRESHOLD_ADU' ] = '0'
            self.d_subs['DO_CONST_THR'  ] = 'false'
            self.d_subs['THRESHOLD_NRMS'] = str( cp.lld_rms.value() )
            self.d_subs['FNAME_PEDS_RMS'] = fnm.path_pedestals_rms()

        else : 
            self.d_subs['THRESHOLD_ADU' ] = '0'
            self.d_subs['DO_CONST_THR'  ] = 'false'
            self.d_subs['THRESHOLD_NRMS'] = '0'
            self.d_subs['FNAME_PEDS_RMS'] = ''


        if os.path.lexists( fnm.path_cora_split_map_static_q() ) :
            self.d_subs['FNAME_MAP_BINS' ] = fnm.path_cora_split_map_static_q()
        else :
            self.d_subs['FNAME_MAP_BINS' ] = ''            
        self.d_subs['FNAME_INT_BINS' ]     = fnm.path_cora_split_int_static_q()
        self.d_subs['NUMBER_OF_BINS' ]     = str( cp.ana_stat_part_q.value() )

        #self.print_substitution_dict()
        #self.make_cfg_file()
        txt_cfg = self.text_for_section()
        self.save_cfg_file(txt_cfg, self.path_out)
    def make_psana_cfg_file_for_data_aver(self):
        self.path_in = apputils.AppDataPath(
            'CorAna/scripts/psana-data-aver.cfg').path()
        self.path_out = fnm.path_data_aver_psana_cfg()
        self.d_subs = {
            'SKIP': str(cp.bat_data_start.value() - 1),
            'EVENTS':
            str(cp.bat_data_end.value() - cp.bat_data_start.value() + 1),
            'IMG_REC_MODULE': str(cp.bat_img_rec_mod.value()),
            'DETINFO': str(cp.bat_det_info.value()),
            'FILE_AVE': fnm.path_data_ave(),
            'FILE_RMS': fnm.path_data_rms()
        }

        self.print_substitution_dict()
        self.make_cfg_file()
Exemplo n.º 5
0
    def add_cfg_trailer_for_cora_split (self) :
        self.path_in  = apputils.AppDataPath('CorAna/scripts/psana-cora-split-trailer.cfg').path()

        self.d_subs   = {'DETINFO'         : str( cp.bat_det_info.value() ),
                         'PATH_PREFIX_CORA': str( fnm.path_prefix_cora() ),
                         'IMG_NPARTS'      : str( cp.bat_img_nparts.value() ),
                         'FNAME_PEDS_AVE'  : fnm.path_pedestals_ave(),
                         'FNAME_DATA_AVE'  : fnm.path_data_ave(),
                         'FNAME_DATA_RMS'  : fnm.path_data_rms()
                         }

        fname_imon_cfg = fnm.path_cora_split_imon_cfg()
        self.make_imon_cfg_file (fname_imon_cfg)
        self.d_subs['FNAME_IMON_CFG' ] = str( fname_imon_cfg )


        if cp.lld_type.value() == 'ADU' : #  ['NONE', 'ADU', 'RMS']
            self.d_subs['THRESHOLD_ADU' ] = str( cp.lld_adu.value() )
            self.d_subs['DO_CONST_THR'  ] = 'true'
            self.d_subs['THRESHOLD_NRMS'] = '0'
            self.d_subs['FNAME_PEDS_RMS'] = ''

        elif cp.lld_type.value() == 'RMS' : 
            self.d_subs['THRESHOLD_ADU' ] = '0'
            self.d_subs['DO_CONST_THR'  ] = 'false'
            self.d_subs['THRESHOLD_NRMS'] = str( cp.lld_rms.value() )
            self.d_subs['FNAME_PEDS_RMS'] = fnm.path_pedestals_rms()

        else : 
            self.d_subs['THRESHOLD_ADU' ] = '0'
            self.d_subs['DO_CONST_THR'  ] = 'false'
            self.d_subs['THRESHOLD_NRMS'] = '0'
            self.d_subs['FNAME_PEDS_RMS'] = ''


        if os.path.lexists( fnm.path_cora_split_map_static_q() ) :
            self.d_subs['FNAME_MAP_BINS' ] = fnm.path_cora_split_map_static_q()
        else :
            self.d_subs['FNAME_MAP_BINS' ] = ''            
        self.d_subs['FNAME_INT_BINS' ]     = fnm.path_cora_split_int_static_q()
        self.d_subs['NUMBER_OF_BINS' ]     = str( cp.ana_stat_part_q.value() )

        #self.print_substitution_dict()

        self.str_of_modules += ' ImgAlgos.ImgCalib ImgAlgos.ImgIntMonCorr ImgAlgos.ImgIntForBins ImgAlgos.ImgVsTimeSplitInFiles ImgAlgos.ImgAverage'

        self.txt_cfg_body += self.text_for_section()
Exemplo n.º 6
0
    def add_cfg_trailer_for_cora_split(self):
        self.path_in = apputils.AppDataPath(
            'CorAna/scripts/psana-cora-split-trailer.cfg').path()

        self.d_subs = {
            'DETINFO': str(cp.bat_det_info.value()),
            'PATH_PREFIX_CORA': str(fnm.path_prefix_cora()),
            'IMG_NPARTS': str(cp.bat_img_nparts.value()),
            'FNAME_PEDS_AVE': fnm.path_pedestals_ave(),
            'FNAME_DATA_AVE': fnm.path_data_ave(),
            'FNAME_DATA_RMS': fnm.path_data_rms()
        }

        fname_imon_cfg = fnm.path_cora_split_imon_cfg()
        self.make_imon_cfg_file(fname_imon_cfg)
        self.d_subs['FNAME_IMON_CFG'] = str(fname_imon_cfg)

        if cp.lld_type.value() == 'ADU':  #  ['NONE', 'ADU', 'RMS']
            self.d_subs['THRESHOLD_ADU'] = str(cp.lld_adu.value())
            self.d_subs['DO_CONST_THR'] = 'true'
            self.d_subs['THRESHOLD_NRMS'] = '0'
            self.d_subs['FNAME_PEDS_RMS'] = ''

        elif cp.lld_type.value() == 'RMS':
            self.d_subs['THRESHOLD_ADU'] = '0'
            self.d_subs['DO_CONST_THR'] = 'false'
            self.d_subs['THRESHOLD_NRMS'] = str(cp.lld_rms.value())
            self.d_subs['FNAME_PEDS_RMS'] = fnm.path_pedestals_rms()

        else:
            self.d_subs['THRESHOLD_ADU'] = '0'
            self.d_subs['DO_CONST_THR'] = 'false'
            self.d_subs['THRESHOLD_NRMS'] = '0'
            self.d_subs['FNAME_PEDS_RMS'] = ''

        if os.path.lexists(fnm.path_cora_split_map_static_q()):
            self.d_subs['FNAME_MAP_BINS'] = fnm.path_cora_split_map_static_q()
        else:
            self.d_subs['FNAME_MAP_BINS'] = ''
        self.d_subs['FNAME_INT_BINS'] = fnm.path_cora_split_int_static_q()
        self.d_subs['NUMBER_OF_BINS'] = str(cp.ana_stat_part_q.value())

        #self.print_substitution_dict()

        self.str_of_modules += ' ImgAlgos.ImgCalib ImgAlgos.ImgIntMonCorr ImgAlgos.ImgIntForBins ImgAlgos.ImgVsTimeSplitInFiles ImgAlgos.ImgAverage'

        self.txt_cfg_body += self.text_for_section()
Exemplo n.º 7
0
    def make_psana_cfg_file_for_data_aver (self) :
        self.path_in  = apputils.AppDataPath('CorAna/scripts/psana-data-aver.cfg').path()
        self.path_out = fnm.path_data_aver_psana_cfg()
        self.d_subs   = {'FNAME_XTC'      : fnm.path_data_xtc_cond(),
                         'SKIP'           : str( cp.bat_data_start.value() - 1 ),
                         'EVENTS'         : str( cp.bat_data_end.value() - cp.bat_data_start.value() + 1 ),
                         'IMG_REC_MODULE' : str( cp.bat_img_rec_mod.value() ),
                         'DETINFO'        : str( cp.bat_det_info.value() ),
                         'FNAME_DATA_AVE' : fnm.path_data_ave(),
                         'FNAME_DATA_RMS' : fnm.path_data_rms(),
                         'SAT_THR_ADU'    : str( cp.ccdset_adcsatu.value() ),
                         'SATPIX_MASK'    : fnm.path_satpix_mask(),
                         'SATPIX_FRAC'    : fnm.path_satpix_frac(),
                         'HOTPIX_MASK'    : '', # fnm.path_hotpix_mask(),
                         'HOTPIX_FRAC'    : '' # fnm.path_hotpix_frac()
                         }
        # cp.ccdset_ccdgain.value()
        # cp.ccdset_ccdeff .value()

        self.print_substitution_dict()
        self.make_cfg_file()
Exemplo n.º 8
0
    def make_psana_cfg_file_for_data_aver (self) :
        self.path_in  = apputils.AppDataPath('CorAna/scripts/psana-data-aver.cfg').path()
        self.path_out = fnm.path_data_aver_psana_cfg()
        self.d_subs   = {'FNAME_XTC'      : fnm.path_data_xtc_cond(),
                         'SKIP'           : str( cp.bat_data_start.value() - 1 ),
                         'EVENTS'         : str( cp.bat_data_end.value() - cp.bat_data_start.value() + 1 ),
                         'IMG_REC_MODULE' : str( cp.bat_img_rec_mod.value() ),
                         'DETINFO'        : str( cp.bat_det_info.value() ),
                         'FNAME_DATA_AVE' : fnm.path_data_ave(),
                         'FNAME_DATA_RMS' : fnm.path_data_rms(),
                         'SAT_THR_ADU'    : str( cp.ccdset_adcsatu.value() ),
                         'SATPIX_MASK'    : fnm.path_satpix_mask(),
                         'HOTPIX_MASK'    : fnm.path_hotpix_mask(),
                         'SATPIX_FRAC'    : fnm.path_satpix_frac(),
                         'HOTPIX_FRAC'    : fnm.path_hotpix_frac()
                         }
        # cp.ccdset_ccdgain.value()
        # cp.ccdset_ccdeff .value()

        self.print_substitution_dict()
        self.make_cfg_file()