Skip to content

Commit

Permalink
Metadata: Include GateWidth, GratingBlaze (#34)
Browse files Browse the repository at this point in the history
* Metadata: Include GateWidth, GratingBlaze

* Update _sif_open.py

* Add test for issue 33

* Added strip()

---------

Co-authored-by: Martijn Ruijzendaal <[email protected]>
Co-authored-by: Keisuke Fujii <[email protected]>
  • Loading branch information
3 people authored May 9, 2024
1 parent c955a58 commit a922fc2
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 88 deletions.
10 changes: 9 additions & 1 deletion sif_parser/_sif_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,19 @@ def _open(fp):
_read_until(fp, ' ') # 1
info['GainDAC'] = _read_float(fp)

_read_until(fp, ' ') # 0
_read_until(fp, ' ') # 0
info['GateWidth'] = _read_float(fp)

for _ in range(16):
_read_until(fp, ' ')
info['GratingBlaze'] = _read_float(fp)

# What is the rest of the line?
_read_until(fp, '\n')

# Line 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
info['DetectorType'] = _to_string(fp.readline())
info['DetectorType'] = _to_string(fp.readline()).strip()
# Line 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
info['DetectorDimensions'] = (_read_int(fp), _read_int(fp))
# Lines 5 -> 6 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
Binary file added testings/issue33/measurement.sif
Binary file not shown.
Loading

0 comments on commit a922fc2

Please sign in to comment.