Skip to content

Commit

Permalink
Merge pull request #92 from robintw/add-polarization-outputs
Browse files Browse the repository at this point in the history
Add extraction of polarization outputs
  • Loading branch information
robintw committed Dec 11, 2021
2 parents 98c8850 + f2c9586 commit cf26368
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/test-py6s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ jobs:
- name: Install conda dependencies
shell: bash -l {0}
run: |
conda install sixs pysolar numpy scipy pandas matplotlib pytest pytest-cov
- name: Install pip dependencies
shell: bash -l {0}
run: |
pip install python-coveralls
pip install coverage
conda install sixs pysolar numpy scipy pandas matplotlib pytest pytest-cov python-coveralls coverage
- name: Install Py6S
shell: bash -l {0}
run: python setup.py install
Expand Down
10 changes: 9 additions & 1 deletion Py6S/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ def extract_results(self):
"Foam:": (CURRENT, 1, "water_component_foam", float),
"Water:": (CURRENT, 3, "water_component_water", float),
"Glint:": (CURRENT, 5, "water_component_glint", float),

"app. polarized refl.": (CURRENT, 3, "apparent_polarized_reflectance", float),
"app. pol. rad.": (CURRENT, 8, "apparent_polarized_radiance", float),
"direction of the plane of polarization": (CURRENT, -1, "direction_of_plane_of_polarization", lambda x: float(x.replace("polarization", ""))),
"total polarization ratio": (CURRENT, 3, "total_polarization_ratio", float)
}
# fmt: on
# Process most variables in the output
Expand All @@ -225,7 +230,10 @@ def extract_results(self):
a = details[1]
b = details[1] + 1

data_for_func = items[a:b]
if a == -1:
data_for_func = items[a]
else:
data_for_func = items[a:b]

if len(data_for_func) == 1:
data_for_func = data_for_func[0]
Expand Down

0 comments on commit cf26368

Please sign in to comment.