obpg-orm 1.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. obpg_orm-1.1.5/PKG-INFO +105 -0
  2. obpg_orm-1.1.5/README.md +91 -0
  3. obpg_orm-1.1.5/docs/get_brdf.md +49 -0
  4. obpg_orm-1.1.5/docs/get_f0.md +31 -0
  5. obpg_orm-1.1.5/docs/morel_read.md +34 -0
  6. obpg_orm-1.1.5/docs/utils.md +30 -0
  7. obpg_orm-1.1.5/obpg_orm.egg-info/PKG-INFO +105 -0
  8. obpg_orm-1.1.5/obpg_orm.egg-info/SOURCES.txt +37 -0
  9. obpg_orm-1.1.5/obpg_orm.egg-info/dependency_links.txt +1 -0
  10. obpg_orm-1.1.5/obpg_orm.egg-info/entry_points.txt +5 -0
  11. obpg_orm-1.1.5/obpg_orm.egg-info/requires.txt +4 -0
  12. obpg_orm-1.1.5/obpg_orm.egg-info/top_level.txt +1 -0
  13. obpg_orm-1.1.5/orm/__init__.py +0 -0
  14. obpg_orm-1.1.5/orm/data/aph_bricaud_1998.txt +163 -0
  15. obpg_orm-1.1.5/orm/data/f.dat +491 -0
  16. obpg_orm-1.1.5/orm/data/f0_tsis_1nm_v2.nc +0 -0
  17. obpg_orm-1.1.5/orm/data/fp.dat +491 -0
  18. obpg_orm-1.1.5/orm/data/mm01_kbio.nc +0 -0
  19. obpg_orm-1.1.5/orm/data/mm01_kbio.txt +72 -0
  20. obpg_orm-1.1.5/orm/data/morel_fq.nc +0 -0
  21. obpg_orm-1.1.5/orm/data/morel_fq_appb.dat +34 -0
  22. obpg_orm-1.1.5/orm/data/morel_fq_appb.nc +0 -0
  23. obpg_orm-1.1.5/orm/data/morel_fq_hyperspectral.nc +0 -0
  24. obpg_orm-1.1.5/orm/data/morel_mud_f_fp.nc +0 -0
  25. obpg_orm-1.1.5/orm/data/mud.dat +491 -0
  26. obpg_orm-1.1.5/orm/data/thuillier.dat +730 -0
  27. obpg_orm-1.1.5/orm/data/thuillier2003_f0.nc +0 -0
  28. obpg_orm-1.1.5/orm/data/water_spectra.nc +0 -0
  29. obpg_orm-1.1.5/orm/get_brdf.py +185 -0
  30. obpg_orm-1.1.5/orm/get_f0.py +150 -0
  31. obpg_orm-1.1.5/orm/kbio-netCDF.py +41 -0
  32. obpg_orm-1.1.5/orm/model.py +419 -0
  33. obpg_orm-1.1.5/orm/morel_fq_appb-netCDF.py +78 -0
  34. obpg_orm-1.1.5/orm/morel_read.py +143 -0
  35. obpg_orm-1.1.5/orm/mud_f_fp-netCDF.py +77 -0
  36. obpg_orm-1.1.5/orm/orm.py +181 -0
  37. obpg_orm-1.1.5/orm/utils.py +217 -0
  38. obpg_orm-1.1.5/pyproject.toml +39 -0
  39. obpg_orm-1.1.5/setup.cfg +4 -0
@@ -0,0 +1,105 @@
1
+ Metadata-Version: 2.4
2
+ Name: obpg-orm
3
+ Version: 1.1.5
4
+ Summary: ORM generates hyperspectral (1nm) or sensor-specific Rrs (or Lwn) spectra using an ocean reflectance model described in:
5
+ Author-email: Sean Bailey <sean.w.bailey@nasa.gov>
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Operating System :: OS Independent
8
+ Requires-Python: >=3.8
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: scipy>=1.3.1
11
+ Requires-Dist: requests>=2.22.0
12
+ Requires-Dist: numpy>=1.17.1
13
+ Requires-Dist: netCDF4>=1.5.2
14
+
15
+ # Ocean Reflectance Model (ORM, clever, aren't we?)
16
+ ## About
17
+ ORM generates hyperspectral (1nm) or sensor-specific Rrs (or Lwn) spectra using the
18
+ ocean reflectance model described in:
19
+
20
+ P. Jeremy Werdell, Sean W. Bailey, Bryan A. Franz, André Morel, and
21
+ Charles R. McClain, "On-orbit vicarious calibration of ocean color sensors
22
+ using an ocean surface reflectance model" Appl. Opt. 46, 5649-5666 (2007),
23
+ https://doi.org/10.1364/AO.46.005649
24
+
25
+ ## License
26
+ NASA Opensource Agreement (NOSA) v1.3 (pending)
27
+
28
+ ## What's in the box
29
+ * orm - the driver
30
+ * [get_brdf](docs/get_brdf.md) - functions to derive the Morel BRDF correction
31
+ * [get_f0](docs/get_f0.md) - functions to retrieve the extraterrestrial irradiance
32
+ * [morel_read](docs/morel_read.md) - functions to read the various look-up tables
33
+
34
+ ### Running the model from the driver script
35
+ ```
36
+ usage: orm [-h] [--version] [--sensor {modisa,modist,viirsn,viirsj1,seawifs,meris,olcis3a,olcis3b,octs,czcs}] [--output_file OUTPUT_FILE] [--adg [ADG]]
37
+ [--aph [APH]] [--bbp [BBP]] [--bbp_s [BBP_S]] [--solz SOLZ [SOLZ ...]] [--wvl WVL [WVL ...]] [--bandpass BANDPASS] [--lwn] [--disable_iter_limit]
38
+ [--gordon] [--verbose]
39
+ chl [chl ...]
40
+
41
+ positional arguments:
42
+ chl Chlorophyll concentration
43
+
44
+ optional arguments:
45
+ -h, --help show this help message and exit
46
+ --version show program's version number and exit
47
+ --sensor {modisa,modist,viirsn,viirsj1,seawifs,meris,olcis3a,
48
+ olcis3b,octs,czcs}
49
+ Sensor to mimic
50
+ --output_file OUTPUT_FILE
51
+ output netCDF LUT filename; default is STDOUT
52
+ --adg [ADG] Detrital and Gelbstoff absorption coefficient at 443nm
53
+ --aph [APH] Phytoplankton absorption coefficient at 443nm
54
+ --bbp [BBP] Particulate backscattering coefficient at 443nm
55
+ --bbp_s [BBP_S] Particulate backscattering slope
56
+ --solz SOLZ [SOLZ ...]
57
+ Solar zenith angle. If provided, it should either be a single value or an array matching the size of the input chlorophyll array. The
58
+ default is 30 degrees
59
+ --wvl WVL [WVL ...] Wavelength(s) to generate
60
+ --bandpass BANDPASS Bandpass width of wavelength(s) to generate
61
+ --lwn output normalized Lw instead of Rrs
62
+ --disable_iter_limit allow MM01 iteration to run to convergence
63
+ --gordon, -g Use the Gordon quadratic formulation with input IOPs
64
+ --verbose, -v
65
+ ```
66
+
67
+ ### The "key" functions
68
+ model.gordon_rrs(adg, aph, bbp, bbp_s, chl, lwn=False, wvl=None, bandpass=11)
69
+ Calculate Rrs given chlorophyll and IOPs.
70
+ Uses the Gordon quadratic formulation.
71
+
72
+ model.morel_rrs(chl, solz=None, wvl=None, bandpass=11, lwn=False, mm01iter=True, use_fq=False)
73
+ Calculate Rrs given chlorophyll and solar zenith angle.
74
+ Based mostly on Morel and Maritorena 2001
75
+ Rrs = trans * (f / Q) * {bb / (a + bb)}, where (a + bb) ~ mud * Kd
76
+
77
+ model.rrs_below_to_above(rrs_s, q=3.141529, gordon=False)
78
+ Compute above-water Rrs from sub-surface rrs.
79
+ Uses Lee et al 2002 or Gordon 1988.
80
+
81
+ utils.convolve_rsr(sensor, spectrum, verbose=False)
82
+ Convolve 1nm resolution Rrs with a spectral response function.
83
+
84
+ ### Example: Using the underlying functions in your own script
85
+ ```
86
+ from orm.model import gordon_rrs, morel_rrs
87
+ from orm.utils import convolve_rsr
88
+ adg = 0.0045
89
+ aph = 0.0063
90
+ bbp = 0.00154
91
+ bbp_s = 1.985
92
+ chl = 0.0603
93
+ # Gordon model
94
+ spectrum = gordon_rrs(adg, aph, bbp, bbp_s, chl, lwn=True)
95
+ (wvl, lwn) = convolve_rsr('seawifs',spectrum)
96
+ # Morel model
97
+ spectrum = morel_rrs(chl, solz=40,lwn=True, mm01iter=True)
98
+ (wvl, lwn) = convolve_rsr('seawifs',spectrum)
99
+
100
+ ```
101
+
102
+ ### A few extra things, not really needed...
103
+ * kbio-netCDF - a script to generate a netCDF version of the Morel & Maritorena (2001) kbio tables
104
+ * morel_fq_appb-netCDF - a script to generate a netCDF version of the Morel f/Q tables
105
+ * mud_f_fp-netCDF - a script to generate a netCDF version of the Morel f, f-prime and mud tables
@@ -0,0 +1,91 @@
1
+ # Ocean Reflectance Model (ORM, clever, aren't we?)
2
+ ## About
3
+ ORM generates hyperspectral (1nm) or sensor-specific Rrs (or Lwn) spectra using the
4
+ ocean reflectance model described in:
5
+
6
+ P. Jeremy Werdell, Sean W. Bailey, Bryan A. Franz, André Morel, and
7
+ Charles R. McClain, "On-orbit vicarious calibration of ocean color sensors
8
+ using an ocean surface reflectance model" Appl. Opt. 46, 5649-5666 (2007),
9
+ https://doi.org/10.1364/AO.46.005649
10
+
11
+ ## License
12
+ NASA Opensource Agreement (NOSA) v1.3 (pending)
13
+
14
+ ## What's in the box
15
+ * orm - the driver
16
+ * [get_brdf](docs/get_brdf.md) - functions to derive the Morel BRDF correction
17
+ * [get_f0](docs/get_f0.md) - functions to retrieve the extraterrestrial irradiance
18
+ * [morel_read](docs/morel_read.md) - functions to read the various look-up tables
19
+
20
+ ### Running the model from the driver script
21
+ ```
22
+ usage: orm [-h] [--version] [--sensor {modisa,modist,viirsn,viirsj1,seawifs,meris,olcis3a,olcis3b,octs,czcs}] [--output_file OUTPUT_FILE] [--adg [ADG]]
23
+ [--aph [APH]] [--bbp [BBP]] [--bbp_s [BBP_S]] [--solz SOLZ [SOLZ ...]] [--wvl WVL [WVL ...]] [--bandpass BANDPASS] [--lwn] [--disable_iter_limit]
24
+ [--gordon] [--verbose]
25
+ chl [chl ...]
26
+
27
+ positional arguments:
28
+ chl Chlorophyll concentration
29
+
30
+ optional arguments:
31
+ -h, --help show this help message and exit
32
+ --version show program's version number and exit
33
+ --sensor {modisa,modist,viirsn,viirsj1,seawifs,meris,olcis3a,
34
+ olcis3b,octs,czcs}
35
+ Sensor to mimic
36
+ --output_file OUTPUT_FILE
37
+ output netCDF LUT filename; default is STDOUT
38
+ --adg [ADG] Detrital and Gelbstoff absorption coefficient at 443nm
39
+ --aph [APH] Phytoplankton absorption coefficient at 443nm
40
+ --bbp [BBP] Particulate backscattering coefficient at 443nm
41
+ --bbp_s [BBP_S] Particulate backscattering slope
42
+ --solz SOLZ [SOLZ ...]
43
+ Solar zenith angle. If provided, it should either be a single value or an array matching the size of the input chlorophyll array. The
44
+ default is 30 degrees
45
+ --wvl WVL [WVL ...] Wavelength(s) to generate
46
+ --bandpass BANDPASS Bandpass width of wavelength(s) to generate
47
+ --lwn output normalized Lw instead of Rrs
48
+ --disable_iter_limit allow MM01 iteration to run to convergence
49
+ --gordon, -g Use the Gordon quadratic formulation with input IOPs
50
+ --verbose, -v
51
+ ```
52
+
53
+ ### The "key" functions
54
+ model.gordon_rrs(adg, aph, bbp, bbp_s, chl, lwn=False, wvl=None, bandpass=11)
55
+ Calculate Rrs given chlorophyll and IOPs.
56
+ Uses the Gordon quadratic formulation.
57
+
58
+ model.morel_rrs(chl, solz=None, wvl=None, bandpass=11, lwn=False, mm01iter=True, use_fq=False)
59
+ Calculate Rrs given chlorophyll and solar zenith angle.
60
+ Based mostly on Morel and Maritorena 2001
61
+ Rrs = trans * (f / Q) * {bb / (a + bb)}, where (a + bb) ~ mud * Kd
62
+
63
+ model.rrs_below_to_above(rrs_s, q=3.141529, gordon=False)
64
+ Compute above-water Rrs from sub-surface rrs.
65
+ Uses Lee et al 2002 or Gordon 1988.
66
+
67
+ utils.convolve_rsr(sensor, spectrum, verbose=False)
68
+ Convolve 1nm resolution Rrs with a spectral response function.
69
+
70
+ ### Example: Using the underlying functions in your own script
71
+ ```
72
+ from orm.model import gordon_rrs, morel_rrs
73
+ from orm.utils import convolve_rsr
74
+ adg = 0.0045
75
+ aph = 0.0063
76
+ bbp = 0.00154
77
+ bbp_s = 1.985
78
+ chl = 0.0603
79
+ # Gordon model
80
+ spectrum = gordon_rrs(adg, aph, bbp, bbp_s, chl, lwn=True)
81
+ (wvl, lwn) = convolve_rsr('seawifs',spectrum)
82
+ # Morel model
83
+ spectrum = morel_rrs(chl, solz=40,lwn=True, mm01iter=True)
84
+ (wvl, lwn) = convolve_rsr('seawifs',spectrum)
85
+
86
+ ```
87
+
88
+ ### A few extra things, not really needed...
89
+ * kbio-netCDF - a script to generate a netCDF version of the Morel & Maritorena (2001) kbio tables
90
+ * morel_fq_appb-netCDF - a script to generate a netCDF version of the Morel f/Q tables
91
+ * mud_f_fp-netCDF - a script to generate a netCDF version of the Morel f, f-prime and mud tables
@@ -0,0 +1,49 @@
1
+ # NAME
2
+ get_brdf
3
+
4
+ ## DESCRIPTION
5
+ Estimate f/Q for a given suite of observations.
6
+
7
+ ## References:
8
+ Morel and Gentilli, Applied Optics, 35(24), 1996
9
+ Morel et al., Applied Optics, 41(3), 2002
10
+
11
+ ## Input:
12
+ wavelength float [w]
13
+ solar zenith angle float [s]
14
+ chl concentration float [chl_in]
15
+ nadir zenith angle float [n]
16
+ azimuth angle float [a]
17
+ f/Q table array fltarr [foq_data]
18
+
19
+ ## Output:
20
+ f/Q correction term float [fq]
21
+
22
+ ## Usage:
23
+ ```
24
+ get_brdf.py [-h] [--version] [--solz SOLZ] [--viewz VIEWZ] [--relaz RELAZ] [--output_file OUTPUT_FILE] chl [chl ...]
25
+
26
+ calculate Morel brdf correction
27
+
28
+ positional arguments:
29
+ chl input chlorophyll
30
+
31
+ optional arguments:
32
+ -h, --help show this help message and exit
33
+ --version show program's version number and exit
34
+ --solz SOLZ input solar zenith angle
35
+ --viewz VIEWZ input view zenith angle
36
+ --relaz RELAZ input relative azimuth angle
37
+ --output_file OUTPUT_FILE
38
+ optional output filename; default: STDOUT
39
+ ```
40
+
41
+ # FUNCTIONS
42
+ fq_table_interp()
43
+ Load the f/Q datatable for interpolation.
44
+
45
+ get_fq(solz, viewz, relaz, chl, wvl=None)
46
+ Interpolate inputs for f/Q.
47
+
48
+ morel_brdf(chl, solz, viewz, relaz, wvl=None, corr=False)
49
+ Calculate the Morel brdf correction.
@@ -0,0 +1,31 @@
1
+
2
+ # NAME
3
+ get_f0
4
+ ## DESCRIPTION
5
+ Return extraterrestrial irradiance from the Thuillier 2003 lookup table.
6
+
7
+ ## USAGE:
8
+ ```
9
+ usage: get_f0.py [-h] [--version] [--output_file OUTPUT_FILE] [--wvl WVL [WVL ...]] [--datetime DATETIME] [--verbose]
10
+
11
+ Generates hyperspectral (1nm) or 10nm bandpass averaged extraterrestrial irradiance spectrum using Thuillier (2002):
12
+
13
+ optional arguments:
14
+ -h, --help show this help message and exit
15
+ --version show program's version number and exit
16
+ --output_file OUTPUT_FILE
17
+ output filename; default is STDOUT
18
+ --wvl WVL [WVL ...] wavelength(s) to generate
19
+ --datetime DATETIME ISO8601 date used to correct for Earth-Sun distance
20
+ --verbose, -v
21
+ ```
22
+
23
+ ## FUNCTIONS
24
+ correct_esdist(obstime)
25
+ Calculate the Earth-Sun distance correction factor to apply to F0.
26
+
27
+ get_f0(wvls=None, obstime=None)
28
+ Load Thuillier2003 netcdf and return f0.
29
+
30
+ Defaults to returning the full table. Input obstime to correct for the
31
+ Earth-Sun distance.
@@ -0,0 +1,34 @@
1
+ # NAME
2
+ morel_read
3
+ ## DESCRIPTION:
4
+ Modules that read in Morel look-up tables
5
+
6
+ ## USAGE:
7
+ ```
8
+ usage: morel_read.py [-h] [--version] [--table {mud,fn,fp}] chl solz
9
+
10
+ Read Morel tables
11
+
12
+ positional arguments:
13
+ chl input chlorophyll
14
+ solz input solar zenith angle
15
+
16
+ optional arguments:
17
+ -h, --help show this help message and exit
18
+ --version show program's version number and exit
19
+ --table {mud,fn,fp}, -t {mud,fn,fp}
20
+ Morel table to interpolate
21
+ ```
22
+
23
+ ## FUNCTIONS
24
+ get_script_path()
25
+ Return path to orm_morel table.
26
+
27
+ morel_q_interp()
28
+ Read Morel f/Q table and interpolate.
29
+
30
+ morel_read(chl, solz, mud=False, fn=False, fp=False)
31
+ Standalone version, reads Morel tables and interpolates.
32
+
33
+ morel_table_interp(mud=False, fn=False, fp=False)
34
+ Read Morel f, fp, and mud tables and interpolate.
@@ -0,0 +1,30 @@
1
+ # NAME
2
+ utils
3
+
4
+ ## FUNCTIONS
5
+ bandpass_avg_rrs(rrs, wvl, bandpass=11)
6
+ Calculate bandpass averaged Rrs centered on discrete wavelengths.
7
+
8
+ convolve_rsr(sensor, spectrum, verbose=False)
9
+ Convolve 1nm resolution Rrs with a spectral response function.
10
+
11
+ download_rsrfile(remotefile, localfile)
12
+
13
+ get_data_path(subdir=None, envroot=None)
14
+ Get path to OCDATAROOT and subdirectories.
15
+
16
+ get_wavelength_array()
17
+
18
+ read_sensor_RSR(sensor, verbose=False)
19
+ Read a sensor spectral response (RSR) from the OCW through https.
20
+
21
+ Files can be found at oceancolor.gsfc.nasa.gov/resources/docs/rsr_tables/
22
+ Input:
23
+ Sensor name (string)
24
+ Output:
25
+ normalized Rsr (wavelength, sensor band)
26
+ wavelengths of spectral response function
27
+ sensor band labels
28
+
29
+ rrs_to_lwn(rrs)
30
+ Convert rrs to Lwn.
@@ -0,0 +1,105 @@
1
+ Metadata-Version: 2.4
2
+ Name: obpg-orm
3
+ Version: 1.1.5
4
+ Summary: ORM generates hyperspectral (1nm) or sensor-specific Rrs (or Lwn) spectra using an ocean reflectance model described in:
5
+ Author-email: Sean Bailey <sean.w.bailey@nasa.gov>
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Operating System :: OS Independent
8
+ Requires-Python: >=3.8
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: scipy>=1.3.1
11
+ Requires-Dist: requests>=2.22.0
12
+ Requires-Dist: numpy>=1.17.1
13
+ Requires-Dist: netCDF4>=1.5.2
14
+
15
+ # Ocean Reflectance Model (ORM, clever, aren't we?)
16
+ ## About
17
+ ORM generates hyperspectral (1nm) or sensor-specific Rrs (or Lwn) spectra using the
18
+ ocean reflectance model described in:
19
+
20
+ P. Jeremy Werdell, Sean W. Bailey, Bryan A. Franz, André Morel, and
21
+ Charles R. McClain, "On-orbit vicarious calibration of ocean color sensors
22
+ using an ocean surface reflectance model" Appl. Opt. 46, 5649-5666 (2007),
23
+ https://doi.org/10.1364/AO.46.005649
24
+
25
+ ## License
26
+ NASA Opensource Agreement (NOSA) v1.3 (pending)
27
+
28
+ ## What's in the box
29
+ * orm - the driver
30
+ * [get_brdf](docs/get_brdf.md) - functions to derive the Morel BRDF correction
31
+ * [get_f0](docs/get_f0.md) - functions to retrieve the extraterrestrial irradiance
32
+ * [morel_read](docs/morel_read.md) - functions to read the various look-up tables
33
+
34
+ ### Running the model from the driver script
35
+ ```
36
+ usage: orm [-h] [--version] [--sensor {modisa,modist,viirsn,viirsj1,seawifs,meris,olcis3a,olcis3b,octs,czcs}] [--output_file OUTPUT_FILE] [--adg [ADG]]
37
+ [--aph [APH]] [--bbp [BBP]] [--bbp_s [BBP_S]] [--solz SOLZ [SOLZ ...]] [--wvl WVL [WVL ...]] [--bandpass BANDPASS] [--lwn] [--disable_iter_limit]
38
+ [--gordon] [--verbose]
39
+ chl [chl ...]
40
+
41
+ positional arguments:
42
+ chl Chlorophyll concentration
43
+
44
+ optional arguments:
45
+ -h, --help show this help message and exit
46
+ --version show program's version number and exit
47
+ --sensor {modisa,modist,viirsn,viirsj1,seawifs,meris,olcis3a,
48
+ olcis3b,octs,czcs}
49
+ Sensor to mimic
50
+ --output_file OUTPUT_FILE
51
+ output netCDF LUT filename; default is STDOUT
52
+ --adg [ADG] Detrital and Gelbstoff absorption coefficient at 443nm
53
+ --aph [APH] Phytoplankton absorption coefficient at 443nm
54
+ --bbp [BBP] Particulate backscattering coefficient at 443nm
55
+ --bbp_s [BBP_S] Particulate backscattering slope
56
+ --solz SOLZ [SOLZ ...]
57
+ Solar zenith angle. If provided, it should either be a single value or an array matching the size of the input chlorophyll array. The
58
+ default is 30 degrees
59
+ --wvl WVL [WVL ...] Wavelength(s) to generate
60
+ --bandpass BANDPASS Bandpass width of wavelength(s) to generate
61
+ --lwn output normalized Lw instead of Rrs
62
+ --disable_iter_limit allow MM01 iteration to run to convergence
63
+ --gordon, -g Use the Gordon quadratic formulation with input IOPs
64
+ --verbose, -v
65
+ ```
66
+
67
+ ### The "key" functions
68
+ model.gordon_rrs(adg, aph, bbp, bbp_s, chl, lwn=False, wvl=None, bandpass=11)
69
+ Calculate Rrs given chlorophyll and IOPs.
70
+ Uses the Gordon quadratic formulation.
71
+
72
+ model.morel_rrs(chl, solz=None, wvl=None, bandpass=11, lwn=False, mm01iter=True, use_fq=False)
73
+ Calculate Rrs given chlorophyll and solar zenith angle.
74
+ Based mostly on Morel and Maritorena 2001
75
+ Rrs = trans * (f / Q) * {bb / (a + bb)}, where (a + bb) ~ mud * Kd
76
+
77
+ model.rrs_below_to_above(rrs_s, q=3.141529, gordon=False)
78
+ Compute above-water Rrs from sub-surface rrs.
79
+ Uses Lee et al 2002 or Gordon 1988.
80
+
81
+ utils.convolve_rsr(sensor, spectrum, verbose=False)
82
+ Convolve 1nm resolution Rrs with a spectral response function.
83
+
84
+ ### Example: Using the underlying functions in your own script
85
+ ```
86
+ from orm.model import gordon_rrs, morel_rrs
87
+ from orm.utils import convolve_rsr
88
+ adg = 0.0045
89
+ aph = 0.0063
90
+ bbp = 0.00154
91
+ bbp_s = 1.985
92
+ chl = 0.0603
93
+ # Gordon model
94
+ spectrum = gordon_rrs(adg, aph, bbp, bbp_s, chl, lwn=True)
95
+ (wvl, lwn) = convolve_rsr('seawifs',spectrum)
96
+ # Morel model
97
+ spectrum = morel_rrs(chl, solz=40,lwn=True, mm01iter=True)
98
+ (wvl, lwn) = convolve_rsr('seawifs',spectrum)
99
+
100
+ ```
101
+
102
+ ### A few extra things, not really needed...
103
+ * kbio-netCDF - a script to generate a netCDF version of the Morel & Maritorena (2001) kbio tables
104
+ * morel_fq_appb-netCDF - a script to generate a netCDF version of the Morel f/Q tables
105
+ * mud_f_fp-netCDF - a script to generate a netCDF version of the Morel f, f-prime and mud tables
@@ -0,0 +1,37 @@
1
+ README.md
2
+ pyproject.toml
3
+ docs/get_brdf.md
4
+ docs/get_f0.md
5
+ docs/morel_read.md
6
+ docs/utils.md
7
+ obpg_orm.egg-info/PKG-INFO
8
+ obpg_orm.egg-info/SOURCES.txt
9
+ obpg_orm.egg-info/dependency_links.txt
10
+ obpg_orm.egg-info/entry_points.txt
11
+ obpg_orm.egg-info/requires.txt
12
+ obpg_orm.egg-info/top_level.txt
13
+ orm/__init__.py
14
+ orm/get_brdf.py
15
+ orm/get_f0.py
16
+ orm/kbio-netCDF.py
17
+ orm/model.py
18
+ orm/morel_fq_appb-netCDF.py
19
+ orm/morel_read.py
20
+ orm/mud_f_fp-netCDF.py
21
+ orm/orm.py
22
+ orm/utils.py
23
+ orm/data/aph_bricaud_1998.txt
24
+ orm/data/f.dat
25
+ orm/data/f0_tsis_1nm_v2.nc
26
+ orm/data/fp.dat
27
+ orm/data/mm01_kbio.nc
28
+ orm/data/mm01_kbio.txt
29
+ orm/data/morel_fq.nc
30
+ orm/data/morel_fq_appb.dat
31
+ orm/data/morel_fq_appb.nc
32
+ orm/data/morel_fq_hyperspectral.nc
33
+ orm/data/morel_mud_f_fp.nc
34
+ orm/data/mud.dat
35
+ orm/data/thuillier.dat
36
+ orm/data/thuillier2003_f0.nc
37
+ orm/data/water_spectra.nc
@@ -0,0 +1,5 @@
1
+ [console_scripts]
2
+ get_brdf = orm.get_brdf:main
3
+ get_f0 = orm.get_f0:main
4
+ morel_read = orm.morel_read:main
5
+ obpg-orm = orm.orm:main
@@ -0,0 +1,4 @@
1
+ scipy>=1.3.1
2
+ requests>=2.22.0
3
+ numpy>=1.17.1
4
+ netCDF4>=1.5.2
@@ -0,0 +1 @@
1
+ orm
File without changes
@@ -0,0 +1,163 @@
1
+ /begin_header
2
+ /missing=-999
3
+ /delimiter=comma
4
+ !
5
+ ! Bricaud et al. 1998, JGR 103, 31033-31044
6
+ ! ap = Ap Chl^Ep
7
+ ! ap* = Ap Chl^(Ep-1)
8
+ ! aphi = Aphi Chl^Ephi
9
+ ! aphi* = Aphi Chl^(Ephi-1)
10
+ !
11
+ /fields=lambda,Ap,Ep,Aphi,Ephi
12
+ /end_header
13
+ 400,0.043321,0.702647,0.0240515,0.687735
14
+ 402,0.043805,0.700084,0.0248166,0.688701
15
+ 404,0.044307,0.697132,0.0255988,0.686988
16
+ 406,0.045064,0.694026,0.0265531,0.686489
17
+ 408,0.045812,0.691633,0.027581,0.685867
18
+ 410,0.046699,0.688172,0.0287352,0.683414
19
+ 412,0.047328,0.686245,0.029655,0.681803
20
+ 414,0.047969,0.681567,0.0305583,0.676545
21
+ 416,0.048595,0.678229,0.0314484,0.673274
22
+ 418,0.049069,0.674644,0.0321773,0.669766
23
+ 420,0.049477,0.671195,0.032834,0.666439
24
+ 422,0.049611,0.664926,0.0332152,0.658423
25
+ 424,0.049713,0.658931,0.0335617,0.651111
26
+ 426,0.050096,0.655739,0.03421,0.647587
27
+ 428,0.050561,0.653668,0.0349403,0.645798
28
+ 430,0.051299,0.654277,0.0359357,0.647841
29
+ 432,0.051568,0.649987,0.0364578,0.642507
30
+ 434,0.051726,0.645127,0.0368482,0.636881
31
+ 436,0.05195,0.640081,0.03728,0.631562
32
+ 438,0.052003,0.635798,0.0375477,0.627259
33
+ 440,0.052019,0.634965,0.037824,0.626633
34
+ 442,0.051398,0.629752,0.0374489,0.619551
35
+ 444,0.050464,0.623199,0.0367647,0.610037
36
+ 446,0.049508,0.618631,0.0360619,0.603779
37
+ 448,0.048558,0.614373,0.0353548,0.59799
38
+ 450,0.047932,0.615096,0.0349905,0.599299
39
+ 452,0.047111,0.613056,0.0344152,0.596627
40
+ 454,0.046229,0.610055,0.033776,0.592427
41
+ 456,0.045566,0.609617,0.0333615,0.592019
42
+ 458,0.044945,0.609564,0.0329797,0.591989
43
+ 460,0.044552,0.612358,0.0328336,0.596114
44
+ 462,0.043937,0.612818,0.0324544,0.596732
45
+ 464,0.043282,0.612055,0.0320227,0.595636
46
+ 466,0.042681,0.611916,0.0316415,0.595456
47
+ 468,0.042065,0.611941,0.0312368,0.595546
48
+ 470,0.04153,0.612938,0.0309118,0.597029
49
+ 472,0.040727,0.611148,0.0302978,0.594761
50
+ 474,0.039861,0.608394,0.0296197,0.590984
51
+ 476,0.039079,0.606649,0.0290199,0.588654
52
+ 478,0.038357,0.605187,0.0284796,0.586772
53
+ 480,0.037742,0.606533,0.0280519,0.589011
54
+ 482,0.037013,0.606429,0.0275088,0.58888
55
+ 484,0.036276,0.607219,0.0269574,0.590095
56
+ 486,0.035576,0.609741,0.0264469,0.59367
57
+ 488,0.034834,0.613506,0.0258937,0.598583
58
+ 490,0.034124,0.620026,0.0253719,0.607395
59
+ 492,0.033205,0.625043,0.0246401,0.613784
60
+ 494,0.03217,0.630752,0.0237919,0.620913
61
+ 496,0.031089,0.637768,0.0229018,0.629698
62
+ 498,0.029954,0.64575,0.021947,0.639874
63
+ 500,0.028819,0.655743,0.0209906,0.652915
64
+ 502,0.027624,0.664994,0.0199717,0.665039
65
+ 504,0.026434,0.674511,0.0189531,0.677825
66
+ 506,0.025281,0.68439,0.0179645,0.691096
67
+ 508,0.024201,0.694508,0.0170429,0.704961
68
+ 510,0.023181,0.706004,0.0161767,0.721246
69
+ 512,0.022189,0.715509,0.0153331,0.73487
70
+ 514,0.021248,0.724687,0.0145366,0.748164
71
+ 516,0.020406,0.734965,0.0138247,0.763636
72
+ 518,0.019624,0.744704,0.013169,0.77829
73
+ 520,0.018943,0.755131,0.0126114,0.793886
74
+ 522,0.018252,0.764378,0.0120616,0.806798
75
+ 524,0.017583,0.774288,0.0115413,0.81826
76
+ 526,0.017065,0.775837,0.0111019,0.827539
77
+ 528,0.016484,0.784234,0.0106782,0.837822
78
+ 530,0.015987,0.791979,0.0102702,0.850035
79
+ 532,0.015469,0.799297,0.00986676,0.864371
80
+ 534,0.014994,0.804306,0.00945034,0.876105
81
+ 536,0.014524,0.811547,0.00913158,0.883664
82
+ 538,0.014103,0.816237,0.00879997,0.891514
83
+ 540,0.013722,0.821776,0.00847894,0.9036376
84
+ 542,0.013316,0.82706,0.00822898,0.9059528
85
+ 544,0.012954,0.83034,0.00791535,0.9135778
86
+ 546,0.012554,0.834129,0.00758758,0.9210046
87
+ 548,0.012194,0.835807,0.00730458,0.9262056
88
+ 550,0.011825,0.838542,0.00702755,0.9311673
89
+ 552,0.011423,0.842131,0.00668777,0.9389103
90
+ 554,0.011049,0.841923,0.00637847,0.9444716
91
+ 556,0.010677,0.843801,0.00611841,0.9434622
92
+ 558,0.010317,0.84359,0.00586209,0.9438741
93
+ 560,0.010031,0.841254,0.00567919,0.9345194
94
+ 562,0.0097641,0.839246,0.00545193,0.9381874
95
+ 564,0.0094984,0.838815,0.00528849,0.9308322
96
+ 566,0.0092848,0.839762,0.00516659,0.9308692
97
+ 568,0.0091161,0.840059,0.0050977,0.9251119
98
+ 570,0.0090396,0.836425,0.00498617,0.9298118
99
+ 572,0.0089222,0.835646,0.00498028,0.9192422
100
+ 574,0.008827,0.83547,0.00498036,0.9105802
101
+ 576,0.0087804,0.832592,0.0050036,0.9000773
102
+ 578,0.0087719,0.829529,0.00500971,0.9019533
103
+ 580,0.0088089,0.827631,0.00508712,0.893336
104
+ 582,0.0088272,0.826485,0.00512157,0.893499
105
+ 584,0.0088963,0.819942,0.00524069,0.876441
106
+ 586,0.0089011,0.820214,0.00531486,0.869708
107
+ 588,0.0089057,0.817376,0.00535469,0.863694
108
+ 590,0.0089436,0.811726,0.00539004,0.858931
109
+ 592,0.0088958,0.810858,0.00541207,0.852832
110
+ 594,0.0088117,0.808518,0.00536942,0.848167
111
+ 596,0.0087399,0.803886,0.00531406,0.844824
112
+ 598,0.0086249,0.804346,0.00527335,0.838523
113
+ 600,0.0085428,0.804944,0.00521658,0.841018
114
+ 602,0.0084855,0.805743,0.00523014,0.840204
115
+ 604,0.0084262,0.810475,0.00524094,0.840631
116
+ 606,0.0084156,0.815555,0.00526082,0.849918
117
+ 608,0.0084456,0.820247,0.0053529,0.850798
118
+ 610,0.0085282,0.824808,0.00548048,0.854777
119
+ 612,0.0086012,0.830322,0.00559993,0.859506
120
+ 614,0.0087063,0.834011,0.00572303,0.865122
121
+ 616,0.0087977,0.838201,0.00587009,0.866815
122
+ 618,0.0088983,0.839726,0.00598422,0.868395
123
+ 620,0.008957,0.843808,0.00608558,0.870417
124
+ 622,0.0089865,0.846182,0.00618479,0.869253
125
+ 624,0.0090377,0.84668,0.00624575,0.869809
126
+ 626,0.0091362,0.844342,0.00636318,0.866418
127
+ 628,0.0091923,0.846568,0.00646156,0.866135
128
+ 630,0.0093245,0.845543,0.00662103,0.86376
129
+ 632,0.0094377,0.845636,0.00672107,0.866048
130
+ 634,0.0095348,0.844972,0.00685261,0.863431
131
+ 636,0.009625,0.842956,0.00696853,0.859451
132
+ 638,0.0096807,0.841164,0.00703712,0.857394
133
+ 640,0.0097295,0.837388,0.00713341,0.852402
134
+ 642,0.0098384,0.829568,0.00725082,0.840696
135
+ 644,0.0098896,0.825998,0.00733407,0.834597
136
+ 646,0.010002,0.819028,0.00743778,0.825136
137
+ 648,0.010094,0.818206,0.0075651,0.821646
138
+ 650,0.010298,0.814236,0.00777566,0.815461
139
+ 652,0.010546,0.814861,0.00801624,0.818002
140
+ 654,0.01096,0.813764,0.00842427,0.815772
141
+ 656,0.011551,0.814904,0.00903046,0.815501
142
+ 658,0.012318,0.820115,0.00980814,0.820503
143
+ 660,0.013335,0.822965,0.0108322,0.823337
144
+ 662,0.014524,0.827551,0.0120323,0.826962
145
+ 664,0.015941,0.824168,0.0134507,0.82256
146
+ 666,0.017442,0.819722,0.014952,0.817174
147
+ 668,0.0188,0.817599,0.0162698,0.814107
148
+ 670,0.01989,0.817742,0.017388,0.813791
149
+ 672,0.020537,0.81659,0.0180721,0.811783
150
+ 674,0.020655,0.818823,0.018238,0.813274
151
+ 676,0.020338,0.822291,0.0179744,0.816196
152
+ 678,0.01955,0.82725,0.0172436,0.82082
153
+ 680,0.0183,0.835229,0.016057,0.8284
154
+ 682,0.016561,0.850076,0.0143849,0.843146
155
+ 684,0.014549,0.867555,0.0124842,0.861145
156
+ 686,0.0124,0.888444,0.010429,0.882873
157
+ 688,0.010363,0.9124567,0.00854401,0.9022806
158
+ 690,0.0086832,0.9313884,0.0068551,0.9255264
159
+ 692,0.0072437,0.9442124,0.00548901,0.9417016
160
+ 694,0.0060441,0.9678341,0.00438385,0.967679
161
+ 696,0.0051813,0.9816795,0.00359814,0.9821707
162
+ 698,0.0044349,1.00265734,0.00298877,0.999734295
163
+ 700,0.0039342,1.0131636,0.00248126,1.028608