Skip to content

Commit

Permalink
add missing counterpart
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Oct 16, 2024
1 parent f4f370f commit 91ab583
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/depiction/persistence/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ def coordinates_2d(self) -> NDArray[int]:
"""Returns the coordinates of the spectra in the imzML file, shape (n_spectra, 2)."""
return self.coordinates[:, :2]

@property
def coordinates_array_2d(self) -> DataArray:
# TODO this should replace the old coordinates_2d later
return DataArray(self.coordinates_2d.astype(int), dims=("i", "d"), coords={"d": ["x", "y"]})

def get_spectrum(self, i_spectrum: int) -> tuple[NDArray[float], NDArray[float]]:
"""Returns the m/z and intensity arrays of the i-th spectrum."""
return self.get_spectrum_mz(i_spectrum=i_spectrum), self.get_spectrum_int(i_spectrum=i_spectrum)
Expand Down

0 comments on commit 91ab583

Please sign in to comment.