Skip to content

Commit

Permalink
this write separate records with their code and single records with mine
Browse files Browse the repository at this point in the history
  • Loading branch information
rstrub committed Nov 28, 2023
1 parent f0f1aff commit cb2a7f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hermes_eea/SkymapFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def SkymapFactory(l0_cdf,energies,deflections,myEEA):
epochs = ccsds_to_cdf_time.helpConvertEEA(l0_cdf)
try:
#for ptr in range(0,len(beginning_packets)):
for ptr in range(0,2000):
for ptr in range(77,100):
#skymap = np.zeros((beginning_packets[ptr+1]-beginning_packets[ptr],32))
package.append((
l0_cdf['STEP'][beginning_packets[ptr]:beginning_packets[ptr+1]],
Expand Down
16 changes: 12 additions & 4 deletions hermes_eea/calibration/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,19 @@ def l0_sci_data_to_cdf(data: dict, original_filename: Path) -> Path:
'ACCUM' : accumSkymaps

}
hermes_data = HermesData(timeseries=ts, meta=input_attrs, support=support_data)

hermes_eea_data = HermesData(timeseries=ts, meta=input_attrs, support=support_data)
ts = TimeSeries(
time_start="2016-03-22T12:30:31",
time_delta=3 * u.s,
data={"Bx": u.Quantity([1, 2, 3, 4], "gauss", dtype=np.uint16)}
)
input_attrs = HermesData.global_attribute_template("eea", "l1", "1.0.0")
hermes_data = HermesData(timeseries=ts, meta=input_attrs)
hermes_data.timeseries['Bx'].meta.update({"CATDESC": "X component of the Magnetic field measured by HERMES"})
try:
cdf_path = hermes_data.save(cdf_filename.parent, True)
#cdf_path = hermes_data.save( str(cdf_filename.parent) , True)

cdf_path = hermes_data.save(None, True)
cdf_path = hermes_eea_data.save( str(cdf_filename.parent) , True)
except Exception as e:
log.error(e)
sys.exit(2)
Expand Down

0 comments on commit cb2a7f3

Please sign in to comment.