GSV soil simulation

This package contains adapted GCV soil model presented by [JF19].

GSV

General Spectral Vectors (GSV) soil model. The code in this script is based on the code written by authors of [JF19].

GSV_WLS = array([ 400,  410,  420,  430,  440,  450,  460,  470,  480,  490,  500,         510,  520,  530,  540,  550,  560,  570,  580,  590,  600,  610,         620,  630,  640,  650,  660,  670,  680,  690,  700,  710,  720,         730,  740,  750,  760,  770,  780,  790,  800,  810,  820,  830,         840,  850,  860,  870,  880,  890,  900,  910,  920,  930,  940,         950,  960,  970,  980,  990, 1000, 1010, 1020, 1030, 1040, 1050,        1060, 1070, 1080, 1090, 1100, 1110, 1120, 1130, 1140, 1150, 1160,        1170, 1180, 1190, 1200, 1210, 1220, 1230, 1240, 1250, 1260, 1270,        1280, 1290, 1300, 1310, 1320, 1330, 1340, 1350, 1360, 1370, 1380,        1390, 1400, 1410, 1420, 1430, 1440, 1450, 1460, 1470, 1480, 1490,        1500, 1510, 1520, 1530, 1540, 1550, 1560, 1570, 1580, 1590, 1600,        1610, 1620, 1630, 1640, 1650, 1660, 1670, 1680, 1690, 1700, 1710,        1720, 1730, 1740, 1750, 1760, 1770, 1780, 1790, 1800, 1810, 1820,        1830, 1840, 1850, 1860, 1870, 1880, 1890, 1900, 1910, 1920, 1930,        1940, 1950, 1960, 1970, 1980, 1990, 2000, 2010, 2020, 2030, 2040,        2050, 2060, 2070, 2080, 2090, 2100, 2110, 2120, 2130, 2140, 2150,        2160, 2170, 2180, 2190, 2200, 2210, 2220, 2230, 2240, 2250, 2260,        2270, 2280, 2290, 2300, 2310, 2320, 2330, 2340, 2350, 2360, 2370,        2380, 2390, 2400, 2410, 2420, 2430, 2440, 2450, 2460, 2470, 2480,        2490, 2500])

Native hyperspectral wavelengths of GSV ranging from 400-2500 nm with 10 nm resolution.

NEW_WLS = array([ 400,  401,  402, ..., 2498, 2499, 2500], shape=(2101,))

Wavelengths from 400-2500 nm with 1 nm resolution. Spectral resolution in HyperBlend is assumed to be 1 nm, so we linearly interpolate the native GSV resolution to 1 nm.

_write_default_soils()

Write all default soil spectra to a file.

These will be included in the code repository so no need to use.

default_soils = {'dry_clay': [0.459, 0.011, -0.009, 0.038], 'dry_peat': [0.384, -0.22, 0.044, -0.066], 'dry_sand': [0.539, -0.009, -0.068, 0.079], 'median_humid_clay': [0.528, -0.011, 0.014, -0.129], 'median_humid_peat': [0.581, -0.268, 0.061, -0.303], 'median_humid_sand': [0.512, -0.044, -0.044, -0.103], 'wet_clay': [0.245, -0.039, 0.003, -0.145], 'wet_peat': [0.423, -0.163, 0.045, -0.461], 'wet_sand': [0.649, -0.065, 0.002, -0.587]}

Default c_n and c_SM values for different kinds of soils from Table 3 in page 9 of the paper.

simulate_default_soil(soil_name: str)

Run GSV soil simulation with one of the default soil types (soil_name).

Parameters:

soil_name

One of the following:

”wet_clay” “median_humid_clay” “dry_clay” “wet_sand” “median_humid_sand” “dry_sand” “wet_peat” “median_humid_peat” “dry_peat”

Returns:

Returns reflectance spectra for given soil type and moisture defined by soil name. Reflectance is returned as a 1D Numpy array from 400-2500 nm with 1 nm resolution that is linearly interpolated from the native GSV resolution of 10 nm.

simulate_gsv_soil(c1: float, c2: float, c3: float, cSM: float)

Simulate soil spectra with GSV model.

Parameters c1,c2,c3 are tuning parameters for dry soil (in descending order of importance). Parameter cSM is for wet soil. This allows arbitrary soil spectra generation. If you want to use one of the pre-defined soil types, use simulate_default_soil().

Parameters:
  • c1 – Tuning parameter for dry soil.

  • c2 – Tuning parameter for dry soil.

  • c3 – Tuning parameter for dry soil.

  • cSM – Tuning parameter for wet soil. This is usually between -0.5 and 0.0. Positive values often causes water absorption peaks in near infrared to flip in the wrong way.

Returns:

Returns reflectance spectra for given soil type and moisture defined by soil name. Reflectance is returned as a 1D Numpy array from 400-2500 nm with 1 nm resolution that is linearly interpolated from the native GSV resolution of 10 nm.

visualize_default_soils(dont_show=True, save=True)

Visualize default soils’ reflectance spectra.

Parameters:
  • dont_show – If True (default), the plot is not shown, otherwise, show the plot using pyplot show(), which will halt the execution of the program until the window is manually shut.

  • save – If True (default), save the plot to disk.

write_soil_spectra(reflectance_spectra, filename)

Write soil reflectance spectra to a csv file. This is ‘master’ spectra that is later copied (with possible resampling) to scene directory.

Parameters:
  • reflectance_spectra – Reflectance values corresponding to each wavelength.

  • filename – Filename used for saving. Directory is fixed to root/soil_data/.