Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use copier #4

Closed
wants to merge 26 commits into from
Closed

Conversation

agoose77
Copy link
Contributor

@agoose77 agoose77 commented Oct 9, 2023

No description provided.

diff --git a/{{project_name}}/schemas/README.md b/{{project_name}}/schemas/README.md
new file mode 100644
index 0000000..ec57ea8
--- /dev/null
+++ b/{{project_name}}/schemas/README.md
@@ -0,0 +1 @@
+# Schemas
diff --git a/{{project_name}}/schemas/animal.ksy b/{{project_name}}/schemas/animal.ksy
deleted file mode 100644
index d8878c5..0000000
--- a/{{project_name}}/schemas/animal.ksy
+++ /dev/null
@@ -1,30 +0,0 @@
-
-meta:
-  id: animal
-  endian: le
-  license: CC0-1.0
-  ks-version: 0.8
-
-seq:
-
-  - id: entry
-    type: animal_entry
-    repeat: eos
-
-types:
-
-  animal_entry:
-    seq:
-      - id: str_len
-        type: u1
-
-      - id: species
-        type: str
-        size: str_len
-        encoding: UTF-8
-
-      - id: age
-        type: u1
-
-      - id: weight
-        type: u2
diff --git a/{{project_name}}/schemas/fake.ksy b/{{project_name}}/schemas/fake.ksy
deleted file mode 100644
index 6e3f33f..0000000
--- a/{{project_name}}/schemas/fake.ksy
+++ /dev/null
@@ -1,19 +0,0 @@
-meta:
-  id: fake
-  file-extension: raw
-  endian: le
-
-seq:
-  - id: points
-    type: point
-    repeat: eos
-
-types:
-  point:
-    seq:
-      - id: x
-        type: u4
-      - id: y
-        type: u4
-      - id: z
-        type: u4
\ No newline at end of file
diff --git a/{{project_name}}/schemas/lists.ksy b/{{project_name}}/schemas/lists.ksy
deleted file mode 100644
index ad6cb29..0000000
--- a/{{project_name}}/schemas/lists.ksy
+++ /dev/null
@@ -1,24 +0,0 @@
-meta:
-  id: lists
-  file-extension: lists
-  endian: le
-
-seq:
-  - id: sample_blk
-    type: sample_block
-    repeat: eos
-
-types:
-  sample_block:
-    seq:
-      - id: num_sample
-        type: u4
-      - id: sample
-        type: example
-        repeat: expr
-        repeat-expr: num_sample
-    types:
-      example:
-        seq:
-          - id: num_example
-            type: u4
\ No newline at end of file
diff --git a/{{project_name}}/schemas/midas.ksy b/{{project_name}}/schemas/midas.ksy
deleted file mode 100644
index dc55fa4..0000000
--- a/{{project_name}}/schemas/midas.ksy
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-meta:
-  id: midas
-  file-extension: mid
-  endian: le
-  license: MIT
-  ks-version: 0.8
-
-  imports:
-    - scdms
-
-seq:
-
-  - id: n_events
-    type: event
-    repeat: eos
-
-types:
-
-  event:
-    seq:
-      - id: event_header
-        type: event_hdr
-
-      - id: data_block
-        type:
-          switch-on: event_header.event_id
-          cases:
-            0x8000: odb_dump
-            0x8001: odb_dump
-            _: event_data
-
-
-  # Header for each event in the file
-  event_hdr:
-    seq:
-      - id: event_id
-        type: u2
-      - id: trigger_mask
-        type: u2
-      - id: serial_number
-        type: u4
-      - id: time_stamp
-        type: u4
-      - id: evt_data_size
-        type: u4
-
-  # probably just need the size of the odb dump for now, that comes from
-  # the event header so we access that value by using the _parent attribute to
-  # go up a level to the parent of odb_dump (event) and then back down into
-  # the event_header
-  odb_dump:
-    seq:
-      - id: odb
-        size: _parent.event_header.evt_data_size
-
-
-  event_data:
-    seq:
-      - id: bank_header
-        type: bank_hdr
-
-      - id: bank
-        type:
-          switch-on: (bank_header.flags & (1 << 4))
-          cases:
-            0: bank16
-            _: bank32
-
-  bank_hdr:
-    seq:
-      - id: all_bank_size
-        type: u4
-      - id: flags
-        type: u4
-
-  bank16:
-    seq:
-      - id: name
-        type: str
-        size: 4
-        encoding: UTF-8
-
-      - id: type
-        type: u2
-
-      - id: size
-        type: u2
-
-        # finally, the data portion of the bank is the scdms data as
-        # defined in scdms.ksy
-      - id: data
-        type: scdms
-
-  bank32:
-    seq:
-      - id: name
-        type: str
-        size: 4
-        encoding: UTF-8
-
-      - id: type
-        type: u4
-
-      - id: size
-        type: u4
-
-      - id: data
-        type: scdms
diff --git a/{{project_name}}/schemas/numpy.ksy b/{{project_name}}/schemas/numpy.ksy
deleted file mode 100644
index 94e00b5..0000000
--- a/{{project_name}}/schemas/numpy.ksy
+++ /dev/null
@@ -1,9 +0,0 @@
-meta:
-  id: numpy
-  file-extension: numpy
-  endian: le
-
-seq:
-  - id: numpy_array
-    type: u4
-    repeat: eos
\ No newline at end of file
diff --git a/{{project_name}}/schemas/pixie4e.ksy b/{{project_name}}/schemas/pixie4e.ksy
deleted file mode 100644
index 14abecb..0000000
--- a/{{project_name}}/schemas/pixie4e.ksy
+++ /dev/null
@@ -1,152 +0,0 @@
-meta:
-  id: pixie4e
-  file-extension: b00
-  endian: le
-  ks-version: 0.8
-
-seq:
-
-  - id: file_header
-    type: pixie4e_header
-
-  - id: events
-    type: event
-    size: _io.size - 128
-
-  - id: file_footer
-    type: pixie_eor
-
-
-types:
-
-  pixie4e_header:
-    seq:
-      - id: blk_size
-        type: u2
-
-      - id: mod_num
-        type: u2
-
-      - id: run_format
-        type: u2
-
-      - id: chan_head_len
-        type: u2
-
-      - id: coinc_pat
-        type: u2
-
-      - id: coinc_win
-        type: u2
-
-      - id: max_comb_event_len
-        type: u2
-
-      - id: board_version
-        type: u2
-
-      - id: event_length_0
-        type: u2
-
-      - id: event_length_1
-        type: u2
-
-      - id: event_length_2
-        type: u2
-
-      - id: event_length_3
-        type: u2
-
-      - id: serial_number
-        type: u2
-
-      - id: reserved
-        type: u2
-
-
-  event:
-    seq:
-      - id: elements
-        type: element
-        repeat: eos
-
-
-  element:
-    seq:
-      - id: header
-        type: channel_header
-
-      - id: data
-        type: u2
-        repeat: expr
-        repeat-expr: header.num_trace_blks * _root.file_header.blk_size
-
-
-  channel_header:
-    seq:
-      - id: evt_pattern
-        type: u2
-
-      - id: evt_info
-        type: u2
-
-      - id: num_trace_blks
-        type: u2
-
-      - id: num_trace_blks_prev
-        type: u2
-
-      - id: trig_time_lo
-        type: u2
-
-      - id: trig_time_mi
-        type: u2
-
-      - id: trig_time_hi
-        type: u2
-
-      - id: trig_time_x
-        type: u2
-
-      - id: energy
-        type: u2
-
-      - id: chan_no
-        type: u2
-
-      - id: user_psa_value
-        type: u2
-
-      - id: xia_psa_value
-        type: u2
-
-      - id: extended_psa_values
-        type: u2
-        repeat: expr
-        repeat-expr: 0x4
-
-      - id: reserved
-        type: u2
-        repeat: expr
-        repeat-expr: 0x10
-
-    instances:
-      timestamp_full:
-        value: trig_time_lo + (trig_time_mi << 16) + (trig_time_hi << 32)
-
-  pixie_eor:
-     seq:
-       - id: evt_pattern
-         type: u2
-
-       - id: evt_info
-         type: u2
-
-       - id: num_trace_blks
-         type: u2
-
-       - id: num_trace_blks_prev
-         type: u2
-
-       - id: reserved
-         type: u2
diff --git a/{{project_name}}/schemas/records.ksy b/{{project_name}}/schemas/records.ksy
deleted file mode 100644
index c364154..0000000
--- a/{{project_name}}/schemas/records.ksy
+++ /dev/null
@@ -1,21 +0,0 @@
-meta:
-  id: records
-  file-extension: raw
-  endian: le
-
-seq:
-  - id: points
-    type: point
-    repeat: eos
-
-types:
-  point:
-    seq:
-      - id: x
-        type: x_point
-        repeat: eos
-    types:
-      x_point:
-        seq:
-          - id: a
-            type: f8
\ No newline at end of file
diff --git a/{{project_name}}/schemas/scdms.ksy b/{{project_name}}/schemas/scdms.ksy
deleted file mode 100644
index c4fcdc9..0000000
--- a/{{project_name}}/schemas/scdms.ksy
+++ /dev/null
@@ -1,409 +0,0 @@
-meta:
-  id: scdms
-  #file-extension: NOTE - The scdms format is encapsulated
-  # within a midas file so it won't have its own extension
-  endian: le
-  license: MIT
-  ks-version: 0.8
-
-seq:
-
-  - id: scdms_hdr
-    type: scdms_header
-
-  - id: n_triggers
-    type:
-      switch-on: scdms_hdr.format_version
-      cases:
-        1: v_one_trigger
-        2: v_two_trigger
-    repeat: expr # repeat for the number of triggers read
-    repeat-expr: scdms_hdr.total_triggers
-
-  - id: scdms_footer
-    type: trailer
-
-
-enums:
-
-  headers:
-    0x9:
-      id: scdms_hdr
-    0x5:
-      id: trigger_hdr
-    0x7:
-      id: primitive_hdr
-    0x6:
-      id: prim_dcrc_hdr
-    0x3:
-      id: detector_hdr
-    0x2:
-      id: dcrc_hdr
-    0x4:
-      id: readout_hdr
-    0x0:
-      id: channel_hdr
-    0x1:
-      id: waveform_hdr
-    0x8:
-      id: trailer
-
-  trigger_types:
-    1:
-      id: physics # trigger based on L1 primitives
-    2:
-      id: borr    # begin of run randoms
-    3:
-      id: irr     # in run randoms
-    4:
-      id: eorr    # end of run randoms
-    5:
-      id: bcr     # baseline control randoms
-    6:
-      id: borts   # begin of run test signal
-    7:
-      id: eorts   # end of run test signal
-
-types:
-
-  scdms_header:
-
-    seq:
-      - id: packed
-        type: u4
-
-    instances:
-
-      overall_header:
-        value: ((packed & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-      total_triggers:
-        value: (packed & 0x00_00_0f_ff)
-
-      format_version:
-        value: ((packed & 0x0f_ff_f0_00) >> 12)
-
-  v_one_trigger:
-    seq:
-      - id: trigger_meta
-        type: v_one_trig_meta
-
-      - id: n_primitives
-        type: primitive
-        repeat: expr # repeat for number of primitives
-        repeat-expr: trigger_meta.num_primitives
-
-      - id: packed
-        type: u4
-
-      - id: n_detectors
-        type: detector
-        repeat: expr # repeat for the number of detectors
-        repeat-expr: detectors_in_event
-
-    instances:
-      detectors_in_event:
-        value: (packed & 0x0f_ff_ff_ff)
-
-      det_header:
-        value: ((packed & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-  v_two_trigger:
-    seq:
-      - id: trigger_meta
-        type: v_two_trig_meta
-
-      - id: n_primitives
-        type: primitive
-        repeat: expr # repeat for number of primitives
-        repeat-expr: trigger_meta.num_primitives
-
-      - id: packed
-        type: u4
-
-      - id: n_detectors
-        type: detector
-        repeat: expr # repeat for the number of detectors
-        repeat-expr: detectors_in_event
-
-    instances:
-      detectors_in_event:
-        value: (packed & 0x0f_ff_ff_ff)
-
-      det_header:
-        value: ((packed & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-  v_one_trig_meta:
-    seq:
-
-      - id: packed_1
-        type: u4
-
-      - id: trigger_id
-        type: u4
-
-      - id: trigger_type
-        type: u4
-        enum: trigger_types
-
-      - id: global_timestamp_low
-        type: u4
-
-      - id: global_timestamp_high
-        type: u4
-
-      - id: packed_2
-        type: u4
-
-      - id: length_of_entry
-        type: u4
-        doc: Length of Entry in Bytes
-
-    instances:
-      event_size:
-        value: (packed_1 & 0x0f_ff_ff_ff)
-
-      trig_header:
-        value: ((packed_1 & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-      num_primitives:
-        value: (packed_2 & 0x0f_ff_ff_ff)
-
-      prim_header:
-        value: ((packed_1 & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-  v_two_trig_meta:
-    seq:
-
-      - id: packed_1
-        type: u4
-
-      - id: trigger_id
-        type: u4
-
-      - id: event_number
-        type: u4
-
-      - id: packed_2
-        type: u4
-
-      - id: global_timestamp_low
-        type: u4
-
-      - id: global_timestamp_high
-        type: u4
-
-      - id: packed_3
-        type: u4
-
-      - id: length_of_entry
-        type: u4
-        doc: Length of Entry in Bytes
-
-
-    instances:
-
-      # Values parsed from packed_1
-      trig_header:
-        value: ((packed_1 & 0xf0_00_00_00) >> 28)
-        enum: headers
-      event_size:
-        value: (packed_1 & 0x0f_ff_ff_ff)
-
-      # Values parsed from packed_2
-      trigger_type:
-        value: (packed_2 & 0x00_00_00_0f)
-        enum: trigger_types
-      readout_bitmask:
-        value: ((packed_2 & 0xff_ff_ff_00) >> 8)
-
-      # Values parsed from packed_3
-      num_primitives:
-        value: (packed_3 & 0x0f_ff_ff_ff)
-      prim_header:
-        value: ((packed_3 & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-
-  primitive:
-    seq:
-
-      - id: packed_1
-        type: u4
-
-      - id: ut
-        type: u4
-
-      - id: packed_2
-        type: u4
-
-      - id: rt_run_time
-        type: u2
-      - id: trig_time
-        type: u2
-
-      - id: packed_3
-        type: u4
-
-      - id: peak_amplitude
-        type: u2
-      - id: trig_word
-        type: u2
-
-    instances:
-
-      # Values parsed from packed_1
-      index:
-        value: (packed_1 & 0x00_00_00_03)
-      det_id:
-        value: ((packed_1 & 0x00_00_03_fc) >> 2)
-      pileup:
-        value: ((packed_1 & 0x00_00_0c_00) >> 10)
-      trig_status:
-        value: ((packed_1 & 0x00_00_f0_00) >> 12)
-      prim_dcrc_header:
-        value: ((packed_1 & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-      # Value parsed from packed_2
-      rt_time_fraction:
-        value: (packed_2 & 0x00_ff_ff_ff)
-
-      # Values parsed from packed_3
-      trig_time_fraction:
-        value: (packed_3 & 0x00_ff_ff_ff)
-      mask_pairs:
-        value: ((packed_3 & 0xff_00_00_00) >> 24)
-
-
-  detector:
-    seq:
-
-      - id: detector_meta
-        type: det_meta
-
-      - id: n_channels
-        type: channel
-        repeat: expr # repeat for the number of chanels
-        repeat-expr: detector_meta.num_channels_to_follow
-
-  det_meta:
-    seq:
-
-      - id: packed_1
-        type: u4
-
-      - id: dcrc0_version
-        type: u1
-
-      - id: dcrc0_serial_num
-        type: u1
-
-      - id: dcrc1_version
-        type: u1
-
-      - id: dcrc1_serial_num
-        type: u1
-
-      - id: packed_2
-        type: u4
-
-      - id: packed_3
-        type: u4
-
-      - id: packed_4
-        type: u4
-
-    instances:
-
-      # Values parsed from packed_1
-      index:
-        value: (packed_1 & 0x00_00_00_03)
-
-      det_id:
-        value: ((packed_1 & 0x00_00_03_fc) >> 2)
-
-      det_type:
-        value: ((packed_1 & 0x0f_ff_fc_00) >> 10)
-
-      dcrc_header:
-        value: ((packed_1 & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-      # Values parsed from packed_2
-      series_time:
-        value: (packed_2 & 0x00_00_ff_ff)
-
-      readout_status:
-        value: ((packed_2 & 0x0f_ff_00_00) >> 16)
-
-      readout_header:
-        value: ((packed_2 & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-      # Values parsed from packed_3
-      series_time_fraction:
-        value: (packed_3 & 0x00_ff_ff_ff)
-
-      # Values parsed from packed_4
-      num_channels_to_follow:
-        value: (packed_4 & 0x0f_ff_ff_ff)
-
-      channel_header:
-        value: ((packed_4 & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-  channel:
-    seq:
-
-      - id: packed
-        type: u4
-
-      - id: n_pre_pulse_samples
-        type: u4  # 4 byte unsigned integer
-      - id: n_on_pulse_samples
-        type: u4
-      - id: n_post_pulse_samples
-        type: u4
-      - id: sample_rate_low
-        type: u2
-      - id: sample_rate_high
-        type: u2
-      - id: sample
-        type: u2
-        repeat: expr
-        repeat-expr: n_pre_pulse_samples + n_on_pulse_samples + n_post_pulse_samples
-
-    instances:
-
-      ch_type:
-        value: (packed & 0x00_00_00_03)
-
-      ch_num:
-        value: ((packed & 0x00_00_00_3c) >> 2)
-
-      pre_trigger_offset:
-        value: ((packed & 0x0f_ff_ff_c0) >> 6)
-
-      chnl_header:
-        value: ((packed & 0xf0_00_00_00) >> 28)
-        enum: headers
-
-  trailer:
-    seq:
-
-      - id: packed
-        type: u4
-
-    instances:
-
-      n_preceeding_triggers:
-        value: (packed & 0x0f_ff_ff_ff)
-      trailer_header:
-        value: ((packed & 0xf0_00_00_00) >> 28)
-        enum: headers
\ No newline at end of file
diff --git a/{{project_name}}/schemas/scdms_v8.ksy b/{{project_name}}/schemas/scdms_v8.ksy
deleted file mode 100644
index 2f033c5..0000000
--- a/{{project_name}}/schemas/scdms_v8.ksy
+++ /dev/null
@@ -1,480 +0,0 @@
-meta:
-  id: test
-  endian: le
-
-enums:
-
-  trigger_types:
-    1:
-      id: physics # trigger based on L1 primitives
-    2:
-      id: borr    # begin of run randoms
-    3:
-      id: irr     # in run randoms
-    4:
-      id: eorr    # end of run randoms
-    5:
-      id: bcr     # baseline control randoms
-    6:
-      id: borts   # begin of run test signal
-    7:
-      id: eorts   # end of run test signal
-
-seq:
-  - id: odb_hdr
-    type: u2
-  - id: unknown
-    size: 10
-  - id: odb_size
-    type: u4
-  - id: odb
-    size: odb_size
-
-  - id: entry
-    type: entry_block
-    repeat: eos
-
-types:
-
-  entry_block:
-    seq:
-      - id: midas_hdr
-        type: midas_header
-
-      - id: scdms_data
-        type: scdms_data_block
-        if: midas_hdr.bank_name == "SCD0"
-      - id: dmc_data
-        size: midas_hdr.bank_size
-        if: midas_hdr.bank_name == "DMC0"
-      - id: data
-        size: midas_hdr.bank_size
-        if: midas_hdr.bank_name != "SCD0" and midas_hdr.bank_name != "DMC0"
-
-
-  midas_header:
-    seq:
-      - id: evt_id
-        type: u2
-      - id: trigger_mask
-        type: u2
-      - id: serial_number
-        type: u4
-      - id: time_stamp
-        type: u4
-      - id: evt_data_size
-        type: u4
-      - id: all_banks_size
-        type: u4
-      - id: flags
-        type: u4
-      - id: bank_name
-        type: str
-        size: 4
-        encoding: utf-8
-      - id: type
-        type: u4
-      - id: bank_size
-        type: u4
-
-  scdms_data_block:
-    seq:
-      - id: scdms_hdr
-        type: scdms_header
-      - id: trigger_blk
-        type: trigger_block
-        repeat: expr
-        repeat-expr: scdms_hdr.total_triggers
-      - id: scdms_ftr
-        type: scdms_footer
-
-  scdms_header:
-
-    seq:
-      - id: packed
-        type: u4
-
-    instances:
-
-      overall_header:
-        value: ((packed & 0xf0_00_00_00) >> 28)
-
-      total_triggers:
-        value: (packed & 0x00_00_0f_ff)
-
-      format_version:
-        value: ((packed & 0x0f_ff_f0_00) >> 12)
-
-  trigger_block:
-    seq:
-    - id: event_hdr
-      type: event_header
-    - id: num_primitive_hdr
-      type: num_primitive_header
-    - id: primitive_blk
-      type: primitive_block
-      repeat: expr
-      repeat-expr: num_primitive_hdr.num_primitives
-    - id: n_detectors
-      type: detectors
-    - id: detector_blk
-      type: detector_block
-      repeat: expr
-      repeat-expr: n_detectors.detectors_in_event
-    - id: sdu_primitive_hdr
-      type: sdu_primitive_header
-    - id: sdu_primitive_blk
-      type: sdu_primitive_block
-      repeat: expr
-      repeat-expr: sdu_primitive_hdr.num_sdu_primitives
-    - id: num_sdu_hdr
-      type: num_sdu_header
-    - id: sdu_blk
-      type: sdu_block
-      #if: num_sdu_hdr.num_sdu != 0
-      repeat: expr
-      repeat-expr: num_sdu_hdr.num_sdu
-
-  event_header:
-
-    seq:
-      - id: packed_event_size
-        type: u4
-      - id: trigger_id
-        type: u4
-      - id: event_number
-        type: u4
-      - id: packed_type
-        type: u4
-      - id: global_timestamp_low
-        type: u4
-      - id: global_timestamp_high
-        type: u4
-      - id: packed_poll_end
-        type: u4
-      - id: poll_time_fraction
-        type: u4
-
-    instances:
-
-      # Values parsed from packed_event_size
-      trig_header:
-        value: ((packed_event_size & 0xf0_00_00_00) >> 28)
-      event_size:
-        value: (packed_event_size & 0x0f_ff_ff_ff)
-
-      # Values parsed from packed_type
-      trigger_type:
-        value: (packed_type & 0x00_00_00_0f)
-        enum: trigger_types
-      readout_bitmask:
-        value: ((packed_type & 0xff_ff_ff_00) >> 8)
-
-      # Values parsed from packed_poll_end
-      poll_cycle_end_time:
-        value: (packed_poll_end & 0x00_00_ff_ff)
-
-  num_primitive_header:
-    seq:
-      - id: packed_primitive_num
-        type: u4
-      - id: entry_length
-        type: u4
-
-    instances:
-      # Values parsed from packed_primitive_num
-      num_primitives:
-        value: (packed_primitive_num & 0x0f_ff_ff_ff)
-      prim_header:
-        value: ((packed_primitive_num & 0xf0_00_00_00) >> 28)
-
-  primitive_block:
-    seq:
-      - id: packed_primitive
-        type: u4
-      - id: rt_issue_time
-        type: u4
-      - id: rt_run_time_fraction_packed
-        type: u4
-      - id: prim_trig_time
-        type: u2
-      - id: rt_run_time
-        type: u2
-      - id: trigger_mask_packed
-        type: u4
-      - id: trig_word
-        type: u2
-      - id: prim_blank
-        type: u2
-      - id: peak_amplitude
-        type: u4
-
-    instances:
-      # Values parsed from packed_primitive
-      trig_status:
-        value: ((packed_primitive & 0x00_00_f0_00) >> 12)
-      index:
-        value: (packed_primitive & 0x00_00_00_03)
-      det_id:
-        value: ((packed_primitive & 0x00_00_03_fc) >> 2)
-      pileup:
-        value: ((packed_primitive & 0x00_00_0c_00) >> 10)
-      prim_dcrc_header:
-        value: ((packed_primitive & 0xf0_00_00_00) >> 28)
-
-      # Values parsed from rt_run_time_fraction_packed
-      rt_run_time_fraction:
-        value: (rt_run_time_fraction_packed & 0x00_ff_ff_ff)
-
-      # Values parsed from trigger_mask_packed
-      trig_mask:
-        value: ((trigger_mask_packed & 0xff_00_00_00) >> 24)
-      trig_time_frac:
-        value: (trigger_mask_packed & 0x00_ff_ff_ff)
-
-  detectors:
-    seq:
-      - id: n_detectors_packed
-        type: u4
-
-    instances:
-      detectors_in_event:
-        value: (n_detectors_packed & 0x0f_ff_ff_ff)
-
-      num_det_header:
-        value: ((n_detectors_packed & 0xf0_00_00_00) >> 28)
-
-  detector_block:
-    seq:
-      - id: detector_hdr
-        type: detector_header
-      - id: readout_hdr
-        type: readout_header
-      - id: num_channels_hdr
-        type: num_channels_header
-      - id: channel_blk
-        type: channel_block
-        repeat: expr
-        repeat-expr: num_channels_hdr.num_channels
-
-  detector_header:
-    seq:
-      - id: detector_hdr_packed
-        type: u4
-      - id: dcrc1_serial_nbr
-        type: u1
-      - id: dcrc1_version
-        type: u1
-      - id: dcrc2_serial_nbr
-        type: u1
-      - id: dcrc2_version
-        type: u1
-
-    instances:
-      detector_type:
-        value: ((detector_hdr_packed & 0x0f_ff_fc_00) >> 10)
-      index:
-        value: (detector_hdr_packed & 0x00_00_00_03)
-      det_id:
-        value: ((detector_hdr_packed & 0x00_00_03_fc) >> 2)
-      detector_header:
-        value: ((detector_hdr_packed & 0xf0_00_00_00) >> 28)
-
-  readout_header:
-    seq:
-      - id: readout_hdr_packed_1
-        type: u4
-      - id: readout_hdr_packed_2
-        type: u4
-      - id: waveform_read_start_time
-        type: u2
-      - id: waveform_read_end_time
-        type: u2
-      - id: waveform_read_start_time_fraction
-        type: u4
-      - id: waveform_read_end_time_fraction
-        type: u4
-
-    instances:
-      readout_header:
-        value: ((readout_hdr_packed_1 & 0xf0_00_00_00) >> 28)
-      readout_status:
-        value: ((readout_hdr_packed_1 & 0x0f_ff_00_00) >> 16)
-      series_time:
-        value: (readout_hdr_packed_1 & 0x00_00_ff_ff)
-
-      has_thermometry_readout:
-        value: ((readout_hdr_packed_2 & 0x10_00_00_00) >> 31)
-      series_time_fraction:
-        value: (readout_hdr_packed_2 & 0x00_00_ff_ff)
-
-  num_channels_header:
-    seq:
-      - id: num_channels_packed
-        type: u4
-
-    instances:
-      channels_header:
-        value: ((num_channels_packed & 0xf0_00_00_00) >> 28)
-      num_channels:
-        value: (num_channels_packed & 0x0f_ff_ff_ff)
-
-  channel_block:
-    seq:
-      - id: channel_packed
-        type: u4
-      - id: num_pre_pulse_samples
-        type: u4
-      - id: num_on_pulse_samples
-        type: u4
-      - id: num_post_pulse_samples
-        type: u4
-      - id: sample_rate
-        type: u2
-      - id: downsample_factor
-        type: u2
-      - id: sample
-        type: u2
-        repeat: expr
-        repeat-expr: num_pre_pulse_samples + num_on_pulse_samples + num_post_pulse_samples
-
-    instances:
-      channel_flag:
-        value: ((channel_packed & 0xf0_00_00_00) >> 28)
-      pre_trigger_offset:
-        value: ((channel_packed & 0x0f_ff_ff_c0) >> 7)
-      channel_num:
-        value: ((channel_packed & 0x00_00_00_3c) >> 2)
-      has_baseline_control:
-        value: ((channel_packed & 0x00_00_00_02) >> 1)
-      channel_type:
-        value: (channel_packed & 0x00_00_00_01)
-
-  sdu_primitive_header:
-    seq:
-      - id: sdu_num_primitive_packed
-        type: u4
-      - id: sdu_entry_length
-        type: u4
-
-    instances:
-      sdu_header:
-        value: ((sdu_num_primitive_packed & 0xf0_00_00_00) >> 28)
-
-      num_sdu_primitives:
-        value: (sdu_num_primitive_packed & 0x07_ff_ff_ff)
-
-      has_sdu_data:
-        value: ((sdu_num_primitive_packed & 0x01_00_00_00) >> 27)
-
-  sdu_primitive_block:
-    seq:
-      - id: sdu_block_header
-        type: u4
-      - id: rt_issue_ut
-        type: u4
-      - id: rt_run_time_fraction_packed
-        type: u4
-      - id: trigger_time
-        type: u2
-      - id: rt_run_time
-        type: u2
-      - id: trigger_time_fraction_packed
-        type: u4
-      - id: trigger_word
-        type: u2
-      - id: blank
-        type: u4
-      - id: peak_amplitude
-        type: u2
-
-    instances:
-      rt_run_time_fraction:
-        value: (rt_run_time_fraction_packed & 0x00_ff_ff_ff)
-
-      trigger_time_fraction:
-        value: (trigger_time_fraction_packed & 0x00_ff_ff_ff)
-
-  num_sdu_header:
-    seq:
-      - id: num_sdu_packed
-        type: u4
-
-    instances:
-      num_sdu:
-        value: (num_sdu_packed & 0x0f_ff_ff_ff)
-      num_sdu_flag:
-        value: ((num_sdu_packed & 0xf0_00_00_00) >> 28)
-
-  sdu_block:
-    seq:
-      - id: sdu_readout_header_packed
-        type: u4
-      - id: sdu_series_time_fraction_packed
-        type: u4
-      - id: sdu_read_start_time
-        type: u2
-      - id: sdu_read_end_time
-        type: u2
-      - id: sdu_read_start_time_fraction
-        type: u4
-      - id: sdu_read_end_time_fraction
-        type: u4
-      - id: sdu_num_channels_header_packed
-        type: u4
-      - id: sdu_channel_blk
-        type: sdu_channel_block
-        repeat: expr
-        repeat-expr: num_sdu_channels
-
-    instances:
-      sdu_readout_flag:
-        value: ((sdu_readout_header_packed & 0xf0_00_00_00) >> 28)
-      sdu_readout_status:
-        value: ((sdu_readout_header_packed & 0x0f_ff_00_00) >> 16)
-      sdu_series_time:
-        value: (sdu_readout_header_packed & 0x00_00_ff_ff)
-      sdu_series_time_fraction:
-        value: (sdu_readout_header_packed & 0x00_ff_ff_ff)
-
-      num_sdu_channels:
-        value: (sdu_num_channels_header_packed & 0x0f_ff_ff_f)
-      num_sdu_channels_flag:
-        value: ((sdu_num_channels_header_packed & 0xf0_00_00_00) >> 28)
-
-  sdu_channel_block:
-    seq:
-      - id: sdu_channel_header_packed
-        type: u4
-      - id: sdu_num_samples
-        type: u4
-      - id: blank
-        type: u2
-      - id: sample_rate
-        type: u2
-        doc: kHz
-      - id: sdu_channel_sample
-        type: u2
-        repeat: expr
-        repeat-expr: sdu_num_samples
-
-    instances:
-      sdu_channel_flag:
-        value: ((sdu_channel_header_packed & 0xf0_00_00_00) >> 28)
-      sdu_pre_trigger_offset:
-        value: ((sdu_channel_header_packed & 0x0f_ff_ff_c0) >> 7)
-      sdu_channel_type:
-        value: ((sdu_channel_header_packed & 0x00_00_00_38) >> 3)
-      sdu_channel_num:
-        value: (sdu_channel_header_packed & 0x00_00_00_07)
-
-  scdms_footer:
-    seq:
-      - id: preceeding_triggers_packed
-        type: u4
-
-    instances:
-      preceeding_triggers_flag:
-        value: ((preceeding_triggers_packed & 0xf0_00_00_00) >> 28)
-      preceeding_triggers_num:
-        value: (preceeding_triggers_packed & 0x0f_ff_ff_ff)
\ No newline at end of file
diff --git a/{{project_name}}/test-animal.cpp b/{{project_name}}/test-animal.cpp
deleted file mode 100644
index af5414c..0000000
--- a/{{project_name}}/test-animal.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-// ./kaitai-struct-compiler -t cpp_stl --outdir src-animal schemas/animal.ksy
-// g++ -DKS_STR_ENCODING_NONE -Ikaitai_struct_cpp_stl_runtime -I. kaitai_struct_cpp_stl_runtime/kaitai/kaitaistream.cpp src-animal/animal.cpp test-animal.cpp -o test-animal
-
-#include <fstream>
-#include <iostream>
-#include <src-animal/animal.h>
-
-int main() {
-  std::cout << "BEGIN" << std::endl;
-
-  std::ifstream infile("data/animal.raw", std::ifstream::binary);
-
-  kaitai::kstream ks(&infile);
-
-  animal_t zoo = animal_t(&ks);
-
-  // std::vector<animal_t::animal_entry_t*> *animal_vec = zoo.entry();
-
-  // for (int i = 0;  i < animal_vec->size();  i++) {
-  //   animal_t::animal_entry_t *testAnimal = animal_vec->at(i);
-
-  //   std::cout << "Species: " << testAnimal->species() << std::endl;
-  //   std::cout << "Age: " << static_cast<int>(testAnimal->age()) << std::endl;
-  //   std::cout << "Weight: " << testAnimal->weight() << std::endl;
-  // }
-
-  std::cout << "END" << std::endl;
-}
diff --git a/{{project_name}}/test-fake.cpp b/{{project_name}}/test-fake.cpp
deleted file mode 100644
index 763fb74..0000000
--- a/{{project_name}}/test-fake.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <fstream>
-#include <iostream>
-#include <src-fake/fake.h>
-
-int main() {
-  std::cout << "BEGINS" << std::endl;
-
-  std::ifstream infile("data/fake.raw", std::ifstream::binary);
-
-  kaitai::kstream ks(&infile);
-
-  fake_t points = fake_t(&ks);
-
-  std::cout << "ENDS" << std::endl;
-}
diff --git a/{{project_name}}/test-lists.cpp b/{{project_name}}/test-lists.cpp
deleted file mode 100644
index 82e302d..0000000
--- a/{{project_name}}/test-lists.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <fstream>
-#include <iostream>
-#include <src-lists/lists.h>
-
-int main() {
-  std::cout << "BEGINS" << std::endl;
-
-  std::ifstream infile("data/lists.raw", std::ifstream::binary);
-
-  kaitai::kstream ks(&infile);
-
-  lists_t sample = lists_t(&ks);
-
-  std::cout << "ENDS" << std::endl;
-}
diff --git a/{{project_name}}/test-numpy.cpp b/{{project_name}}/test-numpy.cpp
deleted file mode 100644
index 1ea9f61..0000000
--- a/{{project_name}}/test-numpy.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <fstream>
-#include <iostream>
-#include <src-numpy/numpy.h>
-
-int main() {
-  std::cout << "BEGINS" << std::endl;
-
-  std::ifstream infile("data/numpy.raw", std::ifstream::binary);
-
-  kaitai::kstream ks(&infile);
-
-  numpy_t points = numpy_t(&ks);
-
-  std::cout << "ENDS" << std::endl;
-}
diff --git a/{{project_name}}/test-pixie4e.cpp b/{{project_name}}/test-pixie4e.cpp
deleted file mode 100644
index 2636b42..0000000
--- a/{{project_name}}/test-pixie4e.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <fstream>
-#include <iostream>
-#include <src-pixie4e/pixie4e.h>
-
-int main() {
-  std::cout << "BEGINS" << std::endl;
-
-  std::ifstream infile("data/StilbeneAmCs_500_0253.set", std::ifstream::binary);
-
-  kaitai::kstream ks(&infile);
-
-  pixie4e_t points = pixie4e_t(&ks);
-
-  std::cout << "ENDS" << std::endl;
-}
diff --git a/{{project_name}}/test-records.cpp b/{{project_name}}/test-records.cpp
deleted file mode 100644
index 7118cea..0000000
--- a/{{project_name}}/test-records.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <fstream>
-#include <iostream>
-#include <src-records/records.h>
-
-int main() {
-  std::cout << "BEGINS" << std::endl;
-
-  std::ifstream infile("data/records.raw", std::ifstream::binary);
-
-  kaitai::kstream ks(&infile);
-
-  records_t points = records_t(&ks);
-
-  std::cout << "ENDS" << std::endl;
-}
@agoose77 agoose77 closed this Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant