Skip to content

[ENH] PTIR Loader: load raw discrete frequency data#820

Open
callumgassner wants to merge 1 commit intoQuasars:masterfrom
callumgassner:ptir-discrete_imgs
Open

[ENH] PTIR Loader: load raw discrete frequency data#820
callumgassner wants to merge 1 commit intoQuasars:masterfrom
callumgassner:ptir-discrete_imgs

Conversation

@callumgassner
Copy link
Contributor

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).

@markotoplak
Copy link
Collaborator

@stuart-cls, could you check this one, please?

@stuart-cls stuart-cls self-requested a review July 23, 2025 15:27
@stuart-cls
Copy link
Member

I will take a look and @kaiyang-tu has some good test files.

@kaiyang-tu
Copy link
Contributor

kaiyang-tu commented Jul 29, 2025

@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
Region 1 | z-focus value 1 | map1 values
Region 2 | z-focus value 2 | map2 values

Comment on lines +45 to +57
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
Copy link
Contributor

@kaiyang-tu kaiyang-tu Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'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'

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

Successfully merging this pull request may close these issues.

4 participants