Skip to content
Snippets Groups Projects
Commit 2129614c authored by Chia Aik Song's avatar Chia Aik Song
Browse files

Remove SRGR related code and disable code which handles GCPs

parent 16e27d0c
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#ifndef AlosSarFileDescriptor_h #ifndef AlosSarFileDescriptor_h
#define AlosSarFileDescriptor_h #define AlosSarFileDescriptor_h
// TODO Rename to AlosSarLeaderFileDescriptor
#include<iostream> #include<iostream>
#include <cstdlib> #include <cstdlib>
......
...@@ -40,13 +40,9 @@ namespace ossimplugins ...@@ -40,13 +40,9 @@ namespace ossimplugins
RTTI_DEF1(ossimAlosPalsarModel, "ossimAlosPalsarModel", ossimGeometricSarSensorModel); RTTI_DEF1(ossimAlosPalsarModel, "ossimAlosPalsarModel", ossimGeometricSarSensorModel);
ossimAlosPalsarModel::ossimAlosPalsarModel(): ossimAlosPalsarModel::ossimAlosPalsarModel():
theNumberSRGR(0),
thePixelSpacing(0), thePixelSpacing(0),
theAlosSarLeader(NULL) theAlosSarLeader(NULL)
{ {
theSRGRCoeffset[0][0]=0.0;
theSRGRCoeffset[0][1]=0.0;
theSRGRCoeffset[0][2]=0.0;
} }
ossimAlosPalsarModel::~ossimAlosPalsarModel() ossimAlosPalsarModel::~ossimAlosPalsarModel()
...@@ -65,9 +61,7 @@ ossimObject* ossimAlosPalsarModel::dup() const ...@@ -65,9 +61,7 @@ ossimObject* ossimAlosPalsarModel::dup() const
double ossimAlosPalsarModel::getSlantRangeFromGeoreferenced(double col) const double ossimAlosPalsarModel::getSlantRangeFromGeoreferenced(double col) const
{ {
const double c = 2.99792458e+8; // TODO Add user warning and reference to ERS Model
double tn = theSRGRCoeffset[0][0] + theSRGRCoeffset[0][1] * col + theSRGRCoeffset[0][2] * col*col ;
return tn * (c/2.0);
} }
bool ossimAlosPalsarModel::InitSensorParams(const ossimKeywordlist &kwl, const char *prefix) bool ossimAlosPalsarModel::InitSensorParams(const ossimKeywordlist &kwl, const char *prefix)
...@@ -350,6 +344,9 @@ bool ossimAlosPalsarModel::loadState (const ossimKeywordlist &kwl, const char *p ...@@ -350,6 +344,9 @@ bool ossimAlosPalsarModel::loadState (const ossimKeywordlist &kwl, const char *p
} }
} }
// Products georeferenced to ground range are not handled in AlosPalsarModel
_isProductGeoreferenced = false;
/*
if (result) if (result)
{ {
result = InitSRGR(kwl, prefix); result = InitSRGR(kwl, prefix);
...@@ -363,6 +360,7 @@ bool ossimAlosPalsarModel::loadState (const ossimKeywordlist &kwl, const char *p ...@@ -363,6 +360,7 @@ bool ossimAlosPalsarModel::loadState (const ossimKeywordlist &kwl, const char *p
} }
} }
} }
*/
return result; return result;
} }
...@@ -579,6 +577,8 @@ bool ossimAlosPalsarModel::InitRefPoint(const ossimKeywordlist &kwl, const char ...@@ -579,6 +577,8 @@ bool ossimAlosPalsarModel::InitRefPoint(const ossimKeywordlist &kwl, const char
theImageSize.y = atoi(nbLin_str); theImageSize.y = atoi(nbLin_str);
theImageClipRect = ossimDrect(0, 0, theImageSize.x-1, theImageSize.y-1); theImageClipRect = ossimDrect(0, 0, theImageSize.x-1, theImageSize.y-1);
// AlosPalsarModel currently does not handle GCPs
/* Do not use GCPs for now
// Ground Control Points extracted from the model : corner points // Ground Control Points extracted from the model : corner points
std::list<ossimGpt> groundGcpCoordinates ; std::list<ossimGpt> groundGcpCoordinates ;
std::list<ossimDpt> imageGcpCoordinates ; std::list<ossimDpt> imageGcpCoordinates ;
...@@ -625,42 +625,16 @@ bool ossimAlosPalsarModel::InitRefPoint(const ossimKeywordlist &kwl, const char ...@@ -625,42 +625,16 @@ bool ossimAlosPalsarModel::InitRefPoint(const ossimKeywordlist &kwl, const char
// Default optimization // Default optimization
optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ; optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ;
*/
return true; return true;
} }
// Note: Products georeferenced to ground range are not handled in AlosPalsarModel
// therefore the following method will not be used
bool ossimAlosPalsarModel::InitSRGR(const ossimKeywordlist &kwl, const char *prefix) bool ossimAlosPalsarModel::InitSRGR(const ossimKeywordlist &kwl, const char *prefix)
{ {
// Product type = PRI // TODO Add user warning and reference to ERS Model
ossimString filename(kwl.find("filename"));
filename.upcase();
//std::transform(filename.begin(), filename.end(), filename.begin(), toupper);
string::size_type loc = filename.find("PRI");
if( loc != string::npos ) {
_isProductGeoreferenced = true;
} else {
_isProductGeoreferenced = false;
}
// Number of SRGR Coef
theNumberSRGR = 3;
// Range time for first mid and last pixel
double t1 = atof(kwl.find("zero_dop_range_time_f_pixel"))*1e-3;
double t2 = atof(kwl.find("zero_dop_range_time_c_pixel"))*1e-3;
double t3 = atof(kwl.find("zero_dop_range_time_l_pixel"))*1e-3;
// Range pixels numbers corresponding
// Todo : check if it works with "DECREASING LINE TIME"
// double x1 = 0.0;
double x2 = atof(kwl.find("sc_pix")) - 1.0;
double x3 = 2.0*(x2+1.0) -1.0 ;
theSRGRCoeffset[0][0] = t1;
theSRGRCoeffset[0][1] = ((t2-t1)/(x2*x2)+(t1-t3)/(x3*x3))/((1.0/x2)-(1.0/x3));
theSRGRCoeffset[0][2] = ((t2-t1)/x2 + (t1-t3)/x3)/(x2-x3);
return true;
} }
bool ossimAlosPalsarModel::isAlosPalsarLeader(const ossimFilename& file) const bool ossimAlosPalsarModel::isAlosPalsarLeader(const ossimFilename& file) const
......
...@@ -100,14 +100,6 @@ protected: ...@@ -100,14 +100,6 @@ protected:
virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix); virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix);
private: private:
/**
* @brief Slant Range for each Ground Range (SRGR) number of coefficients sets
*/
int theNumberSRGR;
/**
* @brief SRGR coefficient sets
*/
double theSRGRCoeffset[1][3];
/** /**
* @brief Pixel spacing * @brief Pixel spacing
*/ */
......
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