Skip to content
Snippets Groups Projects
Commit bc44447c authored by Esquis Benjamin's avatar Esquis Benjamin
Browse files

Added default lut in install

parent 85b9613e
No related branches found
No related tags found
2 merge requests!11Continuous Integration for WASP,!10Resolve "Add LUT directional correction for S2"
Showing
with 157 additions and 23 deletions
......@@ -19,5 +19,7 @@ if(BUILD_TESTING)
add_subdirectory(test)
endif()
install(FILES scattering_coeffs_10m.txt scattering_coeffs_20m.txt DESTINATION share/)
install(FILES data/scattering_coeffs_10m.txt data/scattering_coeffs_20m.txt DESTINATION share/)
install(DIRECTORY data/S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR DESTINATION share/)
install(FILES data/S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.HDR DESTINATION share/)
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="DISPLAY/display.xsl"?><Earth_Explorer_Header xmlns="http://eop-cfi.esa.int/CFI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RFLTOC_File_Type" schema_version="1.00" xsi:schemaLocation="http://eop-cfi.esa.int/CFI D:\Utilisateurs\petruccib\Documents\PROJETS\SENTINEL-2\SEGMENT_SOL\SL2P\201508-GIPP-L2\GIPP_MACCS_v1-VAL\SENTINEL2_GPP\GIP_DIRCOR_L2LutOfTopOfCanopyReflectance.xsd">
<Fixed_Header>
<File_Name>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101</File_Name>
<File_Description>L2LutDirectionnalOfCorrection</File_Description>
<Notes>String</Notes>
<Mission>SENTINEL2_</Mission>
<File_Class>TEST</File_Class>
<File_Type>GIP_DIRCOR</File_Type>
<Validity_Period>
<Validity_Start>UTC=2020-10-10T00:00:00</Validity_Start>
<Validity_Stop>UTC=2100-01-01T00:00:00</Validity_Stop>
</Validity_Period>
<File_Version>0002</File_Version>
<Source>
<System>MACCS</System>
<Creator>CNES_tool</Creator>
<Creator_Version>1.0</Creator_Version>
<Creation_Date>UTC=2020-10-10T11:36:00</Creation_Date>
</Source>
</Fixed_Header>
<Variable_Header>
<Main_Product_Header>
<List_of_Consumers count="0">
</List_of_Consumers>
<List_of_Extensions count="0">
</List_of_Extensions>
</Main_Product_Header>
<Specific_Product_Header>
<Instance_Id>
<Applicability_NickName_Type>L_LIST</Applicability_NickName_Type>
<Applicability_NickName>NOTNAMED</Applicability_NickName>
<Serial_Key>00001</Serial_Key>
<Validity_Period>
<Validity_Start>UTC=2015-07-03T00:00:00</Validity_Start>
<Validity_Stop>UTC=2100-01-01T00:00:00</Validity_Stop>
</Validity_Period>
</Instance_Id>
<DBL_Organization>
<List_of_Packaged_DBL_Files count="11">
<Packaged_DBL_File sn="1">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B1_442.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
<Packaged_DBL_File sn="2">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B2_492.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
<Packaged_DBL_File sn="3">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B3_559.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
<Packaged_DBL_File sn="4">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B4_664.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
<Packaged_DBL_File sn="5">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B5_704.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
<Packaged_DBL_File sn="6">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B6_740.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
<Packaged_DBL_File sn="7">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B7_782.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
<Packaged_DBL_File sn="8">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B8_832.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
<Packaged_DBL_File sn="9">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B8A_864.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
<Packaged_DBL_File sn="10">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B11_1613.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
<Packaged_DBL_File sn="11">
<Relative_File_Path>S2__TEST_GIP_DIRCOR_L_ALLSITES_50003_20201010_21000101.DBL.DIR/LUT_DIRCOR_S2_B12_2202.lut</Relative_File_Path>
<File_Definition>lut_inv</File_Definition>
</Packaged_DBL_File>
</List_of_Packaged_DBL_Files>
</DBL_Organization>
<List_of_Applicable_SiteDefinition_Ids count="0"/>
<LUT_Indexes>
<Solar_Zenith_Angle_Indexes>15 20 25 30 35 40 45 50 55 60 65 70 75 80</Solar_Zenith_Angle_Indexes>
<View_Zenith_Angle_Indexes>0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15</View_Zenith_Angle_Indexes>
<Relative_Azimuth_Angle_Indexes>0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350</Relative_Azimuth_Angle_Indexes>
</LUT_Indexes>
</Specific_Product_Header>
</Variable_Header>
</Earth_Explorer_Header>
......@@ -90,7 +90,6 @@ std::vector<PreprocessingAdapter::ShortVectorImageType::Pointer> PreprocessingSe
createAngles.DoInit(resolution, filename);
PreprocessingAdapter::FloatVectorImageType::Pointer anglesImg = createAngles.DoExecute();
anglesImg->Update();
std::cout<<anglesImg<<std::endl;
m_createAngles.push_back(createAngles);
//If Resolution is not principal Resolution, then resize the additional images
......
......@@ -27,7 +27,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
SPDX-License-Identifier: GPL-3.0-or-later
"""
import os, sys
import os, sys, glob
import logging
import shutil
import argparse
......@@ -298,25 +298,62 @@ class TemporalSynthesis():
args.nthreads = self.ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS
if(args.pathprevL3A == None):
args.pathprevL3A = ""
if(args.scatteringcoeffpath is not None and args.dircorlutpath is not None):
raise OSError("Cannot have both directional correction option enabled, select one")
if(args.scatteringcoeffpath == None and args.dircorlutpath == None):
#Search for existence of the scattering-coeff files in the App-path:
logging.info("OTB_APPLICATION_PATH : "+os.environ["OTB_APPLICATION_PATH"])
applicationPath = os.environ["OTB_APPLICATION_PATH"].split(":")
for path in applicationPath:
searchPath = os.path.join(path, "../../../", "share")
scatteringCoeffs = [self.scatteringCoeffBasePath + str(res) + "m.txt" for res in [10, 20]]
logging.info("Searching in : "+searchPath)
logging.info(scatteringCoeffs)
#Check if both scatteringcoeff-files exist:
if(all(os.path.exists(os.path.join(searchPath, scatteringCoeff)) == True
for scatteringCoeff in scatteringCoeffs)):
args.scatteringcoeffpath = searchPath
break
#If the files are still not found, raise an Error
if(args.scatteringcoeffpath == None):
raise OSError("Cannot find scattering-coefficients file. Please verify your OTB_APPLICATION_PATH")
#****** Directionnal correction parameters section
dircor_mode = "ROY"
if args.dircormode:
if args.dircormode == "ROY":
dircor_mode = "ROY"
args.dircorlutpath = None
elif args.dircormode == "LUT":
dircor_mode = "LUT"
args.scatteringcoeffpath = None
else:
raise OSError("dircormode must be either LUT or ROY")
else:
if(args.scatteringcoeffpath is not None and args.dircorlutpath is not None):
raise OSError("Cannot have both directional correction option enabled, select one")
elif args.scatteringcoeffpath is not None:
dircor_mode = "ROY"
args.dircorlutpath = None
elif args.dircorlutpath is not None:
dircor_mode = "LUT"
args.scatteringcoeffpath = None
if dircor_mode == "ROY":
if args.scatteringcoeffpath == None:
#Search for existence of the scattering-coeff files in the App-path:
logging.info("OTB_APPLICATION_PATH : "+os.environ["OTB_APPLICATION_PATH"])
applicationPath = os.environ["OTB_APPLICATION_PATH"].split(":")
for path in applicationPath:
searchPath = os.path.join(path, "../../../", "share")
scatteringCoeffs = [self.scatteringCoeffBasePath + str(res) + "m.txt" for res in [10, 20]]
logging.info("Searching in : "+searchPath)
logging.info(scatteringCoeffs)
#Check if both scatteringcoeff-files exist:
if(all(os.path.exists(os.path.join(searchPath, scatteringCoeff)) == True
for scatteringCoeff in scatteringCoeffs)):
args.scatteringcoeffpath = searchPath
break
#If the files are still not found, raise an Error
if(args.scatteringcoeffpath == None):
raise OSError("Cannot find scattering-coefficients file. Please verify your OTB_APPLICATION_PATH")
elif dircor_mode == "LUT":
if args.dircorlutpath == None:
#Search for existence of the scattering-coeff files in the App-path:
logging.info("OTB_APPLICATION_PATH : "+os.environ["OTB_APPLICATION_PATH"])
applicationPath = os.environ["OTB_APPLICATION_PATH"].split(":")
for path in applicationPath:
searchPath = os.path.join(path, "../../../", "share")
logging.info("Searching in : "+searchPath)
list_glob_result = glob.glob(os.path.join(searchPath, "*GIP_DIRCOR*HDR"))
if len(list_glob_result) == 1:
args.dircorlutpath = list_glob_result[0]
break
#If the files are still not found, raise an Error
if(args.dircorlutpath == None):
raise OSError("Cannot find LUT file for directional correction. Please verify your OTB_APPLICATION_PATH of parameter")
#******** End directionnal parameters
#Check if Geo-zone is unique:
if(not self.checkTileUnique(args.input)):
......@@ -837,8 +874,9 @@ if __name__ == "__main__":
parser.add_argument("--sigmalargecld", help="Sigma for large Clouds. Default is 10", required=False, type=float)
parser.add_argument("--weightdatemin", help="Minimum Weight for Dates. Default is 0.5", required=False, type=float)
parser.add_argument("--nthreads", help="Number of threads to be used for running the chain. Default is 8.", required=False, type=int)
parser.add_argument("--scatteringcoeffpath", help="Path to the scattering coefficients files. If none, it will be searched for using the OTB-App path. Only has to be set for testing-purposes", required=False, type=str)
parser.add_argument("--scatteringcoeffpath", help="Path to the scattering coefficients files. If none, it will be searched for using the OTB-App path. Only has to be set for testing-purposes", required=False, type=str)
parser.add_argument("--dircorlutpath", help="Path to the DIRCOR lut path.", required=False, type=str)
parser.add_argument("--dircormode", help="Mode for the directionnal correction either LUT or ROY (legacy). Force the mode even if other dircor params filled", required=False, type=str)
args = parser.parse_args()
TemporalSynthesisApplication = TemporalSynthesis(args)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment