Ejemplo n.º 1
0
 def CreateDescription(self, part):
     desc = tableio.I3TableRowDescription()
     desc.add_field('x', tableio.types.Float64, 'm',
                    'x-position of particle')
     desc.add_field('y', tableio.types.Float64, 'm',
                    'y-position of particle')
     desc.add_field('z', tableio.types.Float64, 'm',
                    'z-position of particle')
     desc.add_field('time', tableio.types.Float64, 'ns',
                    'origin time of particle')
     desc.add_field('zenith', tableio.types.Float64, 'radian',
                    'zenith angle of particle origin')
     desc.add_field('azimuth', tableio.types.Float64, 'radian',
                    'azimuthal angle of particle origin')
     desc.add_field('energy', tableio.types.Float64, 'GeV',
                    'energy of particle')
     desc.add_field('speed', tableio.types.Float64, 'Gm/s',
                    'particle speed')
     desc.add_field('length', tableio.types.Float64, 'm', 'length of track')
     # skip: major_id/minor_id
     desc.add_field('type', tableio.I3Datatype(self.booked.ParticleType),
                    '', '')
     desc.add_field('shape', tableio.I3Datatype(self.booked.ParticleShape),
                    '', '')
     desc.add_field('location',
                    tableio.I3Datatype(self.booked.LocationType), '', '')
     desc.add_field('fit_status', tableio.I3Datatype(self.booked.FitStatus),
                    '', '')
     return desc
Ejemplo n.º 2
0
 def CreateDescription(self,dlsm):
     desc = tableio.I3TableRowDescription()
     # make this a "ragged" table
     desc.is_multi_row = True
     # grab an example DOMLaunch
     dl = self._get_nonempty(dlsm)
     # unrolling fields
     desc.add_field('string',tableio.types.Int16,'','String number')
     desc.add_field('om',tableio.types.UInt16,'','OM number')
     desc.add_field('index',tableio.types.UInt16,'','Index within the vector')
     # DOMLaunch fields
     desc.add_field('start_time',tableio.types.Float32,'ns','')
     desc.add_field('pedestal_sub',tableio.types.Bool,'','Has the pedestal been subtracted?')
     desc.add_field('lc_bit',tableio.types.Bool,'','')
     desc.add_field('trigger_type',tableio.I3Datatype(self.dl.TriggerType),'','')
     desc.add_field('trigger_mode',tableio.I3Datatype(self.dl.TriggerMode),'','')
     desc.add_field('raw_charge_stamp',tableio.types.Int32,'','',len(dl.GetRawChargeStamp()))
     for i in range(3):
         desc.add_field('raw_atwd_%d'%i,tableio.types.Int32,'counts','Uncalibrated ATWD digitizer counts',128)
     desc.add_field('raw_fadc',tableio.types.UInt16,'counts','Uncalibrated fADC digitizer counts',256)
     return desc
Ejemplo n.º 3
0
 def CreateDescription(self, lfparams):
     desc = tableio.I3TableRowDescription()
     desc.add_field("primary_zenith", tableio.types.Float64, "", "")
     desc.add_field("primary_azimuth", tableio.types.Float64, "", "")
     desc.add_field("primary_energy", tableio.types.Float64, "", "")
     desc.add_field('primary_type',
                    tableio.I3Datatype(I3Particle.ParticleType), '', '')
     desc.add_field("bias_factor", tableio.types.Float64, "", "")
     desc.add_field("bias_target", tableio.types.Float64, "", "")
     desc.add_field("weight", tableio.types.Float64, "", "")
     desc.add_field("max_x", tableio.types.Float64, "", "")
     return desc
Ejemplo n.º 4
0
 def CreateDescription(self,dlsm):
     desc = tableio.I3TableRowDescription()
     # make this a "ragged" table
     desc.is_multi_row = True
     # grab an example DOMLaunch
     wf = self._get_nonempty(dlsm)
     # unrolling fields
     desc.add_field('string',tableio.types.Int16,'','String number')
     desc.add_field('om',tableio.types.UInt16,'','OM number')
     desc.add_field('index',tableio.types.UInt16,'','Index within the vector')
     # DOMLaunch fields
     desc.add_field('start_time',tableio.types.Float32,'ns','')
     desc.add_field('bin_width',tableio.types.Float32,'ns','')
     desc.add_field('source',tableio.I3Datatype(self.wf.Source),'','')
     desc.add_field('waveform',tableio.types.Float32,'','',len(wf.waveform))
     return desc
Ejemplo n.º 5
0
	def setUp(self):
		desc = tableio.I3TableRowDescription()
		
		self.types = {
		              'signed_char':   tableio.types.Int8,
		              'unsigned_char': tableio.types.UInt8,
		              'signed_short':  tableio.types.Int16,
		              'unsigned_short':tableio.types.UInt16,
		              'signed_int':    tableio.types.Int32,
		              'unsigned_int':  tableio.types.UInt32,
		              'signed_long':   tableio.types.Int64,
		              'unsigned_long': tableio.types.UInt64,
		              'float':         tableio.types.Float32,
		              'double':        tableio.types.Float64,
		              'bool':          tableio.types.Bool}
		# HACK: dial back longs on 32 bit systems for testing purposes
		if sys.maxsize == 2**31-1:
				self.types['signed_long'] = tableio.types.Int32
				self.types['unsigned_long'] = tableio.types.UInt32
		self.codes = {
		              'signed_char':   'b',
		              'unsigned_char': 'B',
		              'signed_short':  'h',
		              'unsigned_short':'H',
		              'signed_int':    'i',
		              'unsigned_int':  'I',
		              'signed_long':   'l',
		              'unsigned_long': 'L',
		              'float':         'f',
		              'double':        'd',
		              'bool':          'o'}
		self.conversions = {int:   ['c','b','B','h','H','i'],
		                    int:  ['I','h','H'],
		                    float: ['f','d'],
		                    bool:  ['o']}
		
		
		for t,code in self.types.items():
			desc.add_field(t,code,'','')
			desc.add_field('%s_vec'%t,code,'','',128)
		
		desc.add_field('trigger_type',tableio.I3Datatype(dataclasses.I3DOMLaunch.TriggerType),'','')
		
		self.desc = desc
		self.rows = tableio.I3TableRow(desc,1)