Skip to content

Commit

Permalink
fixed time origin on o1 for RSF writier and made dummy starttime vari…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
aaronjgirard committed Jan 30, 2024
1 parent 2fd62c7 commit bd8e291
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dascore/io/rsf/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def write(self, spool, path, data_path=None, **kwargs):
spool needs to have a single patch in it
time origin is forced to 0.0 in the new RSF file, but a dummy
variable named 'starttime' still holds the real start time
Parameters
----------
spool
Expand Down Expand Up @@ -79,7 +82,11 @@ def write(self, spool, path, data_path=None, **kwargs):
hdr_info = [hdr_str, file_formt, f"esize={file_esize}"]
for i in range(length):
hdr_info.append(f"n{i+1}={axis_lengs[i]}")
hdr_info.append(f"o{i+1}={axis_origs[i]}")
if i == 0:
hdr_info.append(f"o{i+1}=0.0")
hdr_info.append(f"starttime={axis_origs[i]}")
else:
hdr_info.append(f"o{i+1}={axis_origs[i]}")
hdr_info.append(f"d{i+1}={axis_steps[i]}")
hdr_info.append(f'label{i+1}="{axis_names[i]}"')
hdr_info.append(f'unit{i+1}="{axis_units[i]}"')
Expand Down

0 comments on commit bd8e291

Please sign in to comment.