-
Notifications
You must be signed in to change notification settings - Fork 68
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
Parameter sidecar files #768
Comments
Notes about the |
Ah, that resonates with the discussion about specifying bad pixels, gain map, dark frame and also other parameters for cases where the original format doesn't contain that. |
I want to revive the discussion here and gather some ideas about what should be achieved and what open questions are still around.
|
Yeah, those are very specific for that use case. I'm also not sure if the cluster dataset will survive - for caching, we are now using fscache instead, and the cluster ds was mostly meant to be used as a backend for caching...
I think the main candidates are: YAML, JSON, TOML. JSONPro:
Con:
YAMLPro:
Con:
TOMLhttps://github.com/toml-lang/toml Not sure about this one, as I haven't used it yet (other than writing some configuration files), but it may be a good candidate: Pro:
Con:
|
Looking more into it, I kind of like TOML:
In [1]: import toml
In [2]: toml.loads("""
...: [dataset]
...: type = "tvips"
...: path = "/home/alex/Data/TVIPS/rec_20200623_080237_000.tvips"
...:
...: [corrections]
...: dark_frame = "/home/alex/Data/TVIPS/dark.tif"
...: excluded_pixels = [[0, 0], [128, 128]]
...: """)
Out[2]:
{'dataset': {'type': 'tvips',
'path': '/home/alex/Data/TVIPS/rec_20200623_080237_000.tvips'},
'corrections': {'dark_frame': '/home/alex/Data/TVIPS/dark.tif',
'excluded_pixels': [[0, 0], [128, 128]]}} The For the corrections, we could also think about accepting some parameters, like this: In [4]: toml.loads("""
...: [dataset]
...: type = "tvips"
...: path = "/home/alex/Data/TVIPS/rec_20200623_080237_000.tvips"
...:
...: [corrections]
...: excluded_pixels = [[0, 0], [128, 128]]
...:
...: [corrections.dark_frame]
...: path = "/home/alex/Data/TVIPS/dark.tif"
...: format = "TIFF"
...:
...: [corrections.gain_map]
...: path = "/home/alex/Data/TVIPS/gain.bin"
...: format = "RAW"
...: dtype = "float32"
...: """)
Out[4]:
{'dataset': {'type': 'tvips',
'path': '/home/alex/Data/TVIPS/rec_20200623_080237_000.tvips'},
'corrections': {'excluded_pixels': [[0, 0], [128, 128]],
'dark_frame': {'path': '/home/alex/Data/TVIPS/dark.tif', 'format': 'TIFF'},
'gain_map': {'path': '/home/alex/Data/TVIPS/gain.bin',
'format': 'RAW',
'dtype': 'float32'}}} (loading corrections directly in |
I'm adding this to the 0.10 milestone - @jhgee thank you for kick-starting this discussion again! If you'd like to help out on building this feature, it would be good to have a concrete specification for the sidecar file, and maybe have a go at implementing a prototype. If you encounter any difficulties, we are here to help! |
From #153:
SEQ files don't contain any information about the scan, so there was a question if we could read this from a "sidecar" file, like we do with other formats with their proprietary implementations. One idea would be to have a simple file, maybe in
.ini
format, or.yml
, which contains that information. This idea could even be extended to other formats that need additional information, like raw. Something like this:my_dataset.yml:
my_other_dataset.yml:
These yml files could then provide one-click opening in LiberTEM, even if the underlying raw dataset doesn't provide enough information.
The text was updated successfully, but these errors were encountered: