Skip to content
Snippets Groups Projects
Commit 5bcd8407 authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO
Browse files

ENH: New marge + new check into diapOTB chain for cosmo images

parent 0a71a10a
No related branches found
No related tags found
1 merge request!16Merge branch Cosmo
...@@ -181,7 +181,7 @@ namespace otb ...@@ -181,7 +181,7 @@ namespace otb
int nbLinesDEM = m_DemImagePtr->GetLargestPossibleRegion().GetSize()[1]; int nbLinesDEM = m_DemImagePtr->GetLargestPossibleRegion().GetSize()[1];
if (nbLinesSAR > nbLinesDEM) if (nbLinesSAR > nbLinesDEM)
{ {
m_Margin = (nbLinesSAR/nbLinesDEM)*10; m_Margin = (nbLinesSAR/nbLinesDEM)*30;
} }
else else
{ {
......
...@@ -165,30 +165,47 @@ if __name__ == "__main__": ...@@ -165,30 +165,47 @@ if __name__ == "__main__":
print ("master_ext = " + master_ext[0] + "\n") print ("master_ext = " + master_ext[0] + "\n")
print ("salve_ext = " + slave_ext[0] + "\n") print ("salve_ext = " + slave_ext[0] + "\n")
if (master_ext[0] == "h5") or (slave_ext[0] == "h5") : if master_ext[0] == "h5" :
master_H5 = h5py.File(master_Image, 'r') master_H5 = h5py.File(master_Image, 'r')
slave_H5 = h5py.File(slave_Image, 'r')
lDataSet_master = list(master_H5.keys()) lDataSet_master = list(master_H5.keys())
lDataSet_slave = list(slave_H5.keys())
if len(lDataSet_master) != 1 or len(lDataSet_slave) != 1 : if len(lDataSet_master) != 1 :
print("H5 input files does not contain the expected dataset \n") print("H5 input files does not contain the expected dataset \n")
quit() quit()
if lDataSet_master[0] != "S01" or lDataSet_slave[0] != "S01" : if lDataSet_master[0] != "S01" :
print("H5 input files does not contain the expected dataset \n") print("H5 input files does not contain the expected dataset \n")
quit() quit()
master_S01 = dict(master_H5['S01']) master_S01 = dict(master_H5['S01'])
slave_S01 = dict(slave_H5['S01'])
if not 'SBI' in master_S01:
if not 'SBI' in master_S01 or not 'SBI' in slave_S01 :
print("H5 input files does not contain the expected dataset \n") print("H5 input files does not contain the expected dataset \n")
quit() quit()
# Change the name of master and slave image to read directly the //S01/SBI # Change the name of master and slave image to read directly the //S01/SBI
master_Image = "HDF5:" + master_Image + "://S01/SBI" master_Image = "HDF5:" + master_Image + "://S01/SBI"
if slave_ext[0] == "h5" :
slave_H5 = h5py.File(slave_Image, 'r')
lDataSet_slave = list(slave_H5.keys())
if len(lDataSet_slave) != 1 :
print("H5 input files does not contain the expected dataset \n")
quit()
if lDataSet_slave[0] != "S01" :
print("H5 input files does not contain the expected dataset \n")
quit()
slave_S01 = dict(slave_H5['S01'])
if not 'SBI' in slave_S01 :
print("H5 input files does not contain the expected dataset \n")
quit()
slave_Image = "HDF5:" + slave_Image + "://S01/SBI" slave_Image = "HDF5:" + slave_Image + "://S01/SBI"
print("master_Image = " + master_Image + "\n") print("master_Image = " + master_Image + "\n")
......
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