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

[ENH] agilent-format package, support incomplete datasets #712

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
# 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)

Check warning on line 210 in orangecontrib/spectroscopy/io/agilent.py

View check run for this annotation

Codecov / codecov/patch

orangecontrib/spectroscopy/io/agilent.py#L210

Added line #L210 was not covered by tests
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
Loading