Functions | Variables
PandAna.reco_validation.add_data Namespace Reference

Functions

def kCVNVar (model)
 
def dfToDict (df)
 

Variables

 kVeto = Cut(lambda tables: tables['rec.sel.veto']['keep'] == 1)
 
 d = sys.argv[1]
 
 stride = int(sys.argv[2])
 
 offset = int(sys.argv[3])
 
list files = [f for f in os.listdir(d) if 'h5caf.h5' in f][offset::stride]
 
 modelBase = load_model('models/model_mynet_cos_best.h5')
 
 modelPTP = load_model('models/model_mynet_ptp_best.h5')
 
list modellist = [modelBase, modelPTP]
 
list namelist = ['veto', 'ptpcut']
 
 t0 = time.time()
 
 tables = loader([os.path.join(d,f)])
 
list specs = []
 
 h5 = h5py.File(os.path.join(outdir,f), 'a')
 
 thedict = dfToDict(s.df())
 
string datastr = 'rec.sel.cvn2020'
 
 data
 

Function Documentation

def PandAna.reco_validation.add_data.dfToDict (   df)

Definition at line 25 of file add_data.py.

References parse_dependency_file_t.list.

25 def dfToDict(df):
26  withid = df.reset_index()
27  ret = {}
28  for col in list(withid):
29  ret[col] = withid[col].values[..., np.newaxis].astype(np.float32)
30  return ret
31 
def PandAna.reco_validation.add_data.kCVNVar (   model)

Definition at line 16 of file add_data.py.

16 def kCVNVar(model):
17  classes = ['numuid','nueid','nutauid','ncid','cosmicid']
18 
19  def kVar(tables):
20  pms = tables['rec.training.cvnmaps']['cvnmap']
21  df = pms.apply(lambda x: model.predict(np.array([x]))[0])
22  return pd.DataFrame(df.values.tolist(), columns=classes, index=df.index)
23  return Var(kVar)
24 

Variable Documentation

PandAna.reco_validation.add_data.d = sys.argv[1]

Definition at line 34 of file add_data.py.

PandAna.reco_validation.add_data.data

Definition at line 75 of file add_data.py.

PandAna.reco_validation.add_data.datastr = 'rec.sel.cvn2020'

Definition at line 71 of file add_data.py.

Referenced by plot_predictions().

list PandAna.reco_validation.add_data.files = [f for f in os.listdir(d) if 'h5caf.h5' in f][offset::stride]

Definition at line 39 of file add_data.py.

PandAna.reco_validation.add_data.h5 = h5py.File(os.path.join(outdir,f), 'a')
PandAna.reco_validation.add_data.kVeto = Cut(lambda tables: tables['rec.sel.veto']['keep'] == 1)

Definition at line 14 of file add_data.py.

PandAna.reco_validation.add_data.modelBase = load_model('models/model_mynet_cos_best.h5')

Definition at line 44 of file add_data.py.

list PandAna.reco_validation.add_data.modellist = [modelBase, modelPTP]

Definition at line 48 of file add_data.py.

PandAna.reco_validation.add_data.modelPTP = load_model('models/model_mynet_ptp_best.h5')

Definition at line 46 of file add_data.py.

list PandAna.reco_validation.add_data.namelist = ['veto', 'ptpcut']

Definition at line 49 of file add_data.py.

PandAna.reco_validation.add_data.offset = int(sys.argv[3])

Definition at line 36 of file add_data.py.

Referenced by novaddt.ADCShapeFit(), calib.ADCShapeFit(), calib::ADCShapeFitTable.ADCShapeFitTable(), sim::ParticleNavigator.Add(), daqdataformats::RawMilliSlice.addMicroSlice(), calib::PEResponse.analyze(), calib::PEResponse.beginJob(), fnex::CovarianceBinUtility.BinToEnergy(), cmf::CovarianceBinUtility.BinToEnergy(), stan::test::unit.check_adaptation(), stan::test::unit.check_different(), skim::NueSkimmer.CopyProngCVN(), skim::NueSkimmer.CopyShowerLID(), skim::NumuSkimmer.CopyShowerLID(), skim::NueSkimmer.CopyShowerPngAssn(), count_occurrences(), fnex::CovarianceBinUtility.CovarianceBinUtility(), DCMOffsetCalculator(), DrawArrow(), CLibSymbolInfo.Dump(), ECCFromCalE(), art::RootInputFile.eventsToSkip(), fnex::CovarianceFitHelper.FillEnergySpectra(), cmf::CovarianceBinUtility.FillOffsetAndBinMaps(), fnex::CovarianceMatrixMaker.FillSpectrum(), fnex::CovarianceFitHelper.FillSpectrum(), calib::TimingCalFilter.filter(), trk::KalmanTrack.FilterTracker(), nova::dbi::Table.GetCol(), getFnexColour(), ifdb::IFDBSpillInfo.GetGaussFit(), calib::Calibrator.GetTimingOffset(), numue::NumuEAlg.HadENonQE(), numue::NumuEAlg.HadEQE(), ana::MCMCSamples.LoadFrom(), nova::dbi::Table.LoadFromCSV(), stan::math.log_mix_partial_helper(), test.LogGauss(), LZ4_decompress_generic(), LZ4HC_compress_optimal(), make_dst_cosrejbdttrain(), make_training_sample(), calib::Calibrator.MakeCellHit(), cmf::PlotUtilities.MakeEnergySpectraFromBins(), makeInitialDecorrelatedErrorPlot(), MakeProfileHadEFD(), MakeProfileHadEND(), MakeProfileMuEFD(), MakeProfileMuEND(), MakingProfile(), MakingProfileActCatcherND(), MakingProfileAllCatcherND(), MakingProfileHadCC(), MakingProfileHadCCND(), MakingProfileHadNonQE(), MakingProfileHadNonQEND(), MakingProfileHadQE(), MakingProfileHadQEND(), MakingProfileND(), stan::math::internal.map_rect_concurrent(), ana::MCMCSamples.MaxValue(), simb::MCParticle.MCParticle(), ana::MCMCSamples.MinValue(), ana.MuonECat(), ana.MuonECatcher(), MuonEFromTrackLength(), numue::NumuEAlg.NDHadENonQE(), numue::NumuEAlg.NDHadEQE(), NDMuonEInActiveAndCatcher(), NDMuonEInActiveAndCatcherEffLen(), NDMuonEInActiveAndCatcherJustCatcherE(), numue::NumuEAlg.NDMuonEInCatcherOnly(), art::EmptyEvent.numberEventsInThisSubRun(), art::PtrRemapper.operator()(), plot_hists(), novaddt::WaveformProcessor.postBeginRun(), predict_mprod16_nd_p4_act_energy(), predict_mprod16_nd_p4_cat_energy(), predict_mprod16_nd_p4_had_energy(), predict_prod3_fd_p1_had_energy(), predict_prod3_fd_p1_muon_energy(), predict_prod3_fd_p2_had_energy(), predict_prod3_fd_p2_muon_energy(), predict_prod3_fd_p3_had_energy(), predict_prod3_fd_p3_muon_energy(), predict_prod3_fd_p4_had_energy(), predict_prod3_fd_p4_muon_energy(), predict_prod3_fd_p5_had_energy(), predict_prod3_fd_p5_muon_energy(), predict_prod3_nd_p3_act_energy(), predict_prod3_nd_p3_cat_energy(), predict_prod3_nd_p3_had_energy(), predict_prod3_nd_p4_act_energy(), predict_prod3_nd_p4_cat_energy(), predict_prod3_nd_p4_had_energy(), ana.predict_special_fd_p1_had_energy(), ana.predict_special_fd_p1_muon_energy(), ana.predict_special_fd_p2_had_energy(), ana.predict_special_fd_p2_muon_energy(), ana.predict_special_fd_p3_had_energy(), ana.predict_special_fd_p3_muon_energy(), ana.predict_special_fd_p5_had_energy(), ana.predict_special_fd_p5_muon_energy(), ana.predict_special_nd_p3_act_energy(), ana.predict_special_nd_p3_cat_energy(), ana.predict_special_nd_p3_had_energy(), novaddt::WaveformProcessor.process(), novaddt::RateMonitor.quantiseToMicroSlice(), genie::flux::GJPARCNuFlux.RandomOffset(), boost::python::detail::proxy_group< Proxy >.replace(), g4n::ParticleListAction.ResetTrackIDOffset(), ana.SAGetNDCatEffLen(), ana.SAMuE(), ana::MCMCSamples.SaveTo(), fnex::NuMuAnalysisSetup.SecondAnalysisEnergy(), nova::database::Table.SetSelectOffset(), nova::dbi::Table.SetSelectOffset(), nutools::dbi::Table.SetSelectOffset(), art::EmptyEvent.skip(), spline0(), ana.TAGetNDActLen(), ana.TAMuE(), calib::ADCShapeFitTable.TNS(), trimmubarid(), trimvar(), ana::MCMCSamples.Vars(), and ana::SpectrumLoaderBase.WildcardOrSAMQuery().

list PandAna.reco_validation.add_data.specs = []

Definition at line 56 of file add_data.py.

PandAna.reco_validation.add_data.stride = int(sys.argv[2])

Definition at line 35 of file add_data.py.

PandAna.reco_validation.add_data.t0 = time.time()

Definition at line 51 of file add_data.py.

PandAna.reco_validation.add_data.tables = loader([os.path.join(d,f)])

Definition at line 55 of file add_data.py.

PandAna.reco_validation.add_data.thedict = dfToDict(s.df())

Definition at line 69 of file add_data.py.