Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample Logs should store units, besides value #629

Closed
4 tasks
jmborr opened this issue Jul 30, 2020 · 0 comments
Closed
4 tasks

Sample Logs should store units, besides value #629

jmborr opened this issue Jul 30, 2020 · 0 comments
Assignees

Comments

@jmborr
Copy link
Member

jmborr commented Jul 30, 2020

TODO:

  • Read log unit from the Nexus events file and save into hydraworkspace (see NexusConvertingApp.split_sample_logs() and HidraWorkspace.set_sample_log())
  • saving to project file should save both value and unit. (see HidraWorkspace.save_experimental_data())
  • reading from project file will read both value and unit (see HidraProjectFile.read_sample_logs())
  • backwards compatibility: old hydra project files will contain only log values. Thus, when loaded each log entry should be assigned an empty string for units attribute.

Possible locations in the code base impacted by the introduction of LogEntry:

  • reading to and writing from the project file
  • Peak fitting UI
  • Sample logs when creating the point list

Blocks #274

Notes in the current implementation of the sample logs:

SampleLogs Class

  • class SampleLogs is instantiated in HidraWorkspace.__init__ as attribute _sample_logs, with an empty state
  • The state of HidraWorkspace._sample_logs is initialized in HidraWorkspace._load_sample_logs(HidraProjectFile), which
    calls HidraProjectFile.read_sample_logs()

Project File

The hierarchy of a HDF5 project file:

(Subruns begin at 1, not 0. )

Log entries contain a single float for each subrun number. The attribute is empty. The idea is to extend it to contain a value and a unit.

Writing the logs in a projectfile with class HidraProjectFile:

  • HidraProjectFile._init_project() creates datasets for logs and subruns, but don't fill them
  • HidraProjectFile.append_experiment_log(log_name, log_value_array) add one log entry in the logs dataset
  • HidraProjectFile.write_sub_runs(sub_runs) add data into the subruns dataset

Writing the logs to a project file is done from a HidraWorkspace:

  • HidraWorkspace.save_experimental_data() calls HidraProjectFile.get_sample_log_values() and immediately after calls HidraProjectFile.append_experiment_log()
jmborr added a commit that referenced this issue Sep 7, 2020
jmborr added a commit that referenced this issue Sep 7, 2020
jmborr added a commit that referenced this issue Sep 7, 2020
jmborr added a commit that referenced this issue Sep 7, 2020
jmborr added a commit that referenced this issue Sep 7, 2020
jmborr added a commit that referenced this issue Sep 7, 2020
jmborr added a commit that referenced this issue Sep 7, 2020
jmborr added a commit that referenced this issue Sep 7, 2020
jmborr added a commit that referenced this issue Sep 8, 2020
Signed-off-by: Jose Borreguero <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants