Skip to content

Commit bfa9fc1

Browse files
committed
complete processing chain
1 parent 332e2b7 commit bfa9fc1

File tree

1 file changed

+49
-24
lines changed

1 file changed

+49
-24
lines changed

hypernets_processor/sequence_processor.py

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from hypernets_processor.data_io.hypernets_reader import HypernetsReader
1111
from hypernets_processor.data_io.hypernets_writer import HypernetsWriter
1212
from hypernets_processor.utils.paths import parse_sequence_path
13-
import numpy as np
1413

1514

1615
'''___Authorship___'''
@@ -62,29 +61,55 @@ def process_sequence(self, sequence_path):
6261
# todo - add to archive database if to_archive
6362
self.context.logger.debug("Done")
6463

65-
# # Calibrate to L1a
66-
# self.context.logger.debug("Calibrating L1a...")
67-
# calibrate = Calibrate(self.context, MCsteps=100)
68-
# L1a_rad = calibrate.calibrate_l1a("radiance", l0_rad, l0_bla)
69-
# L1a_irr = calibrate.calibrate_l1a("irradiance", l0_irr, l0_bla)
70-
# self.context.logger.debug("Done")
71-
#
72-
# # Write L1a
73-
# if self.context.get_config_value("write_L1a"):
74-
# self.context.logger.debug("Writing L1a data...")
75-
# writer.write(L1a_rad)
76-
# writer.write(L1a_irr)
77-
# # todo - add to archive database if to_archive
78-
# self.context.logger.debug("Done")
79-
#
80-
# if self.context.get_config_value("network") == "w":
81-
# pass
82-
#
83-
# elif self.context.get_config_value("network") == "l":
84-
# pass
85-
#
86-
# else:
87-
# raise NameError("Invalid network: " + self.context.get_config_value("network"))
64+
# Calibrate to L1a
65+
self.context.logger.debug("Processing to L1a...")
66+
calibrate = Calibrate(self.context, MCsteps=100)
67+
L1a_rad = calibrate.calibrate_l1a("radiance", l0_rad, l0_bla)
68+
L1a_irr = calibrate.calibrate_l1a("irradiance", l0_irr, l0_bla)
69+
self.context.logger.debug("Done")
70+
71+
intp = InterpolateL1c(self.context, MCsteps=1000)
72+
surf = SurfaceReflectance(self.context, MCsteps=1000)
73+
74+
if self.context.get_config_value("network") == "w":
75+
rhymer = RhymerHypstar(self.context)
76+
77+
self.context.logger.debug("Processing to L1b...")
78+
L1b = rhymer.process_l1b(L1a_rad, L1a_irr)
79+
self.context.logger.debug("Done")
80+
81+
self.context.logger.debug("Processing to L1c...")
82+
L1c = rhymer.process_l1c(L1b)
83+
self.context.logger.debug("Done")
84+
85+
self.context.logger.debug("Processing to L1d...")
86+
L1d = surf.process_l1d(L1c)
87+
self.context.logger.debug("Done")
88+
89+
self.context.logger.debug("Processing to L2a...")
90+
L2a = surf.process(L1d)
91+
self.context.logger.debug("Done")
92+
93+
elif self.context.get_config_value("network") == "l":
94+
95+
self.context.logger.debug("Processing to L1b radiance...")
96+
L1b_rad = calibrate.average_l1b("radiance", L1a_rad)
97+
self.context.logger.debug("Done")
98+
99+
self.context.logger.debug("Processing to L1b irradiance...")
100+
L1b_irr = calibrate.average_l1b("irradiance", L1a_irr)
101+
self.context.logger.debug("Done")
102+
103+
self.context.logger.debug("Processing to L1c...")
104+
L1c = intp.interpolate_l1c(L1b_rad, L1b_irr)
105+
self.context.logger.debug("Done")
106+
107+
self.context.logger.debug("Processing to L2a...")
108+
L2a = surf.process(L1c)
109+
self.context.logger.debug("Done")
110+
111+
else:
112+
raise NameError("Invalid network: " + self.context.get_config_value("network"))
88113

89114
return None
90115

0 commit comments

Comments
 (0)