scholi / pySPM

Python library to handle Scanning Probe Microscopy Images. Can read nanoscan .xml data, Bruker AFM images, Nanonis SXM files as well as iontof images(ITA, ITM and ITS).
Apache License 2.0
58 stars 33 forks source link

Added file close to SXM.py #21

Closed Jesset3 closed 2 years ago

Jesset3 commented 2 years ago

Added method to close sxm files to avoid file system conflicts during batch processing of SXM files. File system errors were generated when trying to open, process, and then move sxm files to new directories. This change allows the user to close the file after processing with pySPM, thereby avoiding the error.

scholi commented 2 years ago

good point. I'm wondering if this would not be even better to close the file at the end of the init function and reopen and closer it in the get_channel one.

scholi commented 2 years ago

I have pushed my proposal to my github repo. Could you pull and test if this solve your issue?

Jesset3 commented 2 years ago

Pulled and tested your proposed changes. They worked to solve my issue with file system errors, so I'm closing my initial pull request. Thanks!