Proposed changes to UnwrapComp CMakeLists.txt, unwrapComponents.py and relaxIVdriver.cpp (#324)
* Updated CMakeLists.txt * Update relaxIVdriver.cpp * Update unwrapComponents.py * Fix the paths on lines 445 and 446 * Fixed paths on lines 445 and 446LT1AB
parent
b961aa3635
commit
ad244f07b0
|
@ -1,7 +1,20 @@
|
||||||
# TODO check for RelaxIV
|
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/RelaxIV)
|
||||||
|
Python_add_library(unwcomp MODULE
|
||||||
|
bindings/unwcompmodule.cpp
|
||||||
|
src/RelaxIV/RelaxIV.C
|
||||||
|
src/relaxIVdriver.cpp
|
||||||
|
)
|
||||||
|
target_include_directories(unwcomp PUBLIC include)
|
||||||
|
InstallSameDir(
|
||||||
|
__init__.py
|
||||||
|
phaseUnwrap.py
|
||||||
|
unwrapComponents.py
|
||||||
|
unwcomp
|
||||||
|
)
|
||||||
|
else()
|
||||||
InstallSameDir(
|
InstallSameDir(
|
||||||
__init__.py
|
__init__.py
|
||||||
phaseUnwrap.py
|
phaseUnwrap.py
|
||||||
unwrapComponents.py
|
unwrapComponents.py
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <RelaxIV.h>
|
#include <RelaxIV.h>
|
||||||
#include <relaxIVdriver.h>
|
#include <relaxIVdriver.h>
|
||||||
#include <MCFClass.h>
|
|
||||||
|
|
||||||
using namespace MCFClass_di_unipi_it;
|
using namespace MCFClass_di_unipi_it;
|
||||||
|
|
||||||
|
@ -13,7 +13,72 @@ inline T ABS( const T x )
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
extern void SetParam( MCFClass *mcf );
|
//extern void SetParam( MCFClass *mcf );
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
static inline void str2val( const char* const str , T &sthg )
|
||||||
|
{
|
||||||
|
istringstream( str ) >> sthg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
// This function skips comment line in a input stream, where comment line is
|
||||||
|
// // marked by an initial '#' character
|
||||||
|
//
|
||||||
|
void SkipComments( ifstream &iParam , string &buf )
|
||||||
|
{
|
||||||
|
do {
|
||||||
|
iParam >> ws;
|
||||||
|
getline( iParam , buf );
|
||||||
|
}
|
||||||
|
while( buf[ 0 ] == '#' );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void SetParam( MCFClass *mcf )
|
||||||
|
{
|
||||||
|
ifstream iParam( "config.txt" );
|
||||||
|
if( ! iParam.is_open() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
string buf;
|
||||||
|
int num;
|
||||||
|
SkipComments( iParam , buf );
|
||||||
|
str2val( buf.c_str(), num ); // get number of int parameters
|
||||||
|
|
||||||
|
for( int i = 0 ; i < num ; i++ ) { // read all int parameters
|
||||||
|
int param , val;
|
||||||
|
|
||||||
|
SkipComments( iParam , buf );
|
||||||
|
str2val( buf.c_str(), param ); // parameter name
|
||||||
|
|
||||||
|
SkipComments( iParam , buf );
|
||||||
|
str2val( buf.c_str(), val ); // parameter value
|
||||||
|
|
||||||
|
mcf->SetPar( param , val );
|
||||||
|
|
||||||
|
} // end( for( i ) )
|
||||||
|
|
||||||
|
SkipComments( iParam , buf );
|
||||||
|
str2val( buf.c_str() , num ); // get number of double parameters
|
||||||
|
|
||||||
|
for( int i = 0 ; i < num ; i++ ) { // read all double parameters
|
||||||
|
int param;
|
||||||
|
double val;
|
||||||
|
SkipComments( iParam , buf );
|
||||||
|
str2val( buf.c_str(), param ); // parameter name
|
||||||
|
|
||||||
|
SkipComments( iParam , buf );
|
||||||
|
str2val( buf.c_str() , val ); // parameter value
|
||||||
|
|
||||||
|
mcf->SetPar( param , val );
|
||||||
|
|
||||||
|
} // end( for( i ) )
|
||||||
|
} // end( SetParam )
|
||||||
|
|
||||||
|
|
||||||
vector<int> driver(char *fileName)
|
vector<int> driver(char *fileName)
|
||||||
{
|
{
|
||||||
ifstream iFile(fileName);
|
ifstream iFile(fileName);
|
||||||
|
|
|
@ -442,6 +442,6 @@ if __name__ == "__main__":
|
||||||
import isceobj
|
import isceobj
|
||||||
|
|
||||||
unw = UnwrapComponents()
|
unw = UnwrapComponents()
|
||||||
unw.setInpFile('/Users/subrahma/proj/isce/data/filt_topophase.unw.xml')
|
unw.setInpFile(inpFile)
|
||||||
unw.setConnCompFile('/Users/subrahma/proj/isce/data/filt_topophase.unw.conncomp.xml')
|
unw.setConnCompFile(ccFile)
|
||||||
unw.unwrapComponents()
|
unw.unwrapComponents()
|
||||||
|
|
Loading…
Reference in New Issue