spacedatastandards-org 1.73.12

Space data standards framework based on CCSDS standards and Google FlatBuffers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
// automatically generated by the FlatBuffers compiler, do not modify


// @generated

use core::mem;
use core::cmp::Ordering;

extern crate flatbuffers;
use self::flatbuffers::{EndianScalar, Follow};

pub enum SWROffset {}
#[derive(Copy, Clone, PartialEq)]

/// Short-Wave Infrared
pub struct SWR<'a> {
  pub _tab: flatbuffers::Table<'a>,
}

impl<'a> flatbuffers::Follow<'a> for SWR<'a> {
  type Inner = SWR<'a>;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    Self { _tab: flatbuffers::Table::new(buf, loc) }
  }
}

impl<'a> SWR<'a> {
  pub const VT_ID: flatbuffers::VOffsetT = 4;
  pub const VT_ON_ORBIT: flatbuffers::VOffsetT = 6;
  pub const VT_TS: flatbuffers::VOffsetT = 8;
  pub const VT_SOLAR_PHASE_ANGLE: flatbuffers::VOffsetT = 10;
  pub const VT_LAT: flatbuffers::VOffsetT = 12;
  pub const VT_LON: flatbuffers::VOffsetT = 14;
  pub const VT_LOCATION_NAME: flatbuffers::VOffsetT = 16;
  pub const VT_BAD_WAVE: flatbuffers::VOffsetT = 18;
  pub const VT_WAVELENGTHS: flatbuffers::VOffsetT = 20;
  pub const VT_ABS_FLUXES: flatbuffers::VOffsetT = 22;
  pub const VT_RATIO_WAVELENGTHS: flatbuffers::VOffsetT = 24;
  pub const VT_FLUX_RATIOS: flatbuffers::VOffsetT = 26;
  pub const VT_ORIG_OBJECT_ID: flatbuffers::VOffsetT = 28;
  pub const VT_SAT_NO: flatbuffers::VOffsetT = 30;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    SWR { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
    args: &'args SWRArgs<'args>
  ) -> flatbuffers::WIPOffset<SWR<'bldr>> {
    let mut builder = SWRBuilder::new(_fbb);
    builder.add_LON(args.LON);
    builder.add_LAT(args.LAT);
    builder.add_SOLAR_PHASE_ANGLE(args.SOLAR_PHASE_ANGLE);
    builder.add_SAT_NO(args.SAT_NO);
    if let Some(x) = args.ORIG_OBJECT_ID { builder.add_ORIG_OBJECT_ID(x); }
    if let Some(x) = args.FLUX_RATIOS { builder.add_FLUX_RATIOS(x); }
    if let Some(x) = args.RATIO_WAVELENGTHS { builder.add_RATIO_WAVELENGTHS(x); }
    if let Some(x) = args.ABS_FLUXES { builder.add_ABS_FLUXES(x); }
    if let Some(x) = args.WAVELENGTHS { builder.add_WAVELENGTHS(x); }
    if let Some(x) = args.BAD_WAVE { builder.add_BAD_WAVE(x); }
    if let Some(x) = args.LOCATION_NAME { builder.add_LOCATION_NAME(x); }
    if let Some(x) = args.TS { builder.add_TS(x); }
    if let Some(x) = args.ON_ORBIT { builder.add_ON_ORBIT(x); }
    if let Some(x) = args.ID { builder.add_ID(x); }
    builder.finish()
  }

  pub fn unpack(&self) -> SWRT {
    let ID = self.ID().map(|x| {
      x.to_string()
    });
    let ON_ORBIT = self.ON_ORBIT().map(|x| {
      x.to_string()
    });
    let TS = self.TS().map(|x| {
      x.to_string()
    });
    let SOLAR_PHASE_ANGLE = self.SOLAR_PHASE_ANGLE();
    let LAT = self.LAT();
    let LON = self.LON();
    let LOCATION_NAME = self.LOCATION_NAME().map(|x| {
      x.to_string()
    });
    let BAD_WAVE = self.BAD_WAVE().map(|x| {
      x.to_string()
    });
    let WAVELENGTHS = self.WAVELENGTHS().map(|x| {
      x.iter().map(|s| s.to_string()).collect()
    });
    let ABS_FLUXES = self.ABS_FLUXES().map(|x| {
      x.iter().map(|s| s.to_string()).collect()
    });
    let RATIO_WAVELENGTHS = self.RATIO_WAVELENGTHS().map(|x| {
      x.iter().map(|s| s.to_string()).collect()
    });
    let FLUX_RATIOS = self.FLUX_RATIOS().map(|x| {
      x.iter().map(|s| s.to_string()).collect()
    });
    let ORIG_OBJECT_ID = self.ORIG_OBJECT_ID().map(|x| {
      x.to_string()
    });
    let SAT_NO = self.SAT_NO();
    SWRT {
      ID,
      ON_ORBIT,
      TS,
      SOLAR_PHASE_ANGLE,
      LAT,
      LON,
      LOCATION_NAME,
      BAD_WAVE,
      WAVELENGTHS,
      ABS_FLUXES,
      RATIO_WAVELENGTHS,
      FLUX_RATIOS,
      ORIG_OBJECT_ID,
      SAT_NO,
    }
  }

  #[inline]
  pub fn ID(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SWR::VT_ID, None)}
  }
  #[inline]
  pub fn ON_ORBIT(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SWR::VT_ON_ORBIT, None)}
  }
  #[inline]
  pub fn TS(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SWR::VT_TS, None)}
  }
  #[inline]
  pub fn SOLAR_PHASE_ANGLE(&self) -> f64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<f64>(SWR::VT_SOLAR_PHASE_ANGLE, Some(0.0)).unwrap()}
  }
  #[inline]
  pub fn LAT(&self) -> f64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<f64>(SWR::VT_LAT, Some(0.0)).unwrap()}
  }
  #[inline]
  pub fn LON(&self) -> f64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<f64>(SWR::VT_LON, Some(0.0)).unwrap()}
  }
  #[inline]
  pub fn LOCATION_NAME(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SWR::VT_LOCATION_NAME, None)}
  }
  #[inline]
  pub fn BAD_WAVE(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SWR::VT_BAD_WAVE, None)}
  }
  #[inline]
  pub fn WAVELENGTHS(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(SWR::VT_WAVELENGTHS, None)}
  }
  #[inline]
  pub fn ABS_FLUXES(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(SWR::VT_ABS_FLUXES, None)}
  }
  #[inline]
  pub fn RATIO_WAVELENGTHS(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(SWR::VT_RATIO_WAVELENGTHS, None)}
  }
  #[inline]
  pub fn FLUX_RATIOS(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(SWR::VT_FLUX_RATIOS, None)}
  }
  #[inline]
  pub fn ORIG_OBJECT_ID(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SWR::VT_ORIG_OBJECT_ID, None)}
  }
  #[inline]
  pub fn SAT_NO(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(SWR::VT_SAT_NO, Some(0)).unwrap()}
  }
}

impl flatbuffers::Verifiable for SWR<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("ID", Self::VT_ID, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("ON_ORBIT", Self::VT_ON_ORBIT, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("TS", Self::VT_TS, false)?
     .visit_field::<f64>("SOLAR_PHASE_ANGLE", Self::VT_SOLAR_PHASE_ANGLE, false)?
     .visit_field::<f64>("LAT", Self::VT_LAT, false)?
     .visit_field::<f64>("LON", Self::VT_LON, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("LOCATION_NAME", Self::VT_LOCATION_NAME, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("BAD_WAVE", Self::VT_BAD_WAVE, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("WAVELENGTHS", Self::VT_WAVELENGTHS, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("ABS_FLUXES", Self::VT_ABS_FLUXES, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("RATIO_WAVELENGTHS", Self::VT_RATIO_WAVELENGTHS, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("FLUX_RATIOS", Self::VT_FLUX_RATIOS, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("ORIG_OBJECT_ID", Self::VT_ORIG_OBJECT_ID, false)?
     .visit_field::<i32>("SAT_NO", Self::VT_SAT_NO, false)?
     .finish();
    Ok(())
  }
}
pub struct SWRArgs<'a> {
    pub ID: Option<flatbuffers::WIPOffset<&'a str>>,
    pub ON_ORBIT: Option<flatbuffers::WIPOffset<&'a str>>,
    pub TS: Option<flatbuffers::WIPOffset<&'a str>>,
    pub SOLAR_PHASE_ANGLE: f64,
    pub LAT: f64,
    pub LON: f64,
    pub LOCATION_NAME: Option<flatbuffers::WIPOffset<&'a str>>,
    pub BAD_WAVE: Option<flatbuffers::WIPOffset<&'a str>>,
    pub WAVELENGTHS: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
    pub ABS_FLUXES: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
    pub RATIO_WAVELENGTHS: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
    pub FLUX_RATIOS: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
    pub ORIG_OBJECT_ID: Option<flatbuffers::WIPOffset<&'a str>>,
    pub SAT_NO: i32,
}
impl<'a> Default for SWRArgs<'a> {
  #[inline]
  fn default() -> Self {
    SWRArgs {
      ID: None,
      ON_ORBIT: None,
      TS: None,
      SOLAR_PHASE_ANGLE: 0.0,
      LAT: 0.0,
      LON: 0.0,
      LOCATION_NAME: None,
      BAD_WAVE: None,
      WAVELENGTHS: None,
      ABS_FLUXES: None,
      RATIO_WAVELENGTHS: None,
      FLUX_RATIOS: None,
      ORIG_OBJECT_ID: None,
      SAT_NO: 0,
    }
  }
}

pub struct SWRBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> SWRBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_ID(&mut self, ID: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SWR::VT_ID, ID);
  }
  #[inline]
  pub fn add_ON_ORBIT(&mut self, ON_ORBIT: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SWR::VT_ON_ORBIT, ON_ORBIT);
  }
  #[inline]
  pub fn add_TS(&mut self, TS: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SWR::VT_TS, TS);
  }
  #[inline]
  pub fn add_SOLAR_PHASE_ANGLE(&mut self, SOLAR_PHASE_ANGLE: f64) {
    self.fbb_.push_slot::<f64>(SWR::VT_SOLAR_PHASE_ANGLE, SOLAR_PHASE_ANGLE, 0.0);
  }
  #[inline]
  pub fn add_LAT(&mut self, LAT: f64) {
    self.fbb_.push_slot::<f64>(SWR::VT_LAT, LAT, 0.0);
  }
  #[inline]
  pub fn add_LON(&mut self, LON: f64) {
    self.fbb_.push_slot::<f64>(SWR::VT_LON, LON, 0.0);
  }
  #[inline]
  pub fn add_LOCATION_NAME(&mut self, LOCATION_NAME: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SWR::VT_LOCATION_NAME, LOCATION_NAME);
  }
  #[inline]
  pub fn add_BAD_WAVE(&mut self, BAD_WAVE: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SWR::VT_BAD_WAVE, BAD_WAVE);
  }
  #[inline]
  pub fn add_WAVELENGTHS(&mut self, WAVELENGTHS: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SWR::VT_WAVELENGTHS, WAVELENGTHS);
  }
  #[inline]
  pub fn add_ABS_FLUXES(&mut self, ABS_FLUXES: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SWR::VT_ABS_FLUXES, ABS_FLUXES);
  }
  #[inline]
  pub fn add_RATIO_WAVELENGTHS(&mut self, RATIO_WAVELENGTHS: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SWR::VT_RATIO_WAVELENGTHS, RATIO_WAVELENGTHS);
  }
  #[inline]
  pub fn add_FLUX_RATIOS(&mut self, FLUX_RATIOS: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SWR::VT_FLUX_RATIOS, FLUX_RATIOS);
  }
  #[inline]
  pub fn add_ORIG_OBJECT_ID(&mut self, ORIG_OBJECT_ID: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SWR::VT_ORIG_OBJECT_ID, ORIG_OBJECT_ID);
  }
  #[inline]
  pub fn add_SAT_NO(&mut self, SAT_NO: i32) {
    self.fbb_.push_slot::<i32>(SWR::VT_SAT_NO, SAT_NO, 0);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> SWRBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    SWRBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<SWR<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for SWR<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("SWR");
      ds.field("ID", &self.ID());
      ds.field("ON_ORBIT", &self.ON_ORBIT());
      ds.field("TS", &self.TS());
      ds.field("SOLAR_PHASE_ANGLE", &self.SOLAR_PHASE_ANGLE());
      ds.field("LAT", &self.LAT());
      ds.field("LON", &self.LON());
      ds.field("LOCATION_NAME", &self.LOCATION_NAME());
      ds.field("BAD_WAVE", &self.BAD_WAVE());
      ds.field("WAVELENGTHS", &self.WAVELENGTHS());
      ds.field("ABS_FLUXES", &self.ABS_FLUXES());
      ds.field("RATIO_WAVELENGTHS", &self.RATIO_WAVELENGTHS());
      ds.field("FLUX_RATIOS", &self.FLUX_RATIOS());
      ds.field("ORIG_OBJECT_ID", &self.ORIG_OBJECT_ID());
      ds.field("SAT_NO", &self.SAT_NO());
      ds.finish()
  }
}
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
pub struct SWRT {
  pub ID: Option<String>,
  pub ON_ORBIT: Option<String>,
  pub TS: Option<String>,
  pub SOLAR_PHASE_ANGLE: f64,
  pub LAT: f64,
  pub LON: f64,
  pub LOCATION_NAME: Option<String>,
  pub BAD_WAVE: Option<String>,
  pub WAVELENGTHS: Option<Vec<String>>,
  pub ABS_FLUXES: Option<Vec<String>>,
  pub RATIO_WAVELENGTHS: Option<Vec<String>>,
  pub FLUX_RATIOS: Option<Vec<String>>,
  pub ORIG_OBJECT_ID: Option<String>,
  pub SAT_NO: i32,
}
impl Default for SWRT {
  fn default() -> Self {
    Self {
      ID: None,
      ON_ORBIT: None,
      TS: None,
      SOLAR_PHASE_ANGLE: 0.0,
      LAT: 0.0,
      LON: 0.0,
      LOCATION_NAME: None,
      BAD_WAVE: None,
      WAVELENGTHS: None,
      ABS_FLUXES: None,
      RATIO_WAVELENGTHS: None,
      FLUX_RATIOS: None,
      ORIG_OBJECT_ID: None,
      SAT_NO: 0,
    }
  }
}
impl SWRT {
  pub fn pack<'b, A: flatbuffers::Allocator + 'b>(
    &self,
    _fbb: &mut flatbuffers::FlatBufferBuilder<'b, A>
  ) -> flatbuffers::WIPOffset<SWR<'b>> {
    let ID = self.ID.as_ref().map(|x|{
      _fbb.create_string(x)
    });
    let ON_ORBIT = self.ON_ORBIT.as_ref().map(|x|{
      _fbb.create_string(x)
    });
    let TS = self.TS.as_ref().map(|x|{
      _fbb.create_string(x)
    });
    let SOLAR_PHASE_ANGLE = self.SOLAR_PHASE_ANGLE;
    let LAT = self.LAT;
    let LON = self.LON;
    let LOCATION_NAME = self.LOCATION_NAME.as_ref().map(|x|{
      _fbb.create_string(x)
    });
    let BAD_WAVE = self.BAD_WAVE.as_ref().map(|x|{
      _fbb.create_string(x)
    });
    let WAVELENGTHS = self.WAVELENGTHS.as_ref().map(|x|{
      let w: Vec<_> = x.iter().map(|s| _fbb.create_string(s)).collect();_fbb.create_vector(&w)
    });
    let ABS_FLUXES = self.ABS_FLUXES.as_ref().map(|x|{
      let w: Vec<_> = x.iter().map(|s| _fbb.create_string(s)).collect();_fbb.create_vector(&w)
    });
    let RATIO_WAVELENGTHS = self.RATIO_WAVELENGTHS.as_ref().map(|x|{
      let w: Vec<_> = x.iter().map(|s| _fbb.create_string(s)).collect();_fbb.create_vector(&w)
    });
    let FLUX_RATIOS = self.FLUX_RATIOS.as_ref().map(|x|{
      let w: Vec<_> = x.iter().map(|s| _fbb.create_string(s)).collect();_fbb.create_vector(&w)
    });
    let ORIG_OBJECT_ID = self.ORIG_OBJECT_ID.as_ref().map(|x|{
      _fbb.create_string(x)
    });
    let SAT_NO = self.SAT_NO;
    SWR::create(_fbb, &SWRArgs{
      ID,
      ON_ORBIT,
      TS,
      SOLAR_PHASE_ANGLE,
      LAT,
      LON,
      LOCATION_NAME,
      BAD_WAVE,
      WAVELENGTHS,
      ABS_FLUXES,
      RATIO_WAVELENGTHS,
      FLUX_RATIOS,
      ORIG_OBJECT_ID,
      SAT_NO,
    })
  }
}
#[inline]
/// Verifies that a buffer of bytes contains a `SWR`
/// and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_SWR_unchecked`.
pub fn root_as_SWR(buf: &[u8]) -> Result<SWR, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::root::<SWR>(buf)
}
#[inline]
/// Verifies that a buffer of bytes contains a size prefixed
/// `SWR` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `size_prefixed_root_as_SWR_unchecked`.
pub fn size_prefixed_root_as_SWR(buf: &[u8]) -> Result<SWR, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::size_prefixed_root::<SWR>(buf)
}
#[inline]
/// Verifies, with the given options, that a buffer of bytes
/// contains a `SWR` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_SWR_unchecked`.
pub fn root_as_SWR_with_opts<'b, 'o>(
  opts: &'o flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<SWR<'b>, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::root_with_opts::<SWR<'b>>(opts, buf)
}
#[inline]
/// Verifies, with the given verifier options, that a buffer of
/// bytes contains a size prefixed `SWR` and returns
/// it. Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_SWR_unchecked`.
pub fn size_prefixed_root_as_SWR_with_opts<'b, 'o>(
  opts: &'o flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<SWR<'b>, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::size_prefixed_root_with_opts::<SWR<'b>>(opts, buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a SWR and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `SWR`.
pub unsafe fn root_as_SWR_unchecked(buf: &[u8]) -> SWR {
  flatbuffers::root_unchecked::<SWR>(buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed SWR and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `SWR`.
pub unsafe fn size_prefixed_root_as_SWR_unchecked(buf: &[u8]) -> SWR {
  flatbuffers::size_prefixed_root_unchecked::<SWR>(buf)
}
pub const SWR_IDENTIFIER: &str = "$SWR";

#[inline]
pub fn SWR_buffer_has_identifier(buf: &[u8]) -> bool {
  flatbuffers::buffer_has_identifier(buf, SWR_IDENTIFIER, false)
}

#[inline]
pub fn SWR_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
  flatbuffers::buffer_has_identifier(buf, SWR_IDENTIFIER, true)
}

#[inline]
pub fn finish_SWR_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
    fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
    root: flatbuffers::WIPOffset<SWR<'a>>) {
  fbb.finish(root, Some(SWR_IDENTIFIER));
}

#[inline]
pub fn finish_size_prefixed_SWR_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset<SWR<'a>>) {
  fbb.finish_size_prefixed(root, Some(SWR_IDENTIFIER));
}