You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
need to add to crop so that hyperspectral data can be cropped (make function out of tedious rebuilding of hyperspectral data)
Describe the solution you'd like
code modified from jorge:
Is your feature request related to a problem? Please describe.
need to add to crop so that hyperspectral data can be cropped (make function out of tedious rebuilding of hyperspectral data)
Describe the solution you'd like
code modified from jorge:
h,w,z=np.shape(spectral_array.pseudo_rgb)
white_crop = pcv.crop(white_img.array_data, 0, 0, h, w)
dark_crop= pcv.crop(dark_img.array_data, 0, 0, h, w)
dims1 = white_crop.shape
dims2 = dark_crop.shape
white_crop_filename = "./white_reference_crop.hdr"
dark_crop_filename = "./dark_reference_crop.hdr"
white_spec = pcv.Spectral_data(array_data=white_crop, min_wavelength=white_img.min_wavelength,
max_wavelength=white_img.max_wavelength, min_value=np.min(white_crop),
max_value=np.max(white_crop), d_type=white_crop.dtype,
wavelength_dict=white_img.wavelength_dict, samples=int(dims1[2]), lines=int(dims1[0]),
interleave='BIL', wavelength_units=white_img.wavelength_units,
array_type="datacube", pseudo_rgb=white_crop, default_bands=white_img.default_bands,
filename='.')
pcv.hyperspectral.write_data(white_crop_filename, white_spec)
dark_spec = pcv.Spectral_data(array_data=dark_crop, min_wavelength=dark_img.min_wavelength,
max_wavelength=dark_img.max_wavelength, min_value=np.min(dark_crop),
max_value=np.max(dark_crop), d_type=dark_crop.dtype,
wavelength_dict=dark_img.wavelength_dict, samples=int(dims2[2]), lines=int(dims2[0]),
interleave='BIL', wavelength_units=dark_img.wavelength_units,
array_type="datacube", pseudo_rgb=dark_crop, default_bands=dark_img.default_bands,
filename='.')
pcv.hyperspectral.write_data(dark_crop_filename, dark_spec)
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context, sample data, or code relevant to the feature request here.
The text was updated successfully, but these errors were encountered: