Skip to content

Commit 1242505

Browse files
authored
Merge pull request #1595 from danforthcenter/add_geores_to_spectral
Add metadata attribute to spectral_data class
2 parents 26bfd9a + a3ad6c3 commit 1242505

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

docs/Spectral_data.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ Attributes are accessed as spectral_data_instance.*attribute*.
3838

3939
**filename**: The filename where the data originated from
4040

41-
**geo_transform**: The affine transformation matrix used to convert from an xy coordinate system to a georeferenced coordinate system. Default is the input list used by the affine package to create an identity matrix.
42-
43-
**geo_crs**: The original coordinate system of a georeferenced image. Default is "None".
41+
**metadata**: Metadata in a dictionary. Included keys might be specific to hyperspectral or geospatial image types
4442

4543
### Example
4644

plantcv/plantcv/classes.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ class Spectral_data:
299299

300300
def __init__(self, array_data, max_wavelength, min_wavelength, max_value, min_value, d_type, wavelength_dict,
301301
samples, lines, interleave, wavelength_units, array_type, pseudo_rgb, filename, default_bands,
302-
geo_transform=None, geo_crs=None):
302+
metadata=None):
303303
# The actual array/datacube
304304
self.array_data = array_data
305305
# Min/max available wavelengths (for spectral datacube)
@@ -326,13 +326,10 @@ def __init__(self, array_data, max_wavelength, min_wavelength, max_value, min_va
326326
self.filename = filename
327327
# The default band indices needed to make an pseudo_rgb image, if not available then store None
328328
self.default_bands = default_bands
329-
# The transformation matrix that converts xy coordinates to georeferenced coordinates
330-
# Default is the input list for affine.Affine to make an identity matrix
331-
self.geo_transform = geo_transform
332-
if not geo_transform:
333-
self.geo_transform = (1.0, 0.0, 0.0, 0.0, 1.0, 0.0)
334-
# The coordinate system of a georeferenced image
335-
self.geo_crs = geo_crs
329+
# Metadata, flexible components in a dictionary
330+
self.metadata = metadata
331+
if not metadata:
332+
self.metadata = {}
336333

337334

338335
class PSII_data:

0 commit comments

Comments
 (0)