-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathL2A_Config.py
5201 lines (4057 loc) · 177 KB
/
L2A_Config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
67
68
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python
from numpy import *
import fnmatch
import cPickle as pickle
import sys, os, logging, inspect
import ConfigParser
from L2A_XmlParser import L2A_XmlParser
from L2A_Library import *
from lxml import etree, objectify
from time import time, strftime
from datetime import datetime
from multiprocessing import Lock
from shutil import copyfile, copytree
from psutil import cpu_count
from L2A_ProcessDataStrip import L2A_ProcessDataStrip
try:
from osgeo import gdal, osr
from osgeo.gdalconst import *
gdal.TermProgress = gdal.TermProgress_nocb
except ImportError:
import gdal, osr
from gdalconst import *
l = Lock()
def getScriptDir(follow_symlinks=True):
if getattr(sys, 'frozen', False): # py2exe, PyInstaller, cx_Freeze
path = os.path.abspath(sys.executable)
else:
path = inspect.getabsfile(getScriptDir)
if follow_symlinks:
path = os.path.realpath(path)
return os.path.dirname(path)
class L2A_Config(object):
def __init__(self, logger, input_dir=False):
# set TESTMODE to 1 if you want to have a higher processing speed for test purposes.
# processes only the upper left area of 183 x 183 pixels: must contain some data pixels!
# leave to 0 if normal processing is wanted (default).
self._TESTMODE = 0
self._processorName = 'Sentinel-2 Level 2A Processor (Sen2Cor)'
self._processorVersion = '2.8.0'
self._processorDate = '2019.02.20'
self._productVersion = '14.5'
self._processing_centre = None
self._archiving_centre = None
self._datastrip = None
self._datastrip_root_folder = None
self._tile = None
self._raw = None
self._tif = None
self._geobox_10 = None
self._geobox_20 = None
self._geobox_60 = None
self._geoboxPvi = None
self._user_product = None
self._input_dir = None
self._work_dir = None
self._output_dir = None
self._img_database_dir = None
self._res_database_dir = None
self._operationMode = 'INVALID'
self._processingBaseline = None
self._configPB = None
self._logger = logger
self._logLevel = 'INFO'
self._sc_lp_blu = 1.0
self._tEstimation = 0.0
self._L2A_DS_MTD_LST = []
self._L2A_DS_MTD_XML = None
self._dsScheme1c = None
self._dsScheme2a = None
self._timestamp = datetime.utcnow()
self._localTimestamp = time()
self._UPgenerationTimestamp = None
self._spacecraftName = None
if (input_dir):
self._atmDataFn = None
self._tEst60 = 150.0
self._tEst20 = self._tEst60 * 8.0
self._tEst10 = self._tEst60 * 8.0
self._tStart = None
self._nrTiles = None
self._nrThreads = None
self._input_dir = input_dir
self._ncols = -1
self._nrows = -1
self._nbnds = -1
self._sza = -1
self._saa = -1
self._GIPP = ''
self._ECMWF = ''
self._DEM = ''
self._L2A_BOA_QUANTIFICATION_VALUE = None
self._L2A_WVP_QUANTIFICATION_VALUE = 1000.0
self._L2A_AOT_QUANTIFICATION_VALUE = 1000.0
self._dnScale = 10000.0
self._adj_km = 1.0
self._ch940 = array([8, 8, 9, 9, 0, 0])
self._cellsize = 0 # pixelsize (m), cellsize (km)
self._dem_terrain_correction = True
self._ibrdf = 0 # brdf correction
self._thr_g = 0.25 # lower bound for brdf correction
self._ibrdf_dark = 0 # flag for cast shadow dark pixel processing
self._icl_shadow = 0 # no cloud shadow calculation
self._iclshad_mask = 3 # 1=small, 2=medium, 3=large mask with default values of thr_shad
self._ihaze = 0
self._ihcw = 1
self._ihot_dynr = 2
self._ihot_mask = 2
self._intpol760 = 1 # always 1 for Sentinel2
self._intpol725_825 = 1 # always 1 for Sentinel2
self._intpol1400 = 1 # always 1 for Sentinel2
self._intpol940_1130 = 1 # always 1 for Sentinel2
self._istretch_type = 1 # linear
self._iwat_shd = 0
self._iwaterwv = 1
self._iwv_ndvi = 0
self._iwv_watermask = 1 # (1=average wv is used for water pixels)
self._ksolflux = 0
self._altit = 0.1
self._npref = 0
self._phi_scl_min = 0.05 # lower bound of shadow fraction, default = 0.05
self._phi_unscl_max = -999.0 # initialize in Common/atcor_main
self._pixelsize = 0
self._resolution = 0
self._rel_saturation = 1.00
self._thr_shad = -999.0
self._thv = 0.0 # tilt view angle, tilt azimuth angle
self._phiv = 90.0 # sensor view zenith and azimuth angle
self._smooth_wvmap = 100.0
self._entityId = ''
self._acquisitionDate = ''
self._orbitPath = None
self._orbitRow = None
self._targetPath = None
self._targetRow = None
self._stationSgs = ''
self._sceneStartTime = None
self._sceneStopTime = None
self._solaz = None
self._solaz_arr = None
self._solze = None
self._solze_arr = None
self._vaa_arr = None
self._vza_arr = None
self._visibility = 40.0
self._wl940a = array([0.895, 1.000]) # range of moderate wv absorption region around 940 nm
self._wl1130a = array([1.079, 1.180]) # range of moderate wv absorption region around 1130 nm
self._wl1400a = array([1.330, 1.490]) # range for interpolation
self._wl1900a = array([1.780, 1.970]) # range for interpolation
self._wv_thr_cirrus = 0.60
self._icirrus = 0
self._d2 = 1.0 # this is a constant, see explanation in line 2061
self._c0 = None
self._c1 = None
self._e0 = None
self._wvlsen = None
self._fwhm = None
self._acOnly = False
self._L2A_INSPIRE_XML = None
self._L2A_MANIFEST_SAFE = None
self._L1C_UP_MTD_XML = None
self._L1C_DS_MTD_XML = None
self._L1C_TILE_MTD_XML = None
self._L1C_UP_ID = None
self._L1C_DS_ID = None
self._L1C_TILE_ID = None
self._L2A_UP_MTD_XML = None
self._L2A_DS_MTD_XML = None
self._L2A_DS_MTD_LST = []
self._L2A_TILE_MTD_XML = None
self._L2A_UP_ID = None
self._L2A_DS_LST = []
self._L2A_DS_ID = None
self._L2A_TILE_ID = None
self._creationDate = None
self._scOnly = False
self._processed60 = False
self._processed20 = False
self._processed10 = False
self._selectedTile = None
self._aerosolType = None
self._midLatitude = None
self._ozoneContent = None
self._waterVapour = None
self._ozoneSetpoint = None
self._timeout = None
# fix for SIIMPC-552 and SIIMPC-557, UMW - making options configurable:
self._scaling_disabler = None
self._scaling_limiter = None
self._rho_retrieval_step2 = None
self._min_sc_blu = 0.9
self._max_sc_blu = 1.1
self._namingConvention = None
self.datatakeSensingTime = None
self._upScheme1c = None
self._upScheme2a = None
self._tileScheme1c = None
self._tileScheme2a = None
self._dsScheme1c = None
self._dsScheme2a = None
self._gippScheme2a = None
self._gippSchemeSc = None
self._gippSchemeAc = None
self._gippSchemePb = None
self._manifestScheme = None
self._satelliteId = 'S2A'
self._demOutput = False
self._tciOutput = False
self._ddvOutput = False
self._downsample20to60 = True
self._processingStartTimestamp = datetime.utcnow()
self._AC_Min_Ddv_Area = None
self._demType = 'NONE'
self._stat = {'read':{},'write':{}}
self._db_compression_level = 0
self._UP_INDEX_HTML = None
self._INSPIRE_XML = None
def get_processing_centre(self):
return self._processing_centre
def get_archiving_centre(self):
return self._archiving_centre
def get_datastrip(self):
return self._datastrip
def get_datastrip_root_folder(self):
return self._datastrip_root_folder
def get_tile(self):
return self._tile
def get_raw(self):
return self._raw
def get_tif(self):
return self._tif
def get_geoboxPvi(self):
return self._geoboxPvi
def get_user_product(self):
return self._user_product
def get_input_dir(self):
return self._input_dir
def get_work_dir(self):
return self._work_dir
def get_img_database_dir(self):
return self._img_database_dir
def get_res_database_dir(self):
return self._res_database_dir
def get_output_dir(self):
return self._output_dir
def set_processing_centre(self, value):
self._processing_centre = value
def set_archiving_centre(self, value):
self._archiving_centre = value
def set_datastrip(self, value):
self._datastrip = value
def set_datastrip_root_folder(self, value):
self._datastrip_root_folder = value
def set_tile(self, value):
self._tile = value
def set_raw(self, value):
self._raw = value
def set_tif(self, value):
self._tif = value
def set_geoboxPvi(self, value):
self._geoboxPvi = value
def set_user_product(self, value):
self._user_product = value
def set_input_dir(self, value):
self._input_dir = value
def set_work_dir(self, value):
self._work_dir = value
def set_img_database_dir(self, value):
self._img_database_dir = value
def set_res_database_dir(self, value):
self._res_database_dir = value
def set_output_dir(self, value):
self._output_dir = value
def del_processing_centre(self):
del self._processing_centre
def del_archiving_centre(self):
del self._archiving_centre
def del_datastrip(self):
del self._datastrip
def del_datastrip_root_folder(self):
del self._datastrip_root_folder
def del_tile(self):
del self._tile
def del_raw(self):
del self._raw
def del_tif(self):
del self._tif
def del_geoboxPvi(self):
del self._geoboxPvi
def del_user_product(self):
del self._user_product
def del_input_dir(self):
del self._input_dir
def del_work_dir(self):
del self._work_dir
def del_img_database_dir(self):
del self._img_database_dir
def del_res_database_dir(self):
del self._res_database_dir
def del_output_dir(self):
del self._output_dir
def get_dem_type(self):
return self._demType
def set_dem_type(self, value):
self._demType = value
def del_dem_type(self):
del self._demType
def get_ac_min_ddv_area(self):
return self._AC_Min_Ddv_Area
def get_up_scheme_1c(self):
return self._upScheme1c
def get_ac_swir_refl_lower_th(self):
return self._AC_Swir_Refl_Lower_Th
def get_up_scheme_2a(self):
return self._upScheme2a
def get_ac_ddv_16um_refl_th_3(self):
return self._AC_Ddv_16um_Refl_Th3
def get_tile_scheme_1c(self):
return self._tileScheme1c
def get_tile_scheme_2a(self):
return self._tileScheme2a
def get_ac_swir_22um_red_refl_ratio(self):
return self._AC_Swir_22um_Red_Refl_Ratio
def get_ds_scheme_1c(self):
return self._dsScheme1c
def get_ac_red_blue_refl_ratio(self):
return self._AC_Red_Blue_Refl_Ratio
def get_ds_scheme_2a(self):
return self._dsScheme2a
def get_ac_cut_off_aot_iter_vegetation(self):
return self._AC_Cut_Off_Aot_Iter_Vegetation
def get_gipp_scheme_2a(self):
return self._gippScheme2a
def get_gipp_scheme_pb(self):
return self._gippSchemePb
def get_ac_cut_off_aot_iter_water(self):
return self._AC_Cut_Off_Aot_Iter_Water
def get_gipp_scheme_sc(self):
return self._gippSchemeSc
def get_ac_aerosol_type_ratio_th(self):
return self._AC_Aerosol_Type_Ratio_Th
def get_gipp_scheme_ac(self):
return self._gippSchemeAc
def get_ac_topo_corr_th(self):
return self._AC_Topo_Corr_Th
def get_manifest_scheme(self):
return self._manifestScheme
def get_ac_slope_th(self):
return self._AC_Slope_Th
def get_ac_dem_p2p_val(self):
return self._AC_Dem_P2p_Val
def set_up_scheme_1c(self, value):
self._upScheme1c = value
def get_ac_swir_refl_ndvi_th(self):
return self._AC_Swir_Refl_Ndvi_Th
def set_up_scheme_2a(self, value):
self._upScheme2a = value
def get_ac_ddv_swir_refl_th_1(self):
return self._AC_Ddv_Swir_Refl_Th1
def set_tile_scheme_1c(self, value):
self._tileScheme1c = value
def get_ac_ddv_swir_refl_th_2(self):
return self._AC_Ddv_Swir_Refl_Th2
def set_tile_scheme_2a(self, value):
self._tileScheme2a = value
def get_ac_ddv_swir_refl_th_3(self):
return self._AC_Ddv_Swir_Refl_Th3
def set_ds_scheme_1c(self, value):
self._dsScheme1c = value
def get_ac_ddv_16um_refl_th_1(self):
return self._AC_Ddv_16um_Refl_Th1
def set_ds_scheme_2a(self, value):
self._dsScheme2a = value
def get_ac_ddv_16um_refl_th_2(self):
return self._AC_Ddv_16um_Refl_Th2
def set_gipp_scheme_2a(self, value):
self._gippScheme2a = value
def set_gipp_scheme_pb(self, value):
self._gippSchemePb = value
def get_ac_dbv_nir_refl_th(self):
return self._AC_Dbv_Nir_Refl_Th
def set_gipp_scheme_sc(self, value):
self._gippSchemeSc = value
def get_ac_dbv_ndvi_th(self):
return self._AC_Dbv_Ndvi_Th
def set_gipp_scheme_ac(self, value):
self._gippSchemeAc = value
def get_ac_red_ref_refl_th(self):
return self._AC_Red_Ref_Refl_Th
def set_manifest_scheme(self, value):
self._manifestScheme = value
def get_ac_dbv_red_veget_tst_ndvi_th(self):
return self._AC_Dbv_Red_Veget_Tst_Ndvi_Th
def del_up_scheme_1c(self):
del self._upScheme1c
def get_ac_dbv_red_veget_refl_th(self):
return self._AC_Dbv_Red_Veget_Refl_Th
def del_up_scheme_2a(self):
del self._upScheme2a
def get_ac_wv_iter_start_summer(self):
return self._AC_Wv_Iter_Start_Summer
def get_ac_wv_iter_start_winter(self):
return self._AC_Wv_Iter_Start_Winter
def del_tile_scheme_1c(self):
del self._tileScheme1c
def del_tile_scheme_2a(self):
del self._tileScheme2a
def del_ds_scheme_1c(self):
del self._dsScheme1c
def del_ds_scheme_2a(self):
del self._dsScheme2a
def get_ac_rng_nbhd_terrain_corr(self):
return self._AC_Rng_Nbhd_Terrain_Corr
def del_gipp_scheme_2a(self):
del self._gippScheme2a
def del_gipp_scheme_pb(self):
del self._gippSchemePb
def get_ac_max_nr_topo_iter(self):
return self._AC_Max_Nr_Topo_Iter
def del_gipp_scheme_sc(self):
del self._gippSchemeSc
def get_ac_topo_corr_cutoff(self):
return self._AC_Topo_Corr_Cutoff
def del_gipp_scheme_ac(self):
del self._gippSchemeAc
def del_manifest_scheme(self):
del self._manifestScheme
def get_ac_vegetation_index_th(self):
return self._AC_Vegetation_Index_Th
def get_datatake_sensing_time(self):
return self._datatakeSensingTime
def get_ac_limit_area_path_rad_scale(self):
return self._AC_Limit_Area_Path_Rad_Scale
def set_datatake_sensing_time(self, value):
self._datatakeSensingTime = value
def get_ac_ddv_smooting_window(self):
return self._AC_Ddv_Smooting_Window
def del_datatake_sensing_time(self):
del self._datatakeSensingTime
def get_ac_terrain_refl_start(self):
return self._AC_Terrain_Refl_Start
def get_ac_spr_refl_percentage(self):
return self._AC_Spr_Refl_Percentage
def get_ac_spr_refl_promille(self):
return self._AC_Spr_Refl_Promille
def get_naming_convention(self):
return self._namingConvention
def set_naming_convention(self, value):
self._namingConvention = value
def del_naming_convention(self):
del self._namingConvention
def get_dem_output(self):
return self._demOutput
def set_dem_output(self, value):
self._demOutput = value
def del_dem_output(self):
del self._demOutput
def get_tci_output(self):
return self._tciOutput
def set_tci_output(self, value):
self._tciOutput = value
def del_tci_output(self):
del self._tciOutput
def get_ddv_output(self):
return self._ddvOutput
def set_ddv_output(self, value):
self._ddvOutput = value
def del_ddv_output(self):
del self._ddvOutput
def get_downsample_20to60(self):
return self._downsample20to60
def set_downsample_20to60(self, value):
self._downsample20to60 = value
def del_downsample_20to60(self):
del self._downsample20to60
def get_min_sc_blu(self):
return self._min_sc_blu
def set_min_sc_blu(self, value):
self._min_sc_blu = value
def get_ac_max_vis_iter(self):
return self._AC_Max_Vis_Iter
def del_min_sc_blu(self):
del self._min_sc_blu
def set_ac_min_ddv_area(self, value):
pass
def get_max_sc_blu(self):
return self._max_sc_blu
def get_db_compression_level(self):
return self._db_compression_level
def set_ac_swir_refl_lower_th(self, value):
self._AC_Swir_Refl_Lower_Th = value
def set_max_sc_blu(self, value):
self._max_sc_blu = value
def set_db_compression_level(self, value):
self._db_compression_level = value
def set_ac_ddv_16um_refl_th_3(self, value):
self._AC_Ddv_16um_Refl_Th3 = value
def del_max_sc_blu(self):
del self._max_sc_blu
def del_db_compression_level(self):
del self._db_compression_level
# fix for SIIMPC-552, UMW - making option configurable:
def get_scaling_disabler(self):
return self._scaling_disabler
def set_scaling_disabler(self, value):
self._scaling_disabler = value
def del_scaling_disabler(self):
del self._scaling_disabler
def get_scaling_limiter(self):
return self._scaling_limiter
def set_scaling_limiter(self, value):
self._scaling_limiter = value
def del_scaling_limiter(self):
del self._scaling_limiter
def set_ac_swir_16um_red_refl_ratio(self, value):
self._AC_Swir_16um_Red_Refl_Ratio = value
def set_ac_swir_22um_red_refl_ratio(self, value):
self._AC_Swir_22um_Red_Refl_Ratio = value
def set_ac_red_blue_refl_ratio(self, value):
self._AC_Red_Blue_Refl_Ratio = value
def set_ac_cut_off_aot_iter_vegetation(self, value):
self._AC_Cut_Off_Aot_Iter_Vegetation = value
def set_ac_cut_off_aot_iter_water(self, value):
self._AC_Cut_Off_Aot_Iter_Water = value
def set_ac_aerosol_type_ratio_th(self, value):
self._AC_Aerosol_Type_Ratio_Th = value
# implementation of SIIMPC-557, UMW:
def get_rho_retrieval_step2(self):
return self._rho_retrieval_step2
def set_ac_topo_corr_th(self, value):
self._AC_Topo_Corr_Th = value
def set_rho_retrieval_step2(self, value):
self._rho_retrieval_step2 = value
def set_ac_slope_th(self, value):
self._AC_Slope_Th = value
def set_ac_dem_p2p_val(self, value):
self._AC_Dem_P2p_Val = value
def del_rho_retrieval_step2(self):
del self._rho_retrieval_step2
def set_ac_swir_refl_ndvi_th(self, value):
self._AC_Swir_Refl_Ndvi_Th = value
def get_timeout(self):
return self._timeout
def set_ac_ddv_swir_refl_th_1(self, value):
self._AC_Ddv_Swir_Refl_Th1 = value
def set_timeout(self, value):
self._timeout = value
def set_ac_ddv_swir_refl_th_2(self, value):
self._AC_Ddv_Swir_Refl_Th2 = value
def del_timeout(self):
del self._timeout
def set_ac_ddv_swir_refl_th_3(self, value):
self._AC_Ddv_Swir_Refl_Th3 = value
def set_ac_ddv_16um_refl_th_1(self, value):
self._AC_Ddv_16um_Refl_Th1 = value
def set_ac_ddv_16um_refl_th_2(self, value):
self._AC_Ddv_16um_Refl_Th2 = value
def set_ac_dbv_nir_refl_th(self, value):
self._AC_Dbv_Nir_Refl_Th = value
def set_ac_dbv_ndvi_th(self, value):
self._AC_Dbv_Ndvi_Th = value
def set_ac_red_ref_refl_th(self, value):
self._AC_Red_Ref_Refl_Th = value
def set_ac_dbv_red_veget_tst_ndvi_th(self, value):
self._AC_Dbv_Red_Veget_Tst_Ndvi_Th = value
def set_ac_dbv_red_veget_refl_th(self, value):
self._AC_Dbv_Red_Veget_Refl_Th = value
def set_ac_wv_iter_start_summer(self, value):
self._AC_Wv_Iter_Start_Summer = value
def set_ac_wv_iter_start_winter(self, value):
self._AC_Wv_Iter_Start_Winter = value
def set_ac_rng_nbhd_terrain_corr(self, value):
self._AC_Rng_Nbhd_Terrain_Corr = value
def set_ac_max_nr_topo_iter(self, value):
self._AC_Max_Nr_Topo_Iter = value
def set_ac_topo_corr_cutoff(self, value):
self._AC_Topo_Corr_Cutoff = value
def set_ac_vegetation_index_th(self, value):
self._AC_Vegetation_Index_Th = value
def set_ac_limit_area_path_rad_scale(self, value):
self._AC_Limit_Area_Path_Rad_Scale = value
def set_ac_ddv_smooting_window(self, value):
self._AC_Ddv_Smooting_Window = value
def set_ac_terrain_refl_start(self, value):
self._AC_Terrain_Refl_Start = value
def set_ac_spr_refl_percentage(self, value):
self._AC_Spr_Refl_Percentage = value
def set_ac_spr_refl_promille(self, value):
self._AC_Spr_Refl_Promille = value
def set_ac_max_vis_iter(self, value):
self._AC_Max_Vis_Iter = value
def del_ac_min_ddv_area(self):
del self._AC_Min_Ddv_Area
def del_ac_swir_refl_lower_th(self):
del self._AC_Swir_Refl_Lower_Th
def del_ac_ddv_16um_refl_th_3(self):
del self._AC_Ddv_16um_Refl_Th3
def del_ac_swir_22um_red_refl_ratio(self):
del self._AC_Swir_22um_Red_Refl_Ratio
def del_ac_red_blue_refl_ratio(self):
del self._AC_Red_Blue_Refl_Ratio
def del_ac_cut_off_aot_iter_vegetation(self):
del self._AC_Cut_Off_Aot_Iter_Vegetation
def del_ac_cut_off_aot_iter_water(self):
del self._AC_Cut_Off_Aot_Iter_Water
def del_ac_aerosol_type_ratio_th(self):
del self._AC_Aerosol_Type_Ratio_Th
def del_ac_topo_corr_th(self):
del self._AC_Topo_Corr_Th
def del_ac_slope_th(self):
del self._AC_Slope_Th
def del_ac_dem_p2p_val(self):
del self._AC_Dem_P2p_Val
def del_ac_swir_refl_ndvi_th(self):
del self._AC_Swir_Refl_Ndvi_Th
def del_ac_ddv_swir_refl_th_1(self):
del self._AC_Ddv_Swir_Refl_Th1
def del_ac_ddv_swir_refl_th_2(self):
del self._AC_Ddv_Swir_Refl_Th2
def del_ac_ddv_swir_refl_th_3(self):
del self._AC_Ddv_Swir_Refl_Th3
def del_ac_ddv_16um_refl_th_1(self):
del self._AC_Ddv_16um_Refl_Th1
def del_ac_ddv_16um_refl_th_2(self):
del self._AC_Ddv_16um_Refl_Th2
def del_ac_dbv_nir_refl_th(self):
del self._AC_Dbv_Nir_Refl_Th
def del_ac_dbv_ndvi_th(self):
del self._AC_Dbv_Ndvi_Th
def del_ac_red_ref_refl_th(self):
del self._AC_Red_Ref_Refl_Th
def del_ac_dbv_red_veget_tst_ndvi_th(self):
del self._AC_Dbv_Red_Veget_Tst_Ndvi_Th
def del_ac_dbv_red_veget_refl_th(self):
del self._AC_Dbv_Red_Veget_Refl_Th
def del_ac_wv_iter_start_summer(self):
del self._AC_Wv_Iter_Start_Summer
def del_ac_wv_iter_start_winter(self):
del self._AC_Wv_Iter_Start_Winter
def del_ac_rng_nbhd_terrain_corr(self):
del self._AC_Rng_Nbhd_Terrain_Corr
def del_ac_max_nr_topo_iter(self):
del self._AC_Max_Nr_Topo_Iter
def del_ac_topo_corr_cutoff(self):
del self._AC_Topo_Corr_Cutoff
def del_ac_vegetation_index_th(self):
del self._AC_Vegetation_Index_Th
def del_ac_limit_area_path_rad_scale(self):
del self._AC_Limit_Area_Path_Rad_Scale
def del_ac_ddv_smooting_window(self):
del self._AC_Ddv_Smooting_Window
def del_ac_terrain_refl_start(self):
del self._AC_Terrain_Refl_Start
def del_ac_spr_refl_percentage(self):
del self._AC_Spr_Refl_Percentage
def del_ac_spr_refl_promille(self):
del self._AC_Spr_Refl_Promille
def del_ac_max_vis_iter(self):
del self._AC_Max_Vis_Iter
def get_ozone_setpoint(self):
return self._ozoneSetpoint
def set_ozone_setpoint(self, value):
self._ozoneSetpoint = value
def del_ozone_setpoint(self):
del self._ozoneSetpoint
def get_aerosol_type(self):
return self._aerosolType
def get_mid_latitude(self):
return self._midLatitude
def get_ozone_content(self):
return self._ozoneContent
def get_water_vapour(self):
return self._waterVapour
def set_aerosol_type(self, value):
self._aerosolType = value
def set_mid_latitude(self, value):
self._midLatitude = value
def set_ozone_content(self, value):
self._ozoneContent = value
def set_water_vapour(self, value):
self._waterVapour = value
def del_aerosol_type(self):
del self._aerosolType
def del_mid_latitude(self):
del self._midLatitude
def del_ozone_content(self):
del self._ozoneContent
def del_water_vapour(self):
del self._waterVapour
def get_processing_status_fn(self):
return self._processingStatusFn
def get_processing_estimation_fn(self):
return self._processingEstimationFn
def set_processing_status_fn(self, value):
self._processingStatusFn = value
def set_processing_estimation_fn(self, value):
self._processingEstimationFn = value
def del_processing_status_fn(self):
del self._processingStatusFn
def del_processing_estimation_fn(self):
del self._processingEstimationFn
def get_nr_tiles(self):
if self._nrTiles == 1:
return self._nrTiles
self._nrTiles = 0
if self.namingConvention == 'SAFE_STANDARD':
filemask = 'S2*_*_L1C_*'
else:
filemask = 'L1C_*'
GRANULE = 'GRANULE'
granuleDir = os.path.join(self.work_dir, GRANULE)
filelist = sorted(os.listdir(granuleDir))
for tile in filelist:
if not fnmatch.fnmatch(tile, filemask):
continue
self._nrTiles += 1
return self._nrTiles
def get_nr_threads(self):
nrThreads = self._nrThreads
if nrThreads == 'AUTO':
self._nrThreads = cpu_count()
else:
self._nrThreads = int(nrThreads)
return self._nrThreads
def set_nr_tiles(self, value):
self._nrTiles = value
def set_nr_threads(self, value):
self._nrThreads = value
def del_nr_tiles(self):
del self._nrTiles
def del_nr_threads(self):
del self._nrThreads
def get_t_start(self):
return self._tStart
def set_t_start(self, value):
self._tStart = value