AnitaConventions.h
1 
10 
11 #ifndef ANITACONVENTIONS_H
12 #define ANITACONVENTIONS_H
13 
14 #ifndef ROOT_Rtypes
15 #if !defined(__CINT__) || defined(__MAKECINT__)
16 #include "Rtypes.h"
17 #endif
18 #endif
19 
20 #define ANITA_FLIGHT_H
21 
22 #include "AnitaVersion.h"
23 
25 
29 namespace WaveCalType {
30  typedef enum EWaveCalType {
31 
32  kNoCalib = 0x00,
33  kJustUnwrap = 0x01,
34  kNominal = 0x02,
35  kVoltageTime = 0x02,
42  kFull = 0x0a,
43  kDefault = 0x0a,
44  kVTFast = 0x1b,
45  kAddPeds = 0x1c,
46  kOnlyTiming = 0x1d,
47  kJustRemoveClockSpike = 0x1e,
48  kOnlyDTs = 0x1f,
50  } WaveCalType_t;
51 
52  const char *calTypeAsString(WaveCalType::WaveCalType_t calType);
53  void listAllCalTypes();
54 }
55 
57 #define NUM_SEAVEYS_ANITA1 32
58 #define NUM_SEAVEYS_ANITA2 40
59 #define NUM_SEAVEYS_ANITA3 48
60 #define NUM_SEAVEYS_ANITA4 48
61 #define NUM_POLS 2
62 #ifdef ANITA_2_DATA
63 #define ACTIVE_SURFS 10
64 #define NUM_SEAVEYS NUM_SEAVEYS_ANITA2
65 #else
66 #define ACTIVE_SURFS 12
67 #define NUM_SEAVEYS NUM_SEAVEYS_ANITA3
68 #endif
69 
70 #define SCALERS_PER_SURF 12
71 #define SCALERS_PER_SURF_V30 16
72 #define L1S_PER_SURF 6
73 #define L1S_PER_SURF_V30 4
74 #define L2S_PER_SURF 2
75 #define L3S_PER_SURF 2
76 #define RFCHAN_PER_SURF 8
77 #define CHANNELS_PER_SURF 9
78 #define LABRADORS_PER_SURF 4
79 #define RCO_PER_LAB 2
80 #define NUM_DIGITZED_CHANNELS ACTIVE_SURFS*CHANNELS_PER_SURF
81 #define MAX_NUMBER_SAMPLES 260
82 #define EFFECTIVE_SAMPLES 256
83 #define NUM_PHI 16
84 #define NUM_ANTENNA_RINGS 3
85 
86 
87 #define NUM_NADIRS 8
88 #define NUM_BICONES 4
89 #define NUM_DISCONES 4
90 
91 
92 #define BASE_PACKET_MASK 0xffff
93 
94 
95 #define NUM_SURF ACTIVE_SURFS
96 #define NUM_CHAN CHANNELS_PER_SURF
97 #define NUM_CHIP LABRADORS_PER_SURF
98 #define NUM_RCO RCO_PER_LAB
99 #define NUM_SAMP MAX_NUMBER_SAMPLES
100 #define NUM_EFF_SAMP EFFECTIVE_SAMPLES
101 
102 //Trigger Stuff
103 #define ANTS_PER_SURF 4
104 #define TRIGGERS_PER_SURF 12
105 #define TRIGGER_SURFS 8
106 #define PHI_SECTORS 16
107 #define BANDS_PER_ANT 4
108 #define TURF_BANK_SIZE 4
109 #define TURF_EVENT_DATA_SIZE 256
110 #define NADIR_ANTS 8
111 
112 
113 #define WRAPPED_HITBUS 0x8
114 
115 
116 //Acromag stuff
117 #define CHANS_PER_IP320 40
118 #define NUM_IP320_BOARDS 3
119 
120 
121 //Process Stuff
122 #define NUM_PROCESSES 20
123 #define NUM_PROCESSES_V40 20
124 
125 //GPS stuff
126 #define MAX_SATS 12
127 
128 #define MAX_CMD_LENGTH 20
129 
130 
131 #define NUM_PRIORITIES 10
132 #define NUM_SATABLADES 8
133 #define NUM_SATAMINIS 8
134 #define NUM_USBS 31
135 
136 #define WAKEUP_LOS_BUFFER_SIZE 4000
137 #define WAKEUP_TDRSS_BUFFER_SIZE 500
138 #define WAKEUP_LOW_RATE_BUFFER_SIZE 100
139 
140 #define ACQD_ID_MASK 0x001
141 #define ARCHIVED_ID_MASK 0x002
142 #define CALIBD_ID_MASK 0x004
143 #define CMDD_ID_MASK 0x008
144 #define EVENTD_ID_MASK 0x010
145 #define GPSD_ID_MASK 0x020
146 #define HKD_ID_MASK 0x040
147 #define LOSD_ID_MASK 0x080
148 #define PRIORITIZERD_ID_MASK 0x100
149 #define SIPD_ID_MASK 0x200
150 #define MONITORD_ID_MASK 0x400
151 #define PLAYBACKD_ID_MASK 0x800
152 #define LOGWATCHD_ID_MASK 0x1000
153 #define NEOBRICKD_ID_MASK 0x2000
154 #define ALL_ID_MASK 0xffff
155 
156 
157 //RTLd stuff
158 #define NUM_RTLSDR 6
159 #define RTLSDR_MAX_SPECTRUM_BINS 4096 // The maximum number of bins we can save in a packet.
160 
161 
162 // TUFF stuff
163 #define NUM_TUFF_NOTCHES 3
164 #define NUM_RFCM 4
165 
166 
167 
168 //Now some geometry and polarisation considerations
169 
171 
175 namespace AnitaRing {
176  typedef enum EAnitaRing {
177  kTopRing = 0,
178  kUpperRing = kTopRing,
180  kLowerRing = kMiddleRing,
182  kNadirRing=kBottomRing,
184  } AnitaRing_t;
185 
186  const char *ringAsString(AnitaRing::AnitaRing_t ring);
188 }
189 
191 
195 namespace AnitaPol {
196  typedef enum EAnitaPol {
198  kVertical = 1,
200  } AnitaPol_t;
201  char polAsChar(AnitaPol::AnitaPol_t pol);
202 }
203 
205 
209 namespace AnitaTrigPol {
210  typedef enum EAnitaTrigPol {
211  kLCP = 0,
212  kRCP = 1,
214  kVertical = 3,
216  } AnitaTrigPol_t;
218 
221 
222 }
223 
224 
225 
226 
228 
232 namespace AnitaBand {
233  typedef enum EAnitaBand {
234  kLow =0,
235  kMid =1,
236  kHigh =2,
237  kFull =3
238  } AnitaBand_t;
239  const char *bandAsString(AnitaBand::AnitaBand_t band);
240 }
241 
243 //
244 // TODO this needs to be updated properly to support multiple ANITA's
245 //
250 namespace AnitaLocations {
251 
252  const double LONGITUDE_SURF_SEAVEY=167.0564667;
253  const double LATITUDE_SURF_SEAVEY=-77.86185;
254  const double ALTITUDE_SURF_SEAVEY=15.0;
255 
256  const double LONGITUDE_BH=167.06679444;
257  const double LATITUDE_BH=-77.861936111;
258  const double ALTITUDE_BH=-33.67;
259 
260  // const double LONGITUDE_TD=158.4564333333; ///< Longitude of Taylor Dome antenna.
261  // const double LATITUDE_TD=77.88116666666; ///< Latitude of Taylor Dome antenna.
262  // const double ALTITUDE_TD=2712.72; ///< Altitude of Taylor Dome antenna.
263  const double LONGITUDE_TD=158.45925;
264  const double LATITUDE_TD=-77.8803;
265  const double ALTITUDE_TD=2260-97.;
266 
267  //Anita3 WAIS pulser location
268  // WAIS divide position taken from Steph's e-log
269  // https://www.phys.hawaii.edu/elog/anita_notes/595
270  const Double_t LATITUDE_WAIS_A3 = - (79 + (27.93728/60));
271  const Double_t LONGITUDE_WAIS_A3 = -(112 + (6.74974/60));
272  const Double_t ALTITUDE_WAIS_A3 = 1775.68;
273 
274  //keeping this around until we can inform people they should use getWais() type calls instead.
275  const Double_t LATITUDE_WAIS __attribute__((deprecated)) = - (79 + (27.93728/60));
276  const Double_t LONGITUDE_WAIS __attribute__((deprecated)) = -(112 + (6.74974/60));
277  const Double_t ALTITUDE_WAIS __attribute__((deprecated)) = 1813.42;
278 
279 
280  //Anita 4 location (from Ben Strutt on Slack)
281  // And now with an elog note https://www.phys.hawaii.edu/elog/anita_notes/699
282  const Double_t LATITUDE_WAIS_A4 = - (-79.468116);
283  const Double_t LONGITUDE_WAIS_A4 = -(112.059258);
284  const Double_t ALTITUDE_WAIS_A4 = 1779.80;
285 
286  //Flight independent calls
287  Double_t getWaisLatitude();
288  Double_t getWaisLongitude();
289  Double_t getWaisAltitude();
290 
291  // Siple Dome position taken from Steph's e-log
292  // https://www.phys.hawaii.edu/elog/anita_notes/595
293  const Double_t LATITUDE_SIPLE = - (81 + (39.139/60));
294  const Double_t LONGITUDE_SIPLE = -(149 + (0.01/60));
295  // bvv: The next constant is the best I could find at the moment. elog
296  // 595 doens't have any information on altitude:
297  const Double_t ALTITUDE_SIPLE = 601;
298 
299  // LDB position taken from Steph's e-log
300  // https://www.phys.hawaii.edu/elog/anita_notes/617
301  const Double_t LATITUDE_LDB = - (77 + (51.23017/60));
302  const Double_t LONGITUDE_LDB = + (167 + (12.16908/60));
303  const Double_t ALTITUDE_LDB = 0.;
304 
305 };
306 
307 
308 // Please note that in order to avoid unnecessarily dependencies during compiling
309 // I have moved the static adu5 into UsefulAdu5Pat.h. Go look for them there.
310 
311 // // ANITA-2 values in degrees
312 // #define STATIC_ADU5_PITCH -0.29
313 // #define STATIC_ADU5_ROLL 0.89
314 // #define OFFSET_ADU5_HEADING -0.32
315 
316 
317 // Number of ANITA payloads.
318 #define NUM_ANITAS 4
319 
320 
321 #endif //ANITACONVENTIONS_H
const Double_t LATITUDE_SIPLE
Latitude of Siple dome pulser.
const char * calTypeAsString(WaveCalType::WaveCalType_t calType)
Returns the calibration type as a string.
deltaTs, voltage, unwrap, trigger jitter, cable delay. The full monty.
The middle band.
Inter-SURF timing (trigger jitter) without cable delay.
AnitaBand – Enumeration for the four frequency bands.
const Double_t LATITUDE_WAIS_A4
Latitude of WAIS divide pulser.
The full band.x.
All the timing of kFull, but none of the voltage calibration (Ped corrected ADC counts) ...
enum WaveCalType::EWaveCalType WaveCalType_t
The calibration enumeration type.
char ringAsChar(AnitaRing::AnitaRing_t ring)
Returns the ring as a character string.
AnitaPol – Enumeration for the two polarisations.
const Double_t LATITUDE_WAIS_A3
Latitude of WAIS divide pulser.
WaveCalType – The Calibration Type.
Left-circular polarisation (e.g. A4)
char polAsChar(AnitaTrigPol::AnitaTrigPol_t pol)
Returns the polarisation as a character string.
const Double_t LATITUDE_WAIS __attribute__((deprecated))
Latitude of WAIS divide pulser.
Horizontal Polarisation (e.g. A3)
USeful in for loops.
Useful for looping over all calibrations.
const Double_t LONGITUDE_WAIS_A4
Longitude of WAIS divide pulser.
const char * ringAsString(AnitaRing::AnitaRing_t ring)
Returns the ring as a character string.
const double LONGITUDE_SURF_SEAVEY
Longitude of surface seavey.
AnitaTrigPol::AnitaTrigPol_t fromAnitaPol(AnitaPol::AnitaPol_t pol)
USeful in for loops.
Right-circular polarisation (e.g. A4)
AnitaLocations – A selection of useful ANITA-I related locations, now updated for ANITA-3...
enum AnitaRing::EAnitaRing AnitaRing_t
Ring enumeration.
What you should call for analysis work.
enum AnitaTrigPol::EAnitaTrigPol AnitaTrigPol_t
Polarisation enumeration.
const char * bandAsString(AnitaBand::AnitaBand_t band)
Returns the band as a character string.
The low band.
For calibration: sample-to-sample dts without unwrapping (or voltage calibs)
const double ALTITUDE_BH
Altitude of borehole antenna.
void listAllCalTypes()
Prints a list of all available calibration types.
const Double_t ALTITUDE_WAIS_A4
Altitude of WAIS divide pulser.
The 260 samples straight from raw data.
const Double_t LATITUDE_LDB
Latitude at LDB.
const Double_t LONGITUDE_LDB
Longitude at LDB.
const double ALTITUDE_SURF_SEAVEY
Altitude of surface seavey.
enum AnitaBand::EAnitaBand AnitaBand_t
Band enumeration.
const double LONGITUDE_BH
Longitude of borehole antenna.
The high band.
For calib: opposite RCO from software algorithm.
Vertical Polarisation.
Useful in for loops.
const Double_t LONGITUDE_SIPLE
Longitude of Siple dome pulser.
The X good samples from raw data (260-hitbus)
char polAsChar(AnitaPol::AnitaPol_t pol)
Returns the polarisation as a character string.
Vertical Polarisation (e.g. A3)
const Double_t ALTITUDE_SIPLE
Altitude of Siple dome pulser according to http://mapcarta.com/25623620.
For calib: applies RCO from firmware (no latch delay)
AnitaRing – Enumeration for the three rings.
Horizontal Polarisation.
For calib: 1-firmware RCO (no latch delay)
No inter-SURF timing (or zero meaning)
enum AnitaPol::EAnitaPol AnitaPol_t
Polarisation enumeration.
Faster, but no algorithm for it.
const Double_t ALTITUDE_WAIS_A3
Altitude of WAIS divide pulser.
const Double_t LONGITUDE_WAIS_A3
Longitude of WAIS divide pulser.
Using mV/ADC = 1 and all dts = 1./2.6 ns.
const double LATITUDE_SURF_SEAVEY
Latitude of surface seavey.
const double LATITUDE_BH
Latitude if borehole antenna.
AnitaTrigPol – Enumeration for the two trigger polarisations.
const Double_t ALTITUDE_LDB
Altitude at LDB.
Remove the spiky clock in early stage.