hklearn

 1# expose these publically
 2from .stack import Stack
 3from .modelSet import ModelSet
 4
 5# Define some useful spectral sampling suggestions to facilitate building models that are reusable (e.g., between sensors).
 6# N.B. using these can help standardise the spectral resolution
 7# used for building models, while reducing e.g., typically unnecessary bands
 8# in the VNIR range. But, these suggestions should also be disregarded for
 9# specific applications (e.g., involving REEs which have tight absorptions in the
10# VNIR range so would deserve a higher spectral resolution).
11
12import numpy as np
13VNIR =  np.arange(450., 1000., 20.) # 20 nm spacing in VNIR
14"""
15Default spectral sampling for VNIR range (400 - 1000 nm) data. Note
16that the ultra-blue has been removed as often this is very noisy under
17(blue-poor) artificial light. The spectral resolution is kept constant at
1820 nm. This results in 27 bands.
19"""
20
21SWIR = np.hstack( [np.arange( 1000., 1300., 20. ), np.arange( 1300., 2500., 10. )] ) # 7.5 nm spacing in the upper SWIR
22"""
23Default spectral sampling for the SWIR range (1000-2500 nm). Note that this 
24has two different spectral resolutions - 20 nm below 1300 nm (as there are 
25rarely significant features in this range) and 10 nm between 1300 and 2500 nm
26(a lot of exciting stuff happens in this range!). This results in a total of
27134 bands.
28"""
29SWIR = np.vstack([SWIR[:-1],SWIR[1:]]).T # define start and end
30
31
32MWIR = np.arange(3000., 5250., 15.)
33"""
34Default spectral sampling for the MWIR spectral range (2700 - 5500 nm). Note
35that we remove the first part of the MWIR (below 3000 nm) as this tends to be
36very noisy. Spectral resolution is kept constant at 15 nm, resulting in 149 bands.
37"""
38
39LWIR = np.arange(7750., 12000., 50.)
40"""
41Default spectral sampling for the LWIR spectral range (7700 - 13000 nm). Note
42that we remove the first and last bands due to noise, limiting the (default) range
43to 7750 - 12000 nm. Spectral resolution is constant at 50 nm, resulting in 84 bands.
44"""
45
46# convert to array of (b,[start,end]) form
47LWIR = np.vstack([LWIR[:-1],LWIR[1:]]).T
48MWIR = np.vstack([MWIR[:-1],MWIR[1:]]).T
49VNIR = np.vstack([VNIR[:-1],VNIR[1:]]).T
50
51 # also very handy combination of VNIR and SWIR
52VSWIR = np.vstack([VNIR, SWIR] )
53"""
54Concatenated VNIR and SWIR spectral sampling (for VSWIR sensors). This
55results in a total of 161 bands.
56"""
VNIR = array([[450., 470.], [470., 490.], [490., 510.], [510., 530.], [530., 550.], [550., 570.], [570., 590.], [590., 610.], [610., 630.], [630., 650.], [650., 670.], [670., 690.], [690., 710.], [710., 730.], [730., 750.], [750., 770.], [770., 790.], [790., 810.], [810., 830.], [830., 850.], [850., 870.], [870., 890.], [890., 910.], [910., 930.], [930., 950.], [950., 970.], [970., 990.]])

Default spectral sampling for VNIR range (400 - 1000 nm) data. Note that the ultra-blue has been removed as often this is very noisy under (blue-poor) artificial light. The spectral resolution is kept constant at 20 nm. This results in 27 bands.

SWIR = array([[1000., 1020.], [1020., 1040.], [1040., 1060.], [1060., 1080.], [1080., 1100.], [1100., 1120.], [1120., 1140.], [1140., 1160.], [1160., 1180.], [1180., 1200.], [1200., 1220.], [1220., 1240.], [1240., 1260.], [1260., 1280.], [1280., 1300.], [1300., 1310.], [1310., 1320.], [1320., 1330.], [1330., 1340.], [1340., 1350.], [1350., 1360.], [1360., 1370.], [1370., 1380.], [1380., 1390.], [1390., 1400.], [1400., 1410.], [1410., 1420.], [1420., 1430.], [1430., 1440.], [1440., 1450.], [1450., 1460.], [1460., 1470.], [1470., 1480.], [1480., 1490.], [1490., 1500.], [1500., 1510.], [1510., 1520.], [1520., 1530.], [1530., 1540.], [1540., 1550.], [1550., 1560.], [1560., 1570.], [1570., 1580.], [1580., 1590.], [1590., 1600.], [1600., 1610.], [1610., 1620.], [1620., 1630.], [1630., 1640.], [1640., 1650.], [1650., 1660.], [1660., 1670.], [1670., 1680.], [1680., 1690.], [1690., 1700.], [1700., 1710.], [1710., 1720.], [1720., 1730.], [1730., 1740.], [1740., 1750.], [1750., 1760.], [1760., 1770.], [1770., 1780.], [1780., 1790.], [1790., 1800.], [1800., 1810.], [1810., 1820.], [1820., 1830.], [1830., 1840.], [1840., 1850.], [1850., 1860.], [1860., 1870.], [1870., 1880.], [1880., 1890.], [1890., 1900.], [1900., 1910.], [1910., 1920.], [1920., 1930.], [1930., 1940.], [1940., 1950.], [1950., 1960.], [1960., 1970.], [1970., 1980.], [1980., 1990.], [1990., 2000.], [2000., 2010.], [2010., 2020.], [2020., 2030.], [2030., 2040.], [2040., 2050.], [2050., 2060.], [2060., 2070.], [2070., 2080.], [2080., 2090.], [2090., 2100.], [2100., 2110.], [2110., 2120.], [2120., 2130.], [2130., 2140.], [2140., 2150.], [2150., 2160.], [2160., 2170.], [2170., 2180.], [2180., 2190.], [2190., 2200.], [2200., 2210.], [2210., 2220.], [2220., 2230.], [2230., 2240.], [2240., 2250.], [2250., 2260.], [2260., 2270.], [2270., 2280.], [2280., 2290.], [2290., 2300.], [2300., 2310.], [2310., 2320.], [2320., 2330.], [2330., 2340.], [2340., 2350.], [2350., 2360.], [2360., 2370.], [2370., 2380.], [2380., 2390.], [2390., 2400.], [2400., 2410.], [2410., 2420.], [2420., 2430.], [2430., 2440.], [2440., 2450.], [2450., 2460.], [2460., 2470.], [2470., 2480.], [2480., 2490.]])

Default spectral sampling for the SWIR range (1000-2500 nm). Note that this has two different spectral resolutions - 20 nm below 1300 nm (as there are rarely significant features in this range) and 10 nm between 1300 and 2500 nm (a lot of exciting stuff happens in this range!). This results in a total of 134 bands.

MWIR = array([[3000., 3015.], [3015., 3030.], [3030., 3045.], [3045., 3060.], [3060., 3075.], [3075., 3090.], [3090., 3105.], [3105., 3120.], [3120., 3135.], [3135., 3150.], [3150., 3165.], [3165., 3180.], [3180., 3195.], [3195., 3210.], [3210., 3225.], [3225., 3240.], [3240., 3255.], [3255., 3270.], [3270., 3285.], [3285., 3300.], [3300., 3315.], [3315., 3330.], [3330., 3345.], [3345., 3360.], [3360., 3375.], [3375., 3390.], [3390., 3405.], [3405., 3420.], [3420., 3435.], [3435., 3450.], [3450., 3465.], [3465., 3480.], [3480., 3495.], [3495., 3510.], [3510., 3525.], [3525., 3540.], [3540., 3555.], [3555., 3570.], [3570., 3585.], [3585., 3600.], [3600., 3615.], [3615., 3630.], [3630., 3645.], [3645., 3660.], [3660., 3675.], [3675., 3690.], [3690., 3705.], [3705., 3720.], [3720., 3735.], [3735., 3750.], [3750., 3765.], [3765., 3780.], [3780., 3795.], [3795., 3810.], [3810., 3825.], [3825., 3840.], [3840., 3855.], [3855., 3870.], [3870., 3885.], [3885., 3900.], [3900., 3915.], [3915., 3930.], [3930., 3945.], [3945., 3960.], [3960., 3975.], [3975., 3990.], [3990., 4005.], [4005., 4020.], [4020., 4035.], [4035., 4050.], [4050., 4065.], [4065., 4080.], [4080., 4095.], [4095., 4110.], [4110., 4125.], [4125., 4140.], [4140., 4155.], [4155., 4170.], [4170., 4185.], [4185., 4200.], [4200., 4215.], [4215., 4230.], [4230., 4245.], [4245., 4260.], [4260., 4275.], [4275., 4290.], [4290., 4305.], [4305., 4320.], [4320., 4335.], [4335., 4350.], [4350., 4365.], [4365., 4380.], [4380., 4395.], [4395., 4410.], [4410., 4425.], [4425., 4440.], [4440., 4455.], [4455., 4470.], [4470., 4485.], [4485., 4500.], [4500., 4515.], [4515., 4530.], [4530., 4545.], [4545., 4560.], [4560., 4575.], [4575., 4590.], [4590., 4605.], [4605., 4620.], [4620., 4635.], [4635., 4650.], [4650., 4665.], [4665., 4680.], [4680., 4695.], [4695., 4710.], [4710., 4725.], [4725., 4740.], [4740., 4755.], [4755., 4770.], [4770., 4785.], [4785., 4800.], [4800., 4815.], [4815., 4830.], [4830., 4845.], [4845., 4860.], [4860., 4875.], [4875., 4890.], [4890., 4905.], [4905., 4920.], [4920., 4935.], [4935., 4950.], [4950., 4965.], [4965., 4980.], [4980., 4995.], [4995., 5010.], [5010., 5025.], [5025., 5040.], [5040., 5055.], [5055., 5070.], [5070., 5085.], [5085., 5100.], [5100., 5115.], [5115., 5130.], [5130., 5145.], [5145., 5160.], [5160., 5175.], [5175., 5190.], [5190., 5205.], [5205., 5220.], [5220., 5235.]])

Default spectral sampling for the MWIR spectral range (2700 - 5500 nm). Note that we remove the first part of the MWIR (below 3000 nm) as this tends to be very noisy. Spectral resolution is kept constant at 15 nm, resulting in 149 bands.

LWIR = array([[ 7750., 7800.], [ 7800., 7850.], [ 7850., 7900.], [ 7900., 7950.], [ 7950., 8000.], [ 8000., 8050.], [ 8050., 8100.], [ 8100., 8150.], [ 8150., 8200.], [ 8200., 8250.], [ 8250., 8300.], [ 8300., 8350.], [ 8350., 8400.], [ 8400., 8450.], [ 8450., 8500.], [ 8500., 8550.], [ 8550., 8600.], [ 8600., 8650.], [ 8650., 8700.], [ 8700., 8750.], [ 8750., 8800.], [ 8800., 8850.], [ 8850., 8900.], [ 8900., 8950.], [ 8950., 9000.], [ 9000., 9050.], [ 9050., 9100.], [ 9100., 9150.], [ 9150., 9200.], [ 9200., 9250.], [ 9250., 9300.], [ 9300., 9350.], [ 9350., 9400.], [ 9400., 9450.], [ 9450., 9500.], [ 9500., 9550.], [ 9550., 9600.], [ 9600., 9650.], [ 9650., 9700.], [ 9700., 9750.], [ 9750., 9800.], [ 9800., 9850.], [ 9850., 9900.], [ 9900., 9950.], [ 9950., 10000.], [10000., 10050.], [10050., 10100.], [10100., 10150.], [10150., 10200.], [10200., 10250.], [10250., 10300.], [10300., 10350.], [10350., 10400.], [10400., 10450.], [10450., 10500.], [10500., 10550.], [10550., 10600.], [10600., 10650.], [10650., 10700.], [10700., 10750.], [10750., 10800.], [10800., 10850.], [10850., 10900.], [10900., 10950.], [10950., 11000.], [11000., 11050.], [11050., 11100.], [11100., 11150.], [11150., 11200.], [11200., 11250.], [11250., 11300.], [11300., 11350.], [11350., 11400.], [11400., 11450.], [11450., 11500.], [11500., 11550.], [11550., 11600.], [11600., 11650.], [11650., 11700.], [11700., 11750.], [11750., 11800.], [11800., 11850.], [11850., 11900.], [11900., 11950.]])

Default spectral sampling for the LWIR spectral range (7700 - 13000 nm). Note that we remove the first and last bands due to noise, limiting the (default) range to 7750 - 12000 nm. Spectral resolution is constant at 50 nm, resulting in 84 bands.

VSWIR = array([[ 450., 470.], [ 470., 490.], [ 490., 510.], [ 510., 530.], [ 530., 550.], [ 550., 570.], [ 570., 590.], [ 590., 610.], [ 610., 630.], [ 630., 650.], [ 650., 670.], [ 670., 690.], [ 690., 710.], [ 710., 730.], [ 730., 750.], [ 750., 770.], [ 770., 790.], [ 790., 810.], [ 810., 830.], [ 830., 850.], [ 850., 870.], [ 870., 890.], [ 890., 910.], [ 910., 930.], [ 930., 950.], [ 950., 970.], [ 970., 990.], [1000., 1020.], [1020., 1040.], [1040., 1060.], [1060., 1080.], [1080., 1100.], [1100., 1120.], [1120., 1140.], [1140., 1160.], [1160., 1180.], [1180., 1200.], [1200., 1220.], [1220., 1240.], [1240., 1260.], [1260., 1280.], [1280., 1300.], [1300., 1310.], [1310., 1320.], [1320., 1330.], [1330., 1340.], [1340., 1350.], [1350., 1360.], [1360., 1370.], [1370., 1380.], [1380., 1390.], [1390., 1400.], [1400., 1410.], [1410., 1420.], [1420., 1430.], [1430., 1440.], [1440., 1450.], [1450., 1460.], [1460., 1470.], [1470., 1480.], [1480., 1490.], [1490., 1500.], [1500., 1510.], [1510., 1520.], [1520., 1530.], [1530., 1540.], [1540., 1550.], [1550., 1560.], [1560., 1570.], [1570., 1580.], [1580., 1590.], [1590., 1600.], [1600., 1610.], [1610., 1620.], [1620., 1630.], [1630., 1640.], [1640., 1650.], [1650., 1660.], [1660., 1670.], [1670., 1680.], [1680., 1690.], [1690., 1700.], [1700., 1710.], [1710., 1720.], [1720., 1730.], [1730., 1740.], [1740., 1750.], [1750., 1760.], [1760., 1770.], [1770., 1780.], [1780., 1790.], [1790., 1800.], [1800., 1810.], [1810., 1820.], [1820., 1830.], [1830., 1840.], [1840., 1850.], [1850., 1860.], [1860., 1870.], [1870., 1880.], [1880., 1890.], [1890., 1900.], [1900., 1910.], [1910., 1920.], [1920., 1930.], [1930., 1940.], [1940., 1950.], [1950., 1960.], [1960., 1970.], [1970., 1980.], [1980., 1990.], [1990., 2000.], [2000., 2010.], [2010., 2020.], [2020., 2030.], [2030., 2040.], [2040., 2050.], [2050., 2060.], [2060., 2070.], [2070., 2080.], [2080., 2090.], [2090., 2100.], [2100., 2110.], [2110., 2120.], [2120., 2130.], [2130., 2140.], [2140., 2150.], [2150., 2160.], [2160., 2170.], [2170., 2180.], [2180., 2190.], [2190., 2200.], [2200., 2210.], [2210., 2220.], [2220., 2230.], [2230., 2240.], [2240., 2250.], [2250., 2260.], [2260., 2270.], [2270., 2280.], [2280., 2290.], [2290., 2300.], [2300., 2310.], [2310., 2320.], [2320., 2330.], [2330., 2340.], [2340., 2350.], [2350., 2360.], [2360., 2370.], [2370., 2380.], [2380., 2390.], [2390., 2400.], [2400., 2410.], [2410., 2420.], [2420., 2430.], [2430., 2440.], [2440., 2450.], [2450., 2460.], [2460., 2470.], [2470., 2480.], [2480., 2490.]])

Concatenated VNIR and SWIR spectral sampling (for VSWIR sensors). This results in a total of 161 bands.