Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
EnMAP
GFZ_Tools_EnMAP_BOX
EnPT
Commits
29c305e6
Commit
29c305e6
authored
Apr 11, 2018
by
Daniel Scheffler
Browse files
Implemented SICOR (not yet working).
parent
0572da24
Pipeline
#2897
failed with stages
in 4 minutes and 32 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
enpt/execution/controller.py
View file @
29c305e6
...
...
@@ -81,7 +81,7 @@ class EnPT_Controller(object):
def
run_atmospheric_correction
(
self
):
"""Run atmospheric correction only."""
pass
self
.
L1_obj
.
run_AC
()
def
write_output
(
self
):
if
self
.
cfg
.
output_dir
:
...
...
enpt/model/images.py
View file @
29c305e6
...
...
@@ -472,6 +472,11 @@ class EnMAPL1Product_SensorGeo(object):
if
self
.
swir
.
detector_meta
.
unitcode
!=
'TOARad'
:
self
.
swir
.
DN2TOARadiance
()
def
run_AC
(
self
):
from
..processors
import
AtmosphericCorrector
AC
=
AtmosphericCorrector
(
config
=
self
.
cfg
)
AC
.
run_ac
(
self
)
def
save
(
self
,
outdir
:
str
,
suffix
=
""
)
->
str
:
"""Save this product to disk using almost the same format as for reading.
...
...
enpt/processors/__init__.py
View file @
29c305e6
# -*- coding: utf-8 -*-
"""EnPT 'processors' module containing all EnPT processor sub-modules."""
from
.radiometric_transform.radiometric_transform
import
Radiometric_Transformer
from
.atmospheric_correction.atmospheric_correction
import
AtmosphericCorrector
__all__
=
[
"Radiometric_Transformer"
,
"AtmosphericCorrector"
]
enpt/processors/atmospheric_correction/__init__.py
View file @
29c305e6
# -*- coding: utf-8 -*-
"""EnPT 'atmospheric correction module."""
from
.atmospheric_correction
import
AtmosphericCorrector
__all__
=
[
'AtmosphericCorrector'
]
\ No newline at end of file
enpt/processors/atmospheric_correction/atmospheric_correction.py
View file @
29c305e6
...
...
@@ -3,3 +3,37 @@
Performs the atmospheric correction of EnMAP L1B data.
"""
from
sicor.sicor_enmap
import
sicor_ac_enmap
from
sicor.options
import
get_options
as
get_ac_options
from
...model.images
import
EnMAPL1Product_SensorGeo
from
...options.config
import
EnPTConfig
from
...utils.path_generator
import
get_path_ac_options
class
AtmosphericCorrector
(
object
):
"""Class for performing atmospheric correction of EnMAP L1 images using SICOR."""
def
__init__
(
self
,
config
:
EnPTConfig
=
None
):
"""Create an instance of AtmosphericCorrector."""
self
.
cfg
=
config
@
property
def
options
(
self
):
path_opts
=
get_path_ac_options
()
try
:
return
get_ac_options
(
path_opts
)
except
FileNotFoundError
:
raise
FileNotFoundError
(
'Could not locate options file for atmospheric correction at %s.'
%
path_opts
)
def
run_ac
(
self
,
enmap_ImageL1
:
EnMAPL1Product_SensorGeo
):
enmap_ImageL1
.
logger
.
info
(
"Starting atmospheric correction for VNIR and SWIR detector. "
"Source radiometric unit code is '%s'."
%
enmap_ImageL1
.
meta
.
vnir
.
unitcode
)
# run AC
enmap_l2a_sens_geo
,
state
,
fits
=
sicor_ac_enmap
(
enmap_l1b
=
enmap_ImageL1
,
options
=
self
.
options
,
logger
=
enmap_ImageL1
.
logger
,
debug
=
True
)
return
enmap_l2a_sens_geo
enpt/processors/radiometric_transform/__init__.py
View file @
29c305e6
# -*- coding: utf-8 -*-
"""EnPT 'radiometric transform' module containing eveything related to radiometric transformations."""
from
.radiometric_transform
import
Radiometric_Transformer
__all__
=
[
'Radiometric_Transformer'
]
enpt/utils/path_generator.py
View file @
29c305e6
...
...
@@ -48,3 +48,11 @@ class PathGenL1BProduct(object):
def
_find_in_metaxml
(
self
,
expression
):
return
self
.
xml
.
findall
(
expression
)[
0
].
text
.
replace
(
"
\n
"
,
""
).
strip
()
def
get_path_ac_options
()
->
str
:
"""Returns the path of the options json file needed for atmospheric correction."""
from
sicor
import
options
path_ac
=
os
.
path
.
join
(
os
.
path
.
dirname
(
options
.
__file__
),
'enmap_options.json'
)
return
path_ac
tests/test_radiometric_transform.py
View file @
29c305e6
...
...
@@ -7,7 +7,7 @@ import tempfile
import
zipfile
from
datetime
import
datetime
from
enpt.processors
.radiometric_transform
import
Radiometric_Transformer
from
enpt.processors
import
Radiometric_Transformer
from
enpt.options.config
import
EnPTConfig
from
.
import
config_for_testing
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment