Skip to content

Commit

Permalink
removing µEpoch
Browse files Browse the repository at this point in the history
  • Loading branch information
rstrub committed Dec 6, 2023
1 parent 414694b commit 588d244
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions hermes_eea/SkymapFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def do_eea_packet( stepperTableCounter,
pulse_b = np.zeros((41,4), dtype=np.uint16)
counter1 = np.zeros((41,4), dtype=np.uint16)
counter2 = np.zeros((41,4), dtype=np.uint16)
µepoch = np.zeros((41,4), dtype=np.uint16)
usec = np.zeros((41,4), dtype=np.uint16)

skymap = np.zeros((41, 4, 32), dtype=np.uint16)

Expand All @@ -80,7 +80,7 @@ def do_eea_packet( stepperTableCounter,
pulse_b[dim0, dim1] = counts[row][33]
counter1[dim0, dim1] = cnt1[row]
counter2[dim0, dim1] = cnt2[row]
µepoch[dim0, dim1] = epoch[row]
usec[dim0, dim1] = epoch[row]


# if len(stepperTableCounter) != 64:
Expand All @@ -89,7 +89,7 @@ def do_eea_packet( stepperTableCounter,
return_package['pulse_a'] = pulse_a
return_package['pulse_b'] = list(pulse_b)
return_package['counts'] = skymap
return_package['µEpoch'] = µepoch
return_package['usec'] = usec
return_package['Epoch'] = epoch[0]
return_package['stats'] = np.sum(skymap)
return_package['energies'] = voltages
Expand Down
3 changes: 1 addition & 2 deletions hermes_eea/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
INST_TO_TARGETNAME = {INST_NAME: INST_TARGETNAME}

_package_directory = os.path.dirname(os.path.abspath(__file__))

_data_directory = os.path.abspath(os.path.join(_package_directory, "data"))
_calibration_directory = os.path.abspath(os.path.join(_data_directory, "calibration"))


log.info(f"hermes_eea version: {__version__}")

skeleton = str( os.path.join(_data_directory, "masterSkeletons", "hermes_eea_l0_00000000000000_v0.0.0.cdf") )
stepper_table = "flight_stepper.txt"


Expand Down
2 changes: 1 addition & 1 deletion hermes_eea/calibration/build_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _hermes_eea_spectra(self):
self.multiple_spectra = NDCollection(
[
("hermes_eea_settle_step_times",
NDCube(data=np.array(self.EEA.µEpoch), wcs=WCS(naxis=2), meta={"CATDESC": "Settle for Each Step"},
NDCube(data=np.array(self.EEA.usec), wcs=WCS(naxis=2), meta={"CATDESC": "Settle for Each Step"},
unit="s", )),
("hermes_eea_energy_profile",
NDCube(data=np.array(self.EEA.EnergyLabels), wcs=WCS(naxis=2), meta={"CATDESC": "Energy Profile"},
Expand Down
2 changes: 1 addition & 1 deletion hermes_eea/calibration/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def get_calibration_file(data_filename: Path, time=None) -> Path:
Examples
--------
"""
return os.path.join(hermes_eea._data_directory, data_filename)
return os.path.join(hermes_eea._calibration_directory, data_filename)


def read_calibration_file(calib_filename: Path):
Expand Down
4 changes: 2 additions & 2 deletions hermes_eea/io/EEA.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def __init__(self, conf):
self.Logical_file_id = None
self.Data_version = None
# ener, defl
self.µEpoch = [] #[ 41, 4 ] each of the 164 times, whenever hermes_eea_intgr_or_stepper == 1
self.usec = [] #[ 41, 4 ] each of the 164 times, whenever hermes_eea_intgr_or_stepper == 1
self.PulseA = [] # [41, 4] overflow[0],accum[33]
self.PulseB = [] # [41, 4] overflow[1], accum[34]
self.Counter1 = []
Expand All @@ -30,7 +30,7 @@ def populate(self, myEEA, skymap):

packet = 0
for record in skymap:
myEEA.µEpoch.append(record['µEpoch'])
myEEA.usec.append(record['usec'])
myEEA.Epoch.append(record['Epoch'])
myEEA.ACCUM.append(record['counts'])
myEEA.PulseA.append(record['pulse_a'])
Expand Down

0 comments on commit 588d244

Please sign in to comment.