Skip to content

Commit

Permalink
Merge pull request #712 from stuart-cls/agilent-format-package
Browse files Browse the repository at this point in the history
[ENH] agilent-format package, support incomplete datasets
  • Loading branch information
markotoplak authored Mar 26, 2024
2 parents dc04a35 + c2ee161 commit df311e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 626 deletions.
5 changes: 4 additions & 1 deletion orangecontrib/spectroscopy/io/agilent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
from Orange.data import FileFormat, ContinuousVariable, Domain

from orangecontrib.spectroscopy.utils.agilent import agilentImage, agilentImageIFG, agilentMosaic, agilentMosaicIFG, \
from agilent_format import agilentImage, agilentImageIFG, agilentMosaic, agilentMosaicIFG, \
agilentMosaicTiles
from orangecontrib.spectroscopy.io.util import SpectralFileFormat, _spectra_from_image, TileFileFormat

Expand Down Expand Up @@ -205,6 +205,9 @@ def read_tile(self):
# the not-tiled reader
for y in range(ytiles - 1, -1, -1):
tile = tiles[x, y]()
if np.isnan(tile).all():
# Return an empty Table if tile doesn't exist (instead of storing a tile of nans)
yield Orange.data.Table.from_domain(domain)
x_size, y_size = tile.shape[1], tile.shape[0]
x_locs = np.linspace(x*x_size*px_size, (x+1)*x_size*px_size, num=x_size, endpoint=False)
y_locs = np.linspace((ytiles-y-1)*y_size*px_size, (ytiles-y)*y_size*px_size, num=y_size, endpoint=False)
Expand Down
Loading

0 comments on commit df311e2

Please sign in to comment.