earthlib.read
Functions for reading specifically formatted data, mostly spectral libraries.
check_file(path)
¶
Verifies whether a file exists and can be read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
the file path to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
file status. |
Source code in earthlib/read.py
105 106 107 108 109 110 111 112 113 114 | |
find_envi_header(path)
¶
Generates the file paths for an ENVI spectral library and its header file.
Source code in earthlib/read.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
jfsp(path)
¶
Reads JFSP-formatted ASCII files.
Reads the ASCII format spectral data from the Joint Fire Science Program and returns an object with the mean and ± standard deviation reflectance.
www.frames.gov/assessing-burn-severity/spectral-library/overview
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
file path to the JFSP spectra text file. |
required |
Returns:
| Type | Description |
|---|---|
Spectra
|
an earthlib Spectra with the JFSP reflectance data. |
Source code in earthlib/read.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
spectral_library(path, sensor=None, metadata=None)
¶
Reads an ENVI-format spectral library into memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
path to the spectral library file. Searches for a .hdr sidecar file. |
required |
sensor
|
Sensor | None
|
an earthlib.sensors.Sensor object specifying sensor information not included in the .hdr file. |
None
|
Returns:
| Type | Description |
|---|---|
Spectra
|
endmembers from the spectral library |
Source code in earthlib/read.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |