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

Issue Reading Zygo Optical Profiler MetroPro Format Data with open_topography #364

Closed
nombac opened this issue Apr 15, 2024 · 5 comments · Fixed by #366
Closed

Issue Reading Zygo Optical Profiler MetroPro Format Data with open_topography #364

nombac opened this issue Apr 15, 2024 · 5 comments · Fixed by #366
Labels
bug Something isn't working

Comments

@nombac
Copy link

nombac commented Apr 15, 2024

I'm experiencing a problem while attempting to load a data file from a Zygo optical profiler, which should be in the MetroPro format, using the SurfaceTopography Python package. Notably, the file can be correctly read by Gwyddion, suggesting the data itself is not corrupted. Below is the code snippet I executed:

import sys
from SurfaceTopography import open_topography

if __name__ == '__main__':
    open_topography(sys.argv[1])

Upon running this code, I am faced with a series of errors indicating that none of the readers available in the package could properly detect or read the file format. The traceback highlights that there might be an issue with the file parsing or format recognition. Here's the pertinent part of the traceback:

Traceback (most recent call last):
  File "/Users/shirose/Desktop/test.py", line 5, in <module>
    open_topography(sys.argv[1])
  File "/Users/shirose/Library/Python/3.12/lib/python/site-packages/SurfaceTopography/IO/__init__.py", line 235, in open_topography
    raise CannotDetectFileFormat(msg)
SurfaceTopography.Exceptions.CannotDetectFileFormat: tried XYZReader: 
 Could not parse file as XYZ.
 
... [Additional errors for each reader type] ...

tried MetroProReader: 
 bad char in struct format

This data is crucial for my work. Since I cannot attach the file directly here, please find the data accessible via the following Dropbox link for your reference and testing:
test.dat
Could anyone assist in resolving this issue or suggest an alternative approach?
Thank you!

@pastewka
Copy link
Contributor

Thank you for reporting. I'll resolve this asap.

@pastewka
Copy link
Contributor

Hi @nombac - the problem occurs at a part of the code that starts with the comment

# TODO: We have no example file to actually test this code

--- so I am not surprised that it breaks. I will fix this. My question to you: Can I include the file that you posted here into the repository for automated testing? This will make sure this code does not break with future changes. It would appear in the test/file_format_examples directory as the file metropro-2.dat?

@pastewka pastewka reopened this Apr 16, 2024
@pastewka pastewka added the bug Something isn't working label Apr 16, 2024
@pastewka
Copy link
Contributor

@nombac I've release v1.13.13 - can you check whether this fixes the issue for you?

@nombac
Copy link
Author

nombac commented Apr 16, 2024

Thank you for your work on this!
I've confirmed that v1.13.13 works.
I'm also okay with including my data file in the repository.

@pastewka
Copy link
Contributor

Okay perfect, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants