bluesky / suitcase-specfile

write text file such as output by SPEC
Other
0 stars 8 forks source link

Write scan headers for each scan. #12

Closed danielballan closed 4 years ago

danielballan commented 4 years ago

We had conflated the file header (once per file) with the scan header (SHOULD be once per scan) and were thus only writing a scan header for the first scan in a file.

Verified with CHX data that pymca 5.5.4 that the the output from master branch issues error messages in the terminal (a wall of Error on scan 1 line 2) and not-useful display in the GUI, whereas this PR branch is all good.

Before:

#F chx_spec_2020_01_24.spec
#E 1579883287
#D Fri Jan 24 11:28:07 2020
#C xf11id  User = xf11id
#O0 
#o0 

#S 31645 ct seq_num -1
#D Fri Jan 24 11:28:07 2020
#T -1  (Seconds)
#P0 
#N 8
#L seq_num  Epoch  Seconds  eiger1m_single_stats1_total  eiger1m_single_stats2_total  eiger1m_single_stats3_total  eiger1m_single_stats4_total  eiger1m_single_stats5_total
1  1579885089 -1 8786747.0 84985.0 163822999042838.0 163822999042838.0 163822999042838.0

1  1579883058 -1 873652.0 8376.0 163822943633226.0 163822943633226.0 163822943633226.0

1  1579872243 -1 5328351.0 26318.0 163822964763117.0 163822964763117.0 163822964763117.0

After:

#F stuff.spec
#E 1579883287
#D Fri Jan 24 11:28:07 2020
#C xf11id  User = xf11id
#O0 
#o0 

#S 31645 ct seq_num -1
#D Fri Jan 24 11:28:07 2020
#T -1  (Seconds)
#P0 
#N 8
#L seq_num  Epoch  Seconds  eiger1m_single_stats1_total  eiger1m_single_stats2_total  eiger1m_single_stats3_total  eiger1m_single_stats4_total  eiger1m_single_stats5_total
1  1579885089 -1 8786747.0 84985.0 163822999042838.0 163822999042838.0 163822999042838.0

#S 31644 ct seq_num -1
#D Fri Jan 24 11:21:17 2020
#T -1  (Seconds)
#P0 
#N 8
#L seq_num  Epoch  Seconds  eiger1m_single_stats1_total  eiger1m_single_stats2_total  eiger1m_single_stats3_total  eiger1m_single_stats4_total  eiger1m_single_stats5_total
1  1579883058 -1 873652.0 8376.0 163822943633226.0 163822943633226.0 163822943633226.0

#S 31643 ct seq_num -1
#D Fri Jan 24 07:24:01 2020
#T -1  (Seconds)
#P0 
#N 8
#L seq_num  Epoch  Seconds  eiger1m_single_stats1_total  eiger1m_single_stats2_total  eiger1m_single_stats3_total  eiger1m_single_stats4_total  eiger1m_single_stats5_total
1  1579872243 -1 5328351.0 26318.0 163822964763117.0 163822964763117.0 163822964763117.0