Commit fdd36f69 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

MRG

parents b891c117 aca77cd9
......@@ -752,6 +752,17 @@ MARK_AS_ADVANCED(OTB_SHOW_ALL_MSG_DEBUG)
# ADD_DEFINITIONS(-DOTB_SHOW_ALL_MSG_DEBUG)
# ENDIF( OTB_SHOW_ALL_MSG_DEBUG )
OPTION(OTB_COMPILE_WITH_FULL_WARNING "OTB developers : Compilation with FULL warning (use only for otb developers)." OFF)
MARK_AS_ADVANCED(OTB_COMPILE_WITH_FULL_WARNING)
IF(OTB_COMPILE_WITH_FULL_WARNING)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(OTB_FULL_WARNING_LIST_PARAMETERS "-Wall -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -pedantic -Wuninitialized -Wparentheses -Wunknown-pragmas -Wswitch" CACHE STRING "List of compilation parameters.")
MARK_AS_ADVANCED(OTB_FULL_WARNING_LIST_PARAMETERS)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(OTB_COMPILE_WITH_FULL_WARNING)
#-----------------------------------------------------------------------------
# Advanced option to avoid recompiling utilities at each cmake reconfiguration
OPTION(OTB_DISABLE_UTILITIES_COMPILATION "Disable utilities compilation (developpers only - use at you own risk)" OFF)
......
......@@ -22,3 +22,10 @@ ENDIF(OTB_USE_VISU_GUI)
IF(OTB_USE_PQXX)
SUBDIRS(GeospatialAnalysis)
ENDIF(OTB_USE_PQXX)
IF(OTB_COMPILE_WITH_FULL_WARNING)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(OTB_COMPILE_WITH_FULL_WARNING)
......@@ -904,18 +904,17 @@ ImageMetadataInterface::GetQuickbirdPhysicalGain( const MetaDataDictionaryType &
}
}
//Value computed from
// http://www.geoeye.com/CorpSite/assets/docs/technical-papers/2009/IKONOS_Esun_Calculations.pdf
// to get the equivalent of the SPOT alpha
//Value computed from
// http://groups.google.com/group/otb-users/browse_thread/thread/bdd88b418c5076f4?pli=1
VariableLengthVectorType gain;
gain.SetSize(5);
if (isPost20030606)
{
gain[0] = 0.16200;//Pan
gain[1] = 0.23590;//Blue
gain[2] = 0.14530;//Green
gain[3] = 0.17850;//Red
gain[4] = 0.13530;//NIR
gain[0] = 1. / 0.16200;//Pan
gain[1] = 1. / 0.23590;//Blue
gain[2] = 1. / 0.14530;//Green
gain[3] = 1. / 0.17850;//Red
gain[4] = 1. / 0.13530;//NIR
}
else
{
......
......@@ -40,3 +40,10 @@ ELSE(OTB_BINARY_DIR)
MESSAGE("OTB not found. Please set OTB_DIR")
ENDIF(OTB_FOUND)
ENDIF(OTB_BINARY_DIR)
IF(OTB_COMPILE_WITH_FULL_WARNING)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(OTB_COMPILE_WITH_FULL_WARNING)
......@@ -18,7 +18,7 @@
#include <ossim/imaging/ossimUsgsDemTileSource.h>
#include <ossim/imaging/ossimLandsatTileSource.h>
#include <ossim/imaging/ossimGeneralRasterTileSource.h>
#include <ossim/imaging/ossimERSTileSource.h>
// #include <ossim/imaging/ossimERSTileSource.h>
#include <ossim/imaging/ossimVpfTileSource.h>
#include <ossim/imaging/ossimTileMapTileSource.h>
#include <ossim/base/ossimTrace.h>
......@@ -281,17 +281,17 @@ ossimImageHandler* ossimImageHandlerFactory::open(const ossimFilename& fileName)
}
delete result;
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "trying ERS" << std::endl;
}
result = new ossimERSTileSource;
if(result->open(copyFilename))
{
return result;
}
delete result;
// if(traceDebug())
// {
// ossimNotify(ossimNotifyLevel_DEBUG)
// << "trying ERS" << std::endl;
// }
// result = new ossimERSTileSource;
// if(result->open(copyFilename))
// {
// return result;
// }
// delete result;
// Note: SRTM should be in front of general raster...
if(traceDebug())
......@@ -592,17 +592,17 @@ ossimImageHandler* ossimImageHandlerFactory::open(const ossimKeywordlist& kwl,
}
delete result;
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "trying ERS" << std::endl;
}
result = new ossimERSTileSource;
if(result->loadState(kwl, prefix))
{
return result;
}
delete result;
// if(traceDebug())
// {
// ossimNotify(ossimNotifyLevel_DEBUG)
// << "trying ERS" << std::endl;
// }
// result = new ossimERSTileSource;
// if(result->loadState(kwl, prefix))
// {
// return result;
// }
// delete result;
// Note: SRTM should be in front of general raster...
if(traceDebug())
{
......@@ -681,10 +681,10 @@ ossimObject* ossimImageHandlerFactory::createObject(const ossimString& typeName)
{
return new ossimLandsatTileSource();
}
if(STATIC_TYPE_NAME(ossimERSTileSource) == typeName)
{
return new ossimERSTileSource();
}
// if(STATIC_TYPE_NAME(ossimERSTileSource) == typeName)
// {
// return new ossimERSTileSource();
// }
if(STATIC_TYPE_NAME(ossimSrtmTileSource) == typeName)
{
return new ossimSrtmTileSource();
......@@ -784,7 +784,7 @@ void ossimImageHandlerFactory::getTypeNameList(std::vector<ossimString>& typeLis
typeList.push_back(STATIC_TYPE_NAME(ossimTiffTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimUsgsDemTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimLandsatTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimERSTileSource));
// typeList.push_back(STATIC_TYPE_NAME(ossimERSTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimSrtmTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimGeneralRasterTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimTileMapTileSource));
......
......@@ -14,7 +14,7 @@
#include <ossim/imaging/ossimTerraSarTileSource.h>
//#include <ossim/imaging/ossimCosmoSkymedTileSource.h>
#include <ossim/imaging/ossimEnvisatAsarTileSource.h>
#include <ossim/imaging/ossimErsSarTileSource.h>
// #include <ossim/imaging/ossimErsSarTileSource.h>
......@@ -117,18 +117,18 @@ ossimImageHandler* ossimImageHandlerSarFactory::open(const ossimFilename& fileNa
// delete result;
// ERS
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "trying Ers Sar"
<< std::endl;
}
result = new ossimErsSarTileSource;
if(result->open(copyFilename))
{
return result;
}
delete result;
// if(traceDebug())
// {
// ossimNotify(ossimNotifyLevel_DEBUG)
// << "trying Ers Sar"
// << std::endl;
// }
// result = new ossimErsSarTileSource;
// if(result->open(copyFilename))
// {
// return result;
// }
// delete result;
//// Cosmo Skymed
//if(traceDebug())
......@@ -215,18 +215,18 @@ ossimImageHandler* ossimImageHandlerSarFactory::open(const ossimKeywordlist& kwl
}
delete result;
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "trying Ers Sar"
<< std::endl;
}
result = new ossimErsSarTileSource();
if(result->loadState(kwl, prefix))
{
return result;
}
delete result;
// if(traceDebug())
// {
// ossimNotify(ossimNotifyLevel_DEBUG)
// << "trying Ers Sar"
// << std::endl;
// }
// result = new ossimErsSarTileSource();
// if(result->loadState(kwl, prefix))
// {
// return result;
// }
// delete result;
/*if(traceDebug())
{
......@@ -268,10 +268,10 @@ ossimObject* ossimImageHandlerSarFactory::createObject(const ossimString& typeNa
{
return new ossimCosmoSkymedTileSource();
}*/
if(STATIC_TYPE_NAME(ossimErsSarTileSource) == typeName)
{
return new ossimErsSarTileSource();
}
// if(STATIC_TYPE_NAME(ossimErsSarTileSource) == typeName)
// {
// return new ossimErsSarTileSource();
// }
// if(STATIC_TYPE_NAME(ossimRadarSat2TileSource) == typeName)
// {
// return new ossimRadarSat2TileSource();
......@@ -338,6 +338,6 @@ void ossimImageHandlerSarFactory::getTypeNameList(std::vector<ossimString>& type
typeList.push_back(STATIC_TYPE_NAME(ossimTerraSarTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimEnvisatAsarTileSource));
//typeList.push_back(STATIC_TYPE_NAME(ossimCosmoSkymedTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimErsSarTileSource));
// typeList.push_back(STATIC_TYPE_NAME(ossimErsSarTileSource));
// typeList.push_back(STATIC_TYPE_NAME(ossimRadarSat2TileSource));
}
......@@ -51,7 +51,7 @@ static ossimTrace traceDebug = ossimTrace("ossimSensorModelFactory:debug");
#include <ossim/projection/ossimTerraSarModel.h>
//#include <ossim/projection/ossimCosmoSkymedModel.h>
// #include <ossim/projection/ossimRadarSat2Model.h>
#include <ossim/projection/ossimErsSarModel.h>
// #include <ossim/projection/ossimErsSarModel.h>
#include <ossim/projection/ossimTileMapModel.h>
//***
......@@ -212,10 +212,10 @@ ossimSensorModelFactory::createProjection(const ossimString &name) const
// {
// return new ossimRadarSat2Model;
// }
if (name == STATIC_TYPE_NAME(ossimErsSarModel))
{
return new ossimErsSarModel;
}
// if (name == STATIC_TYPE_NAME(ossimErsSarModel))
// {
// return new ossimErsSarModel;
// }
//***
// ADD_MODEL: (Please leave this comment for the next programmer)
//***
......@@ -268,7 +268,7 @@ ossimSensorModelFactory::getTypeNameList(std::vector<ossimString>& typeList)
typeList.push_back(STATIC_TYPE_NAME(ossimTerraSarModel));
// typeList.push_back(STATIC_TYPE_NAME(ossimCosmoSkymedModel));
typeList.push_back(STATIC_TYPE_NAME(ossimEnvisatAsarModel));
typeList.push_back(STATIC_TYPE_NAME(ossimErsSarModel));
// typeList.push_back(STATIC_TYPE_NAME(ossimErsSarModel));
typeList.push_back(STATIC_TYPE_NAME(ossimTileMapModel));
//***
// ADD_MODEL: Please leave this comment for the next programmer. Add above.
......
//----------------------------------------------------------------------------
//
// "Copyright Centre National d'Etudes Spatiales"
//
// License: LGPL
//
// See LICENSE.txt file in the top level directory for more details.
//
//----------------------------------------------------------------------------
// $Id$
#include "ers/ErsSar/ErsSarLeader/ErsSarDataSetSummary.h"
namespace ossimplugins
{
ErsSarDataSetSummary::ErsSarDataSetSummary() : ErsSarRecord("dataset_sum_rec")
{
}
ErsSarDataSetSummary::~ErsSarDataSetSummary()
{
}
std::ostream& operator<<(std::ostream& os, const ErsSarDataSetSummary& data)
{
os<<"seq_num:"<<data._seq_num<<std::endl;
os<<"sar_chn:"<<data._sar_chn<<std::endl;
os<<"scene_id:"<<data._scene_id.c_str()<<std::endl;
os<<"scene_des:"<<data._scene_des.c_str()<<std::endl;
os<<"inp_sctim:"<<data._inp_sctim.c_str()<<std::endl;
os<<"asc_des:"<<data._asc_des.c_str()<<std::endl;
os<<"pro_lat:"<<data._pro_lat<<std::endl;
os<<"pro_long:"<<data._pro_long<<std::endl;
os<<"pro_head:"<<data._pro_head<<std::endl;
os<<"ellip_des:"<<data._ellip_des.c_str()<<std::endl;
os<<"ellip_maj:"<<data._ellip_maj<<std::endl;
os<<"ellip_min:"<<data._ellip_min<<std::endl;
os<<"earth_mass:"<<data._earth_mass<<std::endl;
os<<"grav_const:"<<data._grav_const<<std::endl;
os<<"ellip_j[0]:"<<data._ellip_j[0]<<std::endl;
os<<"ellip_j[1]:"<<data._ellip_j[1]<<std::endl;
os<<"ellip_j[2]:"<<data._ellip_j[2]<<std::endl;
os<<"terrain_h:"<<data._terrain_h<<std::endl;
os<<"sc_lin:"<<data._sc_lin<<std::endl;
os<<"sc_pix:"<<data._sc_pix<<std::endl;
os<<"scene_len:"<<data._scene_len<<std::endl;
os<<"scene_wid:"<<data._scene_wid<<std::endl;
os<<"nchn:"<<data._nchn<<std::endl;
os<<"mission_id:"<<data._mission_id.c_str()<<std::endl;
os<<"sensor_id:"<<data._sensor_id.c_str()<<std::endl;
os<<"orbit_num:"<<data._orbit_num.c_str()<<std::endl;
os<<"plat_lat:"<<data._plat_lat<<std::endl;
os<<"plat_long:"<<data._plat_long<<std::endl;
os<<"plat_head:"<<data._plat_head<<std::endl;
os<<"clock_ang:"<<data._clock_ang<<std::endl;
os<<"incident_ang:"<<data._incident_ang<<std::endl;
os<<"wave_length:"<<data._wave_length<<std::endl;
os<<"motion_comp:"<<data._motion_comp.c_str()<<std::endl;
os<<"pulse_code:"<<data._pulse_code.c_str()<<std::endl;
for (int i=0;i<5;i++)
{
os<<"ampl_coef["<<i<<"]:"<<data._ampl_coef[i]<<std::endl;
}
for (int i=0;i<5;i++)
{
os<<"phas_coef["<<i<<"]:"<<data._phas_coef[i]<<std::endl;
}
os<<"chirp_ext_ind:"<<data._chirp_ext_ind<<std::endl;
os<<"fr:"<<data._fr<<std::endl;
os<<"rng_gate:"<<data._rng_gate<<std::endl;
os<<"rng_length:"<<data._rng_length<<std::endl;
os<<"baseband_f:"<<data._baseband_f.c_str()<<std::endl;
os<<"rngcmp_f:"<<data._rngcmp_f.c_str()<<std::endl;
os<<"gn_polar:"<<data._gn_polar <<std::endl;
os<<"gn_cross:"<<data._gn_cross <<std::endl;
os<<"chn_bits:"<<data._chn_bits<<std::endl;
os<<"quant_desc:"<<data._quant_desc.c_str()<<std::endl;
os<<"i_bias:"<<data._i_bias<<std::endl;
os<<"q_bias:"<<data._q_bias<<std::endl;
os<<"iq_ratio:"<<data._iq_ratio<<std::endl;
os<<"mech_sight:"<<data._mech_sight<<std::endl;
os<<"fa:"<<data._fa<<std::endl;
os<<"sat_bintim:"<<data._sat_bintim.c_str()<<std::endl;
os<<"sat_clktim:"<<data._sat_clktim.c_str()<<std::endl;
os<<"sat_clkinc:"<<data._sat_clkinc.c_str()<<std::endl;
os<<"fac_id:"<<data._fac_id.c_str()<<std::endl;
os<<"sys_id:"<<data._sys_id.c_str()<<std::endl;
os<<"ver_id:"<<data._ver_id.c_str()<<std::endl;
os<<"prod_type:"<<data._prod_type.c_str()<<std::endl;
os<<"algor_id:"<<data._algor_id.c_str()<<std::endl;
os<<"n_azilok:"<<data._n_azilok<<std::endl;
os<<"n_rnglok:"<<data._n_rnglok<<std::endl;
os<<"bnd_azilok:"<<data._bnd_azilok<<std::endl;
os<<"bnd_rnglok:"<<data._bnd_rnglok<<std::endl;
os<<"bnd_azi:"<<data._bnd_azi<<std::endl;
os<<"bnd_rng:"<<data._bnd_rng<<std::endl;
os<<"azi_weight:"<<data._azi_weight.c_str()<<std::endl;
os<<"rng_weight:"<<data._rng_weight.c_str()<<std::endl;
os<<"data_inpsrc:"<<data._data_inpsrc.c_str()<<std::endl;
os<<"rng_res:" << data._rng_res << std::endl;
os<<"azi_res:" << data._azi_res << std::endl;
os<<"alt_dopcen[0]:"<<data._alt_dopcen[0]<<std::endl;
os<<"alt_dopcen[1]:"<<data._alt_dopcen[1]<<std::endl;
os<<"alt_dopcen[2]:"<<data._alt_dopcen[2]<<std::endl;
os<<"crt_dopcen[0]:"<<data._crt_dopcen[0]<<std::endl;
os<<"crt_dopcen[1]:"<<data._crt_dopcen[1]<<std::endl;
os<<"crt_dopcen[2]:"<<data._crt_dopcen[2]<<std::endl;
os<<"time_dir_pix:"<<data._time_dir_pix.c_str()<<std::endl;
os<<"time_dir_lin:"<<data._time_dir_lin.c_str()<<std::endl;
os<<"alt_rate[0]:"<<data._alt_rate[0]<<std::endl;
os<<"alt_rate[1]:"<<data._alt_rate[1]<<std::endl;
os<<"alt_rate[2]:"<<data._alt_rate[2]<<std::endl;
os<<"crt_rate[0]:"<<data._crt_rate[0]<<std::endl;
os<<"crt_rate[1]:"<<data._crt_rate[1]<<std::endl;
os<<"crt_rate[2]:"<<data._crt_rate[2]<<std::endl;
os<<"clutter_lock:"<<data._line_cont.c_str()<<std::endl;
os<<"clutter_lock:"<<data._clutter_lock.c_str()<<std::endl;
os<<"auto_focus:"<<data._auto_focus.c_str()<<std::endl;
os<<"line_spacing:"<<data._line_spacing<<std::endl;
os<<"pix_spacing:"<<data._pix_spacing<<std::endl;
os<<"rngcmp_desg:"<<data._rngcmp_desg.c_str()<<std::endl;
os<<"zero_dop_range_time_f_pixel:"<<data._zero_dop_range_time_f_pixel<<std::endl;
os<<"zero_dop_range_time_c_pixel:"<<data._zero_dop_range_time_c_pixel<<std::endl;
os<<"zero_dop_range_time_l_pixel:"<<data._zero_dop_range_time_l_pixel<<std::endl;
os<<"zero_dop_az_time_f_pixel :"<<data._zero_dop_az_time_f_pixel.c_str()<<std::endl;
os<<" zero_dop_az_time_c_pixel:"<<data._zero_dop_az_time_c_pixel.c_str()<<std::endl;
os<<" zero_dop_az_time_l_pixel:"<<data._zero_dop_az_time_l_pixel.c_str()<<std::endl;
return os;
}
std::istream& operator>>(std::istream& is, ErsSarDataSetSummary& data)
{
char buf16[17];
buf16[16]='\0';
char buf32[33];
buf32[32] = '\0';
char buf8[9];
buf8[8] = '\0';
char buf4[5];
buf4[4] = '\0';
is.read(buf4,4);
data._seq_num = atoi(buf4);
is.read(buf4,4);
data._sar_chn = atoi(buf4);
is.read(buf16,16);
data._scene_id = buf16;
is.read(buf32,32);
data._scene_des = buf32;
is.read(buf32,32);
data._inp_sctim = buf32;
is.read(buf16,16);
data._asc_des = buf16;
is.read(buf16,16);
data._pro_lat = atof(buf16);
is.read(buf16,16);
data._pro_long = atof(buf16);
is.read(buf16,16);
data._pro_head = atof(buf16);
is.read(buf16,16);
data._ellip_des = buf16;
is.read(buf16,16);
data._ellip_maj = atof(buf16);
is.read(buf16,16);
data._ellip_min = atof(buf16);
is.read(buf16,16);
data._earth_mass = atof(buf16);
is.read(buf16,16);
data._grav_const = atof(buf16);
is.read(buf16,16);
data._ellip_j[0] = atof(buf16);
is.read(buf16,16);
data._ellip_j[1] = atof(buf16);
is.read(buf16,16);
data._ellip_j[2] = atof(buf16);
is.read(buf16,16);
is.read(buf16,16);
data._terrain_h = atof(buf16);
is.read(buf8,8);
data._sc_lin = atoi(buf8);
is.read(buf8,8);
data._sc_pix = atoi(buf8);
is.read(buf16,16);
data._scene_len = atof(buf16);
is.read(buf16,16);
data._scene_wid = atof(buf16);
is.read(buf16,16);
is.read(buf4,4);
data._nchn = atoi(buf4);