public override ReturnCode IngestFile(ChannelCompartment compartment, string fileName) { ReturnCode returnCode = bidParser.ParseFile(fileName); DataFile dataFile = new DataFile(fileName, bidParser.GetDate()); int numRecords = bidParser.GetNumRecords(); DateTime time = DateTime.MinValue; for (int r = 0; r < numRecords; ++r) { time = bidParser.BIDTimeToDateTime(bidParser.GetRecord(r).time); channels[chACountRate].AddDataPoint(compartment, time, bidParser.GetRecord(r).chACountRate, dataFile); channels[chBCountRate].AddDataPoint(compartment, time, bidParser.GetRecord(r).chBCountRate, dataFile); channels[chCCountRate].AddDataPoint(compartment, time, bidParser.GetRecord(r).chCCountRate, dataFile); channels[gamInGamCh1].AddDataPoint(compartment, time, bidParser.GetRecord(r).gamInGamCh1, dataFile); channels[gamCh1Sigma].AddDataPoint(compartment, time, bidParser.GetRecord(r).gamCh1Sigma, dataFile); channels[gamInGamCh2].AddDataPoint(compartment, time, bidParser.GetRecord(r).gamInGamCh2, dataFile); channels[gamCh2Sigma].AddDataPoint(compartment, time, bidParser.GetRecord(r).gamCh2Sigma, dataFile); } dataFile.DataEnd = time; bidParser = new BIDParser(); return(ReturnCode.SUCCESS); }
public GRANDInstrument(DetectionSystem parent, string name, uint id) : base(parent, name, id) { InstrumentType = "GRAND"; FileExtension = FILE_EXTENSION; filePrefix = ""; FileExtension = "bid"; bidParser = new BIDParser(); numChannels = NUM_CHANNELS; channels = new Channel[numChannels]; channels[chACountRate] = new Channel(Name + "-Neutrons-A", this, Channel.ChannelType.COUNT_RATE, 0); channels[chBCountRate] = new Channel(Name + "-Neutrons-B", this, Channel.ChannelType.COUNT_RATE, 0); channels[chCCountRate] = new Channel(Name + "-Neutrons-C", this, Channel.ChannelType.COUNT_RATE, 0); channels[gamInGamCh1] = new Channel(Name + "-Gammas-1", this, Channel.ChannelType.COUNT_RATE, 0); channels[gamCh1Sigma] = new Channel(Name + "-Gammas-1-Sigma", this, Channel.ChannelType.COUNT_RATE, 0); channels[gamInGamCh2] = new Channel(Name + "-Gammas-2", this, Channel.ChannelType.COUNT_RATE, 0); channels[gamCh2Sigma] = new Channel(Name + "-Gammas-2-Sigma", this, Channel.ChannelType.COUNT_RATE, 0); }