Skip to content

Commit edd6b1a

Browse files
committed
added project files
1 parent 343e290 commit edd6b1a

11 files changed

+2051
-0
lines changed

CRISM_unsupervised_classification.ipynb

Lines changed: 1537 additions & 0 deletions
Large diffs are not rendered by default.

find_nearest.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
def find_nearest(value,
2+
array,
3+
return_value=False):
4+
"""Find nearest value in a numpy array
5+
6+
Parameters
7+
----------
8+
9+
value : value to search for
10+
array : array to search in, should be sorted.
11+
return_value : bool, if to return the actual values
12+
13+
Returns
14+
-------
15+
16+
"""
17+
18+
import numpy as np
19+
20+
closest_index = (np.abs(array - value)).argmin()
21+
22+
if value > np.nanmax(array):
23+
import warnings
24+
warnings.warn(f'value > np.nanmax(array) : {value} > {np.nanmax(array)}')
25+
26+
if value < np.nanmin(array):
27+
import warnings
28+
warnings.warn(f'value < np.nanmin(array) : {value} < {np.nanmax(array)}')
29+
30+
if not return_value:
31+
return closest_index
32+
else:
33+
return closest_index, array[closest_index]

results/Classification_metadata.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{'image ID:': 'frt00009b5a_07_if165j_mtr3', 'PCA components:': 6, 'PCA components removed:': 'first component', 'UMAP': 'Nearest neighbours:100; Minimum distance:0.2', 'Scaler': 'Standard scaler', 'Classifier': 'K-Means', 'Number of clusters': 12, 'Inertia': 73141.765625}

results/UMAP_grid.png

1.1 MB
Loading

results/img_clusters.png

580 KB
Loading

results/plot_spectra.png

134 KB
Loading

results/plot_spectra_ratioed.png

70 KB
Loading

results/plot_spectra_ratioed_2.png

43.3 KB
Loading

results/plot_spectra_separate_std.png

74.8 KB
Loading

results/spectra.csv

Lines changed: 240 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)