Skip to content

Commit

Permalink
Refactor epoch attrs (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
tech3371 committed Jul 29, 2024
1 parent 687354b commit ca85cee
Show file tree
Hide file tree
Showing 32 changed files with 27 additions and 305 deletions.
5 changes: 0 additions & 5 deletions imap_processing/cdf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
from imap_processing.cdf.imap_cdf_manager import ImapCdfAttributes

# Load Epoch CDF attributes
cdf_manager = ImapCdfAttributes()
epoch_attrs = cdf_manager.get_variable_attributes("epoch")
16 changes: 0 additions & 16 deletions imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@ energy_attrs:
VALIDMAX: 127
VAR_TYPE: support_data

epoch_attrs:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

# <=== Labels ===>
energy_label:
CATDESC: Energy per charge (E/q) sweeping step
Expand Down
16 changes: 0 additions & 16 deletions imap_processing/cdf/config/imap_codice_l1b_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@ energy_attrs:
VALIDMAX: 127
VAR_TYPE: support_data

epoch_attrs:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

# <=== Labels ===>
energy_label:
CATDESC: Energy per charge (E/q) sweeping step
Expand Down
18 changes: 0 additions & 18 deletions imap_processing/cdf/config/imap_glows_l1a_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,6 @@ default_attrs: &default_attrs
FILLVAL: *int_fillval
VALIDMIN: *min_epoch

# Information found in cdf.config.global_attrs.py EPOCH, and cdf.defaults.py
epoch:
<<: *default_attrs
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
FILLVAL: *int_fillval # GlobalConstants.INT_FILLVAL,
LABLAXIS: epoch
FORMAT: "" # Supposedly not required, fails in xarray_to_cdf
UNITS: ns
VALIDMIN: *min_epoch # GlobalConstants.MIN_EPOCH
VALIDMAX: *max_epoch # GlobalConstants.MAX_EPOCH
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

# Information from glows_cdf_attrs.py
bins_attrs:
<<: *default_attrs
Expand Down
16 changes: 0 additions & 16 deletions imap_processing/cdf/config/imap_glows_l1b_variable_attrs.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
int_fillval: &int_fillval -9223372036854775808
valid_max: &valid_max 3155630469184000000

epoch_dim:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
FILLVAL: *int_fillval
LABLAXIS: epoch
FORMAT: ' ' # Supposedly not required fails in xarray_to_cdf
UNITS: ns
VALIDMIN: -315575942816000000
VALIDMAX: 3155630469184000000
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

default_attrs: &default
# Assumed values for all variable attrs unless overwritten
DEPEND_0: epoch
Expand Down
25 changes: 0 additions & 25 deletions imap_processing/cdf/config/imap_hi_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,6 @@ default_float32_attrs: &default_float32
VALIDMAX: 3.4028235e+38
dtype: float32

default_epoch: &default_epoch
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid
dtype: int64

default_ccsds_met: &hi_ccsds_met
<<: *default_uint32
CATDESC: CCSDS mission elapsed time (MET). 32-bit integer value that represents the MET in seconds.
Expand Down Expand Up @@ -104,10 +87,6 @@ hi_de_de_tag:
FIELDNAM: Direct Event Time Tag
LABLAXIS: DE Time Tag

hi_de_epoch:
<<: *default_epoch
CATDESC: Direct Event time, number of nanoseconds since J2000 with leap seconds included

hi_de_esa_stepping_num:
<<: *hi_esa_stepping_num

Expand Down Expand Up @@ -178,8 +157,6 @@ hi_de_tof_3:
the direct event. 1023 is the value used to indicate no event was registered.
# ======= L1A HIST Section =======
hi_hist_epoch:
<<: *default_epoch

hi_hist_angle:
SCALE_TYPE: linear
Expand Down Expand Up @@ -317,8 +294,6 @@ hi_de_nominal_bin:
VALIDMAX: 89

# ======= L1C PSET Section =======
hi_pset_epoch:
<<: *default_epoch

hi_pset_esa_step:
<<: *default_esa_step
Expand Down
16 changes: 0 additions & 16 deletions imap_processing/cdf/config/imap_hit_l1a_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,6 @@ hk_support_attrs: &support_default
VAR_TYPE: ignore_data

# <=== Coordinates ===>
epoch:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

adc_channels: # adc_channels is a dependency for leak_i data variable
DISPLAY_TYPE: no_plot
FILLVAL: -9223372036854775808
Expand Down
16 changes: 0 additions & 16 deletions imap_processing/cdf/config/imap_hit_l1b_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,6 @@ hk_support_attrs: &support_default
VAR_TYPE: ignore_data

# <=== Coordinates ===>
epoch:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

adc_channels: # adc_channels is a dependency for leak_i data variable
DISPLAY_TYPE: no_plot
FILLVAL: -9223372036854775808
Expand Down
17 changes: 0 additions & 17 deletions imap_processing/cdf/config/imap_idex_l1_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,6 @@ l1_target_base: &l1_target_base
<<: *l1_data_base
DEPEND_1: time_low_sr

epoch:
<<: *l1_data_base
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
FILLVAL: *int_fillval
LABLAXIS: epoch
FORMAT: "" # Supposedly not required, fails in xarray_to_cdf
UNITS: ns
VALIDMIN: *min_epoch
VALIDMAX: *max_epoch
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

sample_rate_base: &sample_rate_base
DISPLAY_TYPE: no_plot
CATDESC: ""
Expand Down
16 changes: 0 additions & 16 deletions imap_processing/cdf/config/imap_lo_l1a_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,6 @@ de_default_attrs: &de_default
DEPEND_1: direct_events
UNITS: ' '

epoch:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

# Re-used Coordinate
esa_step:
<<: *de_default
Expand Down
16 changes: 0 additions & 16 deletions imap_processing/cdf/config/imap_lo_l1b_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,6 @@ default_attrs: &default
VAR_TYPE: data
UNITS: ' '

epoch:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

direction_vec_label:
CATDESC: Directional vector for each direct event
FIELDNAM: Direction Vector (X, Y, Z)
Expand Down
16 changes: 0 additions & 16 deletions imap_processing/cdf/config/imap_lo_l1c_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,6 @@ default_attrs: &default
VAR_TYPE: data
UNITS: ' '

epoch:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

# Non-epoch Coordinates
esa_step_label:
CATDESC: ESA Steps
Expand Down
16 changes: 0 additions & 16 deletions imap_processing/cdf/config/imap_mag_l1_variable_attrs.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
epoch:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

default_attrs: &default
# Assumed values for all variable attrs unless overwritten
DEPEND_0: epoch
Expand Down
17 changes: 0 additions & 17 deletions imap_processing/cdf/config/imap_swe_l1a_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,6 @@ polar_angle_label:
FORMAT: A1
VAR_TYPE: metadata

# TODO: how to avoid repeating this?
epoch:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

# <=== Data Variables ===>
# Default Attrs for all data variables unless overridden

Expand Down
17 changes: 0 additions & 17 deletions imap_processing/cdf/config/imap_swe_l1b_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,6 @@ cem_label:
FORMAT: A1
VAR_TYPE: metadata

# TODO: how to avoid repeating this?
epoch:
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
FILLVAL: -9223372036854775808
FORMAT: " " # Supposedly not required, fails in xarray_to_cdf
VALIDMIN: -9223372036854775808
VALIDMAX: 9223372036854775807
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

# <=== Data Variables ===>
# Default Attrs for all data variables unless overridden

Expand Down
13 changes: 0 additions & 13 deletions imap_processing/cdf/config/imap_ultra_l1b_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ default_attrs: &default
VALIDMAX: 9223372036854775807
VAR_TYPE: data

epoch:
<<: *default
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

x_front:
<<: *default
CATDESC: x front position
Expand Down
13 changes: 0 additions & 13 deletions imap_processing/cdf/config/imap_ultra_l1c_variable_attrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ default_attrs: &default
VALIDMAX: 9223372036854775807
VAR_TYPE: data

epoch:
<<: *default
CATDESC: Time, number of nanoseconds since J2000 with leap seconds included
FIELDNAM: epoch
LABLAXIS: epoch
UNITS: ns
VAR_TYPE: support_data
SCALETYP: linear
MONOTON: INCREASE
TIME_BASE: J2000
TIME_SCALE: Terrestrial Time
REFERENCE_POSITION: Rotating Earth Geoid

spin_angle:
<<: *default
CATDESC: Angular bin defined by central location of the bin
Expand Down
Loading

0 comments on commit ca85cee

Please sign in to comment.