Skip to content

Commit e277753

Browse files
authored
CoDICE: Lo counters (#2465)
1 parent 0130bd4 commit e277753

13 files changed

+682
-158
lines changed

imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml

Lines changed: 103 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ sw_bias_gain_mode:
298298
VAR_NOTES: Indicates whether FSW is tracking the Solarwind High-Gain bias curve or the Solarwind Low-Gain bias curve.
299299
VAR_TYPE: data
300300

301-
# The following are data product-specific
302-
# hi-counters-aggregated
303-
counters_aggregate: &counters_aggre_default
301+
# <=== Counter Variables Base Templates ===>
302+
# Shared base for all counter data (Hi & Lo)
303+
counters_base: &counters_base
304304
DEPEND_0: epoch
305305
DISPLAY_TYPE: time_series
306306
FILLVAL: *uint32_fillval
@@ -310,102 +310,86 @@ counters_aggregate: &counters_aggre_default
310310
VALIDMIN: 0
311311
VALIDMAX: *max_uint32
312312
VAR_TYPE: data
313+
314+
# <=== Hi-counters-aggregated ===>
315+
hi_counters_aggregated_default: &hi_counters_aggregated_default
316+
<<: *counters_base
313317
LABLAXIS: "events"
314318

315-
# This variable is common between Hi and Lo Counters data
316-
dcr:
317-
<<: *counters_aggre_default
319+
hi-dcr:
320+
<<: *hi_counters_aggregated_default
318321
CATDESC: Event B - Double Coincidence Rate (DCR)
319322
FIELDNAM: DCRs
320323

321-
starts_only:
322-
<<: *counters_aggre_default
324+
hi-starts_only:
325+
<<: *hi_counters_aggregated_default
323326
CATDESC: Event C - Start Only (STO)
324327
FIELDNAM: Start Only
325328

326-
stops_only:
327-
<<: *counters_aggre_default
329+
hi-stops_only:
330+
<<: *hi_counters_aggregated_default
328331
CATDESC: Event D - Stop Only (SPO)
329332
FIELDNAM: Stop Only
330333

331-
reserved:
332-
<<: *counters_aggre_default
333-
CATDESC: Reserved {index}
334-
FIELDNAM: Reserved {index}
335-
336-
mst:
337-
<<: *counters_aggre_default
334+
hi-mst:
335+
<<: *hi_counters_aggregated_default
338336
CATDESC: Event H - Multi Start (MST)
339337
FIELDNAM: Multi Start
340338

341-
singles_starts:
342-
<<: *counters_aggre_default
339+
hi-singles_starts:
340+
<<: *hi_counters_aggregated_default
343341
CATDESC: Singles - Start
344342
FIELDNAM: Singles - Start
345343

346-
singles_stops:
347-
<<: *counters_aggre_default
344+
hi-singles_stops:
345+
<<: *hi_counters_aggregated_default
348346
CATDESC: Singles - Stop
349347
FIELDNAM: Singles - Stop
350348

351-
# Next five variables are common between Hi and Lo Counters data
352-
low_tof_cutoff:
353-
<<: *counters_aggre_default
349+
hi-low_tof_cutoff:
350+
<<: *hi_counters_aggregated_default
354351
CATDESC: Low TOF Cutoff
355352
FIELDNAM: Low TOF Cutoff
356353

357-
asic1_flag_invalid:
358-
<<: *counters_aggre_default
354+
hi-asic1_flag_invalid:
355+
<<: *hi_counters_aggregated_default
359356
CATDESC: ASIC 1 Flag Invalid Count
360357
FIELDNAM: ASIC 1 Flag Invalid
361358

362-
asic2_flag_invalid:
363-
<<: *counters_aggre_default
359+
hi-asic2_flag_invalid:
360+
<<: *hi_counters_aggregated_default
364361
CATDESC: ASIC 2 Flag Invalid Count
365362
FIELDNAM: ASIC 2 Flag Invalid
366363

367-
asic1_channel_invalid:
368-
<<: *counters_aggre_default
364+
hi-asic1_channel_invalid:
365+
<<: *hi_counters_aggregated_default
369366
CATDESC: ASIC 1 Channel Invalid Count
370367
FIELDNAM: ASIC 1 Channel Invalid
371-
asic2_channel_invalid:
372-
<<: *counters_aggre_default
368+
hi-asic2_channel_invalid:
369+
<<: *hi_counters_aggregated_default
373370
CATDESC: ASIC 2 Channel Invalid Count
374371
FIELDNAM: ASIC 2 Channel Invalid
375372

376-
# hi-counters-singles
377-
counters_singles: &counters_singles_default
378-
DEPEND_0: epoch
379-
DISPLAY_TYPE: time_series
380-
FILLVAL: *uint32_fillval
381-
FORMAT: I7
382-
SCALETYP: linear
383-
UNITS: counts
384-
VALIDMIN: 0
385-
VALIDMAX: *max_uint32
386-
VAR_TYPE: data
373+
# <=== Hi-counters-singles ===>
374+
hi_counters_singles_default: &hi_counters_singles_default
375+
<<: *counters_base
376+
DEPEND_1: inst_az
377+
LABL_PTR_1: inst_az_label
387378

388-
# This variable is common between Hi and Lo Counters data
389-
tcr:
390-
<<: *counters_singles_default
379+
hi-tcr:
380+
<<: *hi_counters_singles_default
391381
CATDESC: Event A - Triple Coincidence Rate (TCR)
392382
FIELDNAM: Rates
393-
DEPEND_1: inst_az
394-
LABL_PTR_1: inst_az_label
395383

396-
ssdo:
397-
<<: *counters_singles_default
384+
hi-ssdo:
385+
<<: *hi_counters_singles_default
398386
CATDESC: Rates - Event E (SSDO)
399387
FIELDNAM: Rates
400-
DEPEND_1: inst_az
401-
LABL_PTR_1: inst_az_label
402388

403-
stssd:
404-
<<: *counters_singles_default
389+
hi-stssd:
390+
<<: *hi_counters_singles_default
405391
CATDESC: Rates - Event G (STSSD)
406392
FIELDNAM: Rates
407-
DEPEND_1: inst_az
408-
LABL_PTR_1: inst_az_label
409393

410394
# Hi omni and sectored Attributes
411395
hi-species-attrs:
@@ -510,124 +494,150 @@ priority5:
510494
CATDESC: Priority 5
511495
FIELDNAM: Priority 5
512496

513-
# lo-counters-aggregated
514-
lo_counters_aggregated: &lo_counters_aggregated_default
497+
# <=== Lo-counters-aggregated ===>
498+
lo_counters_aggregated_default: &lo_counters_aggregated_default
499+
<<: *counters_base
515500
DEPEND_0: epoch
516501
DEPEND_1: esa_step
517502
DEPEND_2: spin_sector_pairs
518-
DISPLAY_TYPE: time_series
519-
FILLVAL: *uint32_fillval
520-
FORMAT: I7
521-
LABLAXIS: "events"
522503
LABL_PTR_1: esa_step_label
523504
LABL_PTR_2: spin_sector_pairs_label
524-
SCALETYP: linear
525-
UNITS: counts
526-
VALIDMAX: *max_uint32
527-
VALIDMIN: 0
528-
VAR_TYPE: data
529505

530-
tof_plus_apd:
506+
lo-tcr:
507+
<<: *lo_counters_aggregated_default
508+
CATDESC: Triple Coincidence Rate (TCR)
509+
FIELDNAM: Event A - TCR
510+
511+
lo-dcr:
512+
<<: *lo_counters_aggregated_default
513+
CATDESC: Double Coincidence Rate (DCR)
514+
FIELDNAM: Event B - DCR
515+
516+
lo-low_tof_cutoff:
517+
<<: *lo_counters_aggregated_default
518+
CATDESC: Low TOF Cutoff
519+
FIELDNAM: Low TOF Cutoff
520+
521+
lo-low_tof_cutoff:
522+
<<: *lo_counters_aggregated_default
523+
CATDESC: Low TOF Cutoff
524+
FIELDNAM: Low TOF Cutoff
525+
526+
lo-asic1_flag_invalid:
527+
<<: *lo_counters_aggregated_default
528+
CATDESC: ASIC 1 Flag Invalid Count
529+
FIELDNAM: ASIC 1 Flag Invalid
530+
531+
lo-asic2_flag_invalid:
532+
<<: *lo_counters_aggregated_default
533+
CATDESC: ASIC 2 Flag Invalid Count
534+
FIELDNAM: ASIC 2 Flag Invalid
535+
536+
lo-asic1_channel_invalid:
537+
<<: *lo_counters_aggregated_default
538+
CATDESC: ASIC 1 Channel Invalid Count
539+
FIELDNAM: ASIC 1 Channel Invalid
540+
lo-asic2_channel_invalid:
541+
<<: *lo_counters_aggregated_default
542+
CATDESC: ASIC 2 Channel Invalid Count
543+
FIELDNAM: ASIC 2 Channel Invalid
544+
545+
lo-tof_plus_apd:
531546
<<: *lo_counters_aggregated_default
532547
CATDESC: TOF + APD
533548
FIELDNAM: Event C - TOF + APD
534549

535-
tof_only:
550+
lo-tof_only:
536551
<<: *lo_counters_aggregated_default
537552
CATDESC: TOF Only
538553
FIELDNAM: Event D - TOF Only
539554

540-
position_plus_apd:
555+
lo-position_plus_apd:
541556
<<: *lo_counters_aggregated_default
542557
CATDESC: Position + APD
543558
FIELDNAM: Event E - Position + APD
544559

545-
position_only:
560+
lo-position_only:
546561
<<: *lo_counters_aggregated_default
547562
CATDESC: Position Only
548563
FIELDNAM: Event F - Position Only
549564

550-
sta_or_stb_plus_apd:
565+
lo-sta_or_stb_plus_apd:
551566
<<: *lo_counters_aggregated_default
552567
CATDESC: STA or STB + APD
553568
FIELDNAM: Event G - STA or STB + APD
554569

555-
sta_or_stb_only:
570+
lo-sta_or_stb_only:
556571
<<: *lo_counters_aggregated_default
557572
CATDESC: STA or STB Only
558-
FIELDNAM: Event H - STA or STB Only
559-
560-
lo-reserved-attrs:
561-
<<: *lo_counters_aggregated_default
562-
CATDESC: Reserved
563-
FIELDNAM: Reserved {index}
573+
FIELDNAM: Event H - STA or STB Onlys
564574

565-
sp_only:
575+
lo-sp_only:
566576
<<: *lo_counters_aggregated_default
567577
CATDESC: SP Only
568578
FIELDNAM: Event K - SP Only
569579

570-
apd_only:
580+
lo-apd_only:
571581
<<: *lo_counters_aggregated_default
572582
CATDESC: APD Only
573583
FIELDNAM: Event L - APD Only
574584

575-
sta:
585+
lo-sta:
576586
<<: *lo_counters_aggregated_default
577587
CATDESC: Start A
578588
FIELDNAM: Singles - Start-A (STA)
579589

580-
stb:
590+
lo-stb:
581591
<<: *lo_counters_aggregated_default
582592
CATDESC: Start B
583593
FIELDNAM: Singles - Start-B (STB)
584594

585-
sp:
595+
lo-sp:
586596
<<: *lo_counters_aggregated_default
587597
CATDESC: Stop
588598
FIELDNAM: Singles - Stop (SP)
589599

590-
total_position_count:
600+
lo-total_position_count:
591601
<<: *lo_counters_aggregated_default
592602
CATDESC: Total Position Count
593603
FIELDNAM: Singles - Total Position Count
594604

595-
invalid_position_count:
605+
lo-invalid_position_count:
596606
<<: *lo_counters_aggregated_default
597607
CATDESC: Invalid Position Count
598608
FIELDNAM: Singles - Invalid Position Count
599609

600-
tec4_timeout_tof_no_pos:
610+
lo-tec4_timeout_tof_no_pos:
601611
<<: *lo_counters_aggregated_default
602612
CATDESC: TEC-4 Timeout TOF no Position
603613
FIELDNAM: TEC-4 Timeout Count; TOF, No Position
604614

605-
tec4_timeout_pos_no_tof:
615+
lo-tec4_timeout_pos_no_tof:
606616
<<: *lo_counters_aggregated_default
607617
CATDESC: TEC-4 Timeout Position no TOF
608618
FIELDNAM: TEC-4 Timeout Count; Position, No TOF
609619

610-
tec4_timeout_no_pos_tof:
620+
lo-tec4_timeout_no_pos_tof:
611621
<<: *lo_counters_aggregated_default
612622
CATDESC: TEC-4 Timeout No Position or TOF
613623
FIELDNAM: TEC-4 Timeout Count; No Position or TOF
614624

615-
tec5_timeout_tof_no_pos:
625+
lo-tec5_timeout_tof_no_pos:
616626
<<: *lo_counters_aggregated_default
617627
CATDESC: TEC-5 Timeout TOF no Position
618628
FIELDNAM: TEC-5 Timeout Count; TOF, No Position
619629

620-
tec5_timeout_pos_no_tof:
630+
lo-tec5_timeout_pos_no_tof:
621631
<<: *lo_counters_aggregated_default
622632
CATDESC: TEC-5 Timeout Position no TOF
623633
FIELDNAM: TEC-5 Timeout Count; Position, No TOF
624634

625-
tec5_timeout_no_pos_tof:
635+
lo-tec5_timeout_no_pos_tof:
626636
<<: *lo_counters_aggregated_default
627637
CATDESC: TEC-5 Timeout No Position or TOF
628638
FIELDNAM: TEC-5 Timeout Count; No Position or TOF
629639

630-
# lo-counters-singles
640+
# <=== Lo-counters-singles ===>
631641
lo_counters_singles:
632642
CATDESC: Single Rates (APD)
633643
DEPEND_0: epoch

imap_processing/codice/codice_l1a.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
from imap_processing.codice.codice_l1a_hi_priority import l1a_hi_priority
1818
from imap_processing.codice.codice_l1a_hi_sectored import l1a_hi_sectored
1919
from imap_processing.codice.codice_l1a_lo_angular import l1a_lo_angular
20+
from imap_processing.codice.codice_l1a_lo_counters_aggregated import (
21+
l1a_lo_counters_aggregated,
22+
)
23+
from imap_processing.codice.codice_l1a_lo_counters_singles import (
24+
l1a_lo_counters_singles,
25+
)
2026
from imap_processing.codice.codice_l1a_lo_priority import l1a_lo_priority
2127
from imap_processing.codice.codice_l1a_lo_species import l1a_lo_species
2228
from imap_processing.codice.utils import (
@@ -102,5 +108,13 @@ def process_l1a( # noqa: PLR0912
102108
elif apid == CODICEAPID.COD_HI_INST_COUNTS_SINGLES:
103109
logger.info("Processing Hi Counters singles")
104110
datasets.append(l1a_hi_counters_singles(datasets_by_apid[apid], lut_file))
111+
elif apid == CODICEAPID.COD_LO_INST_COUNTS_AGGREGATED:
112+
logger.info("Processing Lo Counters aggregated")
113+
datasets.append(
114+
l1a_lo_counters_aggregated(datasets_by_apid[apid], lut_file)
115+
)
116+
elif apid == CODICEAPID.COD_LO_INST_COUNTS_SINGLES:
117+
logger.info("Processing Lo Counters singles")
118+
datasets.append(l1a_lo_counters_singles(datasets_by_apid[apid], lut_file))
105119

106120
return datasets

0 commit comments

Comments
 (0)