-
Notifications
You must be signed in to change notification settings - Fork 257
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
Write hyperspectral data #889
Conversation
Codecov Report
@@ Coverage Diff @@
## 4.x #889 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 158 159 +1
Lines 6697 6725 +28
=========================================
+ Hits 6697 6725 +28
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This might be somewhat nit-picky, but I think that the parameters should be in the reverse order to match the style of other pcv writing functions that generally have the img data first, followed by the filename. |
|
||
# Read written hyperspectral image | ||
array_data = read_data(filename=filename) | ||
assert np.shape(array_data.array_data) == (lines, samples, bands) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would going beyond checking if the dimensions are the same to see if some of the values are the same be helpful? Or is just checking that they're the same shape usually sufficient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good question. We could check some values or also verify that it's the exact array. I think it depends on what can go wrong. Since the array is vectorized and written as a binary array, in order to have the correct dimensions the data type and the interleave format should be correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok cool, would just a simple assert np.array_equal(array_data.array_data, rand_spectral_array)
be good or do you think that would take up more time than it's worth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both ways are good options
|
||
# Read written hyperspectral image | ||
array_data = read_data(filename=filename) | ||
assert np.shape(array_data.array_data) == (lines, samples, bands) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would going beyond checking if the dimensions are the same to see if some of the values are the same be helpful? Or is just checking that they're the same shape usually sufficient
|
||
# Read written hyperspectral image | ||
array_data = read_data(filename=filename) | ||
assert np.shape(array_data.array_data) == (lines, samples, bands) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok cool, would just a simple assert np.array_equal(array_data.array_data, rand_spectral_array)
be good or do you think that would take up more time than it's worth?
Co-authored-by: David Peery <josephdavidpeery@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good then
Describe your changes
Add the functionality to write ENVI-format hyperspectral images.
Type of update
Is this a:
Associated issues
Additional context