[ENH] PTIR Loader: load raw discrete frequency data#820
[ENH] PTIR Loader: load raw discrete frequency data#820callumgassner wants to merge 1 commit intoQuasars:masterfrom
Conversation
|
@stuart-cls, could you check this one, please? |
|
I will take a look and @kaiyang-tu has some good test files. |
|
@callumgassner this is a nice add. Regarding your question, yes a file can contain two maps of different size (see attached file discrete-OPTIR-test.zip). Short chat with @stuart-cls, if more than one discrete maps exist in single file, it might be good to give them a meta information (e.g. Region 1, Region 2 to differentiate maps. Related, z-focus should be consistent for each wavenumber when collecting a single discrete map. This could be bundle as one z-focus value per Region. Something along the lines of: meta region | meta z-focus | features |
| for discrete_maps in filter(lambda s: s == 'Heightmaps', keys): | ||
| hdf5_meas = hdf5_file[discrete_maps] | ||
| meas_keys = list(hdf5_meas.keys()) | ||
| meas_attrs = hdf5_meas.attrs | ||
| for map_name in filter(lambda s: s.startswith('Heightmap'), meas_keys): | ||
| hdf5_map = hdf5_meas[map_name] | ||
| if hdf5_map.attrs['Units'] == b'' or \ | ||
| ('Checked' in hdf5_map.attrs.keys() and hdf5_map.attrs['Checked'][0] == 0): | ||
| continue | ||
| signal = b'DF' + hdf5_map.attrs['Channel'] | ||
| if not channel_map.keys().__contains__(signal): | ||
| label = b'Discrete ' + hdf5_map.attrs['Label'].split()[0] | ||
| channel_map[signal] = label |
There was a problem hiding this comment.
'Label' in 'Heightmaps' might not be best option to find discrete maps as 'Label' can be manually changed by user in PTIR studio to anything else (see in the earlier attached example file).
I don't see a great option to determine if a 'Heightmaps' is an OPTIR, DC or Phase map, but 'Views' -> 'DocIR' -> 'ChannelViews' might be an option to find out if discrete OPTIR, DC, Phase maps exist and what their 'DataSignal' is. This can then be used to search for corresponding maps in the 'Heightmaps'
Introduces the ability to load the raw data for discrete frequency maps (O-PTIR, DC, Phase). Selection of full spectra and df maps is achieved through the "Sheets" drop down in File and Multifile.
I had to make some adjustments to my original implementation due to changes from #788 (particularly the inclusion of z-focus). I have tested these changes using a number of PTIR Studio files containing a various mix of data/measurement types and have not come across any issues. However, I haven't been able to test e.g. 1 file containing 2 maps of different sizes (if that is even possible for these files? I don't have much experience with them).