def evaluate_all_combinations(patfile, trainedforestbase, trainedforesttend, config):
    original_usertag = config.get("general", "usertag") ### remember what the tag started as
    original_variables = config.get("mvsc", "z") ### remember the variables
    print (original_variables)
    for tstart in ["no_tstart", "yes_tstart"]: ### iterate over all possible combinations
        for tend in ["no_tend", "yes_tend"]:
            config.set("general", "usertag", "%s-%s-%s"%(original_usertag, tstart, tend) ) ### change the usertag as needed
            if(tstart == "no_tstart" and tend == "no_tend"):
                config.set("mvsc", "z", "%s,%s,%s"%(original_variables, "time_locked", "time_end"))
            elif(tstart == "no_tstart"):
                config.set("mvsc", "z", "%s,%s"%(original_variables, "time_locked"))                
            elif(tend == "no_tend"):
                config.set("mvsc", "z", "%s,%s"%(original_variables, "time_end"))
            else:
                config.set("mvsc","z", original_variables)
            trainedforest = trainedforestbase + "%s-%s/"%(tstart,tend) + trainedforestend
            ranked_file = trainedforest[:-3] + "dat"
            gps_start_time = -np.infty
            gps_end_time = np.infty
            dir = "."
            classifiersD, mla, ovl = idq.config_to_classifiersD( config )
            classD = classifiersD['mvsc']
            miniconfig = classD['config']
            print(ranked_file)
            print(trainedforest)
            print(config.get("mvsc", "z"))
            idq.forest_evaluate(patfile, trainedforest, ranked_file, miniconfig, gps_start_time, gps_end_time, dir)
    config.set("general", "usertag", original_usertag)
    config.set("mvsc", "z", original_variables)
### read global configuration file

config = ConfigParser.SafeConfigParser()
config.read(opts.config)

ifo = config.get('general', 'ifo')

usertag = config.get('general', 'usertag')
if usertag:
    usertag = "_%s"%usertag

#========================
# which classifiers
#========================
### ensure we have a section for each classifier and fill out dictionary of options
classifiersD, mla, ovl = idq.config_to_classifiersD( config )

classifiers = sorted(classifiersD.keys())

if mla:
    ### reading parameters from config file needed for mla
#    auxmvc_coinc_window = config.getfloat('build_auxmvc_vectors','time-window')
#    auxmc_gw_signif_thr = config.getfloat('build_auxmvc_vectors','signif-threshold')
    auxmvc_coinc_window = config.getfloat('realtime', 'padding')
    auxmc_gw_signif_thr = config.getfloat('general', 'gw_kwsignif_thr')

auxmvc_selected_channels = config.get('general','selected-channels')
auxmvc_unsafe_channels = config.get('general','unsafe-channels')

#min_samples = config.getint('train', 'min_samples') ### minimum number of samples a training set should have
#min_svm_samples = config.getint('idq_train', 'min_svm_samples')
Ejemplo n.º 3
0
config = ConfigParser.SafeConfigParser()
config.read(opts.config)

#mainidqdir = config.get('general', 'idqdir') ### get the main directory where idq pipeline is going to be running.

ifo = config.get('general', 'ifo')

usertag = config.get('general', 'usertag')
if usertag:
    usertag = "_%s" % usertag

#========================
# which classifiers
#========================
### ensure we have a section for each classifier and fill out dictionary of options
classifiersD, mla, ovl = idq.config_to_classifiersD(config)

### get combiners information and add these to classifiersD
combinersD, referenced_classifiers = idq.config_to_combinersD(config)
for combiner, value in combinersD.items():
    classifiersD[combiner] = value

classifiers = sorted(classifiersD.keys())

#if mla:
#    ### reading parameters from config file needed for mla
#    auxmvc_coinc_window = config.getfloat('build_auxmvc_vectors','time-window')
#    auxmc_gw_signif_thr = config.getfloat('build_auxmvc_vectors','signif-threshold')
#    auxmvc_selected_channels = config.get('general','selected-channels')
#    auxmvc_unsafe_channels = config.get('general','unsafe-channels')