Skip to content

Commit

Permalink
added files for version 2.1.X
Browse files Browse the repository at this point in the history
  • Loading branch information
umwilm committed Mar 6, 2016
1 parent b580711 commit ba814f4
Show file tree
Hide file tree
Showing 227 changed files with 108,345 additions and 0 deletions.
62 changes: 62 additions & 0 deletions cfg/L2A_GIPP.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<Level-2A_Ground_Image_Processing_Parameter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="L2A_GIPP.xsd">
<Common_Section>
<Log_Level>DEBUG</Log_Level>
<!-- can be: NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL -->
<Nr_Processes>1</Nr_Processes>
<!-- can be an unsigned integer value specifying the number or processes you intend to operate in parallel or: AUTO. If AUTO is chosen, the processor determines the number of processes automatically, using cpu_count() -->
<Target_Directory>DEFAULT</Target_Directory>
<!-- should be either a directory or 'DEFAULT'. If default, target will be created at root of L1C product -->
<DEM_Directory>dem/srtm</DEM_Directory>
<!-- should be either a directory in the sen2cor home folder or 'NONE'. If NONE, no DEM will be used -->
<DEM_Reference>http://data_public:[email protected]/srtm/tiles/GeoTIFF/</DEM_Reference>
<!-- will be ignored if DEM is NONE. A SRTM DEM will be downloaded from this reference, if no local DEM is available -->
<UP_Scheme_1C>S2-PDGS-TAS-DI-PSD-V13.1_Schema/S2_User_Product_Level-1C_Metadata.xsd</UP_Scheme_1C>
<UP_Scheme_2A>S2-PDGS-TAS-DI-PSD-V13.1_Schema/S2_User_Product_Level-2A_Metadata.xsd</UP_Scheme_2A>
<Tile_Scheme_1C>S2-PDGS-TAS-DI-PSD-V13.1_Schema/S2_PDI_Level-1C_Tile_Metadata.xsd</Tile_Scheme_1C>
<Tile_Scheme_2A>S2-PDGS-TAS-DI-PSD-V13.1_Schema/S2_PDI_Level-2A_Tile_Metadata.xsd</Tile_Scheme_2A>
<DS_Scheme_1C>S2-PDGS-TAS-DI-PSD-V13.1_Schema/S2_PDI_Level-1C_Datastrip_Metadata.xsd</DS_Scheme_1C>
<DS_Scheme_2A>S2-PDGS-TAS-DI-PSD-V13.1_Schema/S2_PDI_Level-2A_Datastrip_Metadata.xsd</DS_Scheme_2A>
<GIPP_Scheme>L2A_GIPP.xsd</GIPP_Scheme>
<SC_Scheme>L2A_CAL_SC_GIPP.xsd</SC_Scheme>
<AC_Scheme>L2A_CAL_AC_GIPP.xsd</AC_Scheme>
</Common_Section>
<Scene_Classification>
<Filters>
<Median_Filter>0</Median_Filter>
</Filters>
</Scene_Classification>
<Atmospheric_Correction>
<References>
<Atm_Data_Filename>h99000_wv20_rura.atm</Atm_Data_Filename>
</References>
<Flags>
<WV_Correction>1</WV_Correction>
<!-- 0: No WV correction, 1: only 940 nm bands, 2: only 1130 nm bands , 3: both regions used during wv retrieval, 4: Thermal region -->
<VIS_Update_Mode>1</VIS_Update_Mode>
<!-- 0: constant, 1: variable visibility -->
<WV_Watermask>1</WV_Watermask>
<!-- 0: not replaced, 1: land-average, 2: line-average -->
<Cirrus_Correction>0</Cirrus_Correction>
<!-- 0: no, 1: yes -->
<BRDF_Correction>0</BRDF_Correction>
<!-- 0: no BRDF correction, 1: , 2: ,11, 12, 22, 21: -->
<BRDF_Lower_Bound>0.22</BRDF_Lower_Bound>
<!-- In most cases, g=0.2 to 0.25 is adequate, in extreme cases of overcorrection g=0.1 should be applied -->
</Flags>
<Calibration>
<DEM_Unit>0</DEM_Unit>
<!-- (0=[m], 1=[dm], 2=[cm]) -->
<Adj_Km>1.000</Adj_Km>
<!-- Adjancency Range [km] -->
<Visibility>23.0</Visibility>
<!-- visibility (5 <= visib <= 120 km) -->
<Altitude>0.100</Altitude>
<!-- [km] -->
<Smooth_WV_Map>100.0</Smooth_WV_Map>
<!-- length of square box, [meters] -->
<WV_Threshold_Cirrus>0.25</WV_Threshold_Cirrus>
<!-- water vapor threshold to switch off cirrus algorithm [cm]Range: 0.1-1.0 -->
</Calibration>
</Atmospheric_Correction>
</Level-2A_Ground_Image_Processing_Parameter>
1 change: 1 addition & 0 deletions sen2cor.egg-info/pbr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"is_release": true, "git_version": "b3ddfd1"}
53 changes: 53 additions & 0 deletions sen2cor/L2A_Logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python
import os
import sys
import time
import traceback
import multiprocessing, threading, logging, sys

DEFAULT_LEVEL = logging.INFO
formatter = logging.Formatter('<check>\n<inspection execution=\"%(asctime)s\" level=\"%(levelname)s\" process=\"%(process)d\" module=\"%(module)s\" function=\"%(funcName)s\" line=\"%(lineno)d\"/>\n<message contentType=\"Text\">%(message)s</message>\n</check>')

class SubProcessLogHandler(logging.Handler):

def __init__(self, queue):
logging.Handler.__init__(self)
self.queue = queue

def emit(self, record):
self.queue.put(record)

class LogQueueReader(threading.Thread):

def __init__(self, queue):
threading.Thread.__init__(self)
self.queue = queue
self.daemon = True

def run(self):
while True:
try:
record = self.queue.get()
logger = logging.getLogger(record.name)
logger.callHandlers(record)
except (KeyboardInterrupt, SystemExit):
raise
except EOFError:
break
except:
traceback.print_exc(file=sys.stderr)


def getLevel(level):
if level == 'DEBUG':
return logging.DEBUG
elif level == 'INFO':
return logging.INFO
elif level == 'WARNING':
logging.WARNING
elif level == 'ERROR':
return logging.ERROR
elif level == 'CRITICAL':
return logging.CRITICAL
else:
return logging.NOTSET
Loading

0 comments on commit ba814f4

Please sign in to comment.