Skip to content

Commit

Permalink
Merge pull request #99 from pycroscopy/nanonis_fix
Browse files Browse the repository at this point in the history
nanonis base
  • Loading branch information
ramav87 authored Jul 22, 2023
2 parents 6ad2766 + 50cb37d commit fe0bc16
Show file tree
Hide file tree
Showing 7 changed files with 823 additions and 40 deletions.
20 changes: 5 additions & 15 deletions SciFiReaders/readers/microscopy/spm/stm/nanonis_3ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@
import numpy as np # For array operations
import sidpy as sid
from sidpy.sid import Reader, Dimension, DimensionType

try:
import nanonispy as nap
except ModuleNotFoundError:
nap = None


from .nanonis_base import Grid
class Nanonis3dsReader(Reader):

def __init__(self, file_path, *args, **kwargs):
if nap == None:
raise ModuleNotFoundError('You attempted to load a Nanonis file, but this requires Nanonispy.\n \
Please Load it with pip install nanonispy , restart and retry')

super().__init__(file_path, *args, **kwargs)

@staticmethod
Expand Down Expand Up @@ -124,7 +116,7 @@ def read(self):
list of sidpy.Dataset objects containing the spectroscopy data
"""

reader = nap.read.Grid
reader = Grid
override_header = {
'Delay before measuring (s)': 0.0,
'Start time': 0.0,
Expand Down Expand Up @@ -194,7 +186,5 @@ def can_read(self):
Returns
-------
"""

if nap is None:
return False
return super(Nanonis3dsReader, self).can_read(extension='3ds')

return
Loading

0 comments on commit fe0bc16

Please sign in to comment.