Commit 15cb665a authored by koppenh's avatar koppenh
Browse files

*** empty log message ***

parent 12bbf660
This diff is collapsed.
......@@ -171,7 +171,7 @@ diffima::diffima(MArray<int,1> d_in, MArray<double,1> sig_in,
kernpara(),
absmat(),
bgmat(),
bgmat_eff(),
// bgmat_eff(),
refpath(refpath_in),
convolvewithkern(false),
Matrixdirectfromreference(false),
......@@ -2483,7 +2483,7 @@ int diffima::convolve(const MArray<float,2>& imamat,
if ( verbose >= 4 ) {
absmat.makeReference( MArray<float,2>(imamat.shape())); absmat=0.;
bgmat.makeReference( MArray<float,2>(imamat.shape())); bgmat=0.;
bgmat_eff.makeReference( MArray<float,2>(imamat.shape())); bgmat_eff=0.;
// bgmat_eff.makeReference( MArray<float,2>(imamat.shape())); bgmat_eff=0.;
}
const Range MX(mx0,mx1);
......
......@@ -313,8 +313,8 @@ int main( int argc, char **argv )
exit(-1);
}
Stopwatch stopwatch( "diffima total" );
stopwatch.start();
// Stopwatch stopwatch( "diffima total" );
// stopwatch.start();
list< string > files = COM.fileArguments();
......@@ -355,7 +355,7 @@ int main( int argc, char **argv )
P.part.setEnd(2,ly - P.lek[1]);
Stopwatch lap( "referenzbild einlesen" );
// Stopwatch lap( "referenzbild einlesen" );
if ( P.verbose >=1 ) {
cout << "part begin x = " << P.part.getStart(1) << endl;
......@@ -433,14 +433,14 @@ int main( int argc, char **argv )
<< setw(45) << "image"
<< endl;
stopwatch.lap( "calculate cc images" );
// stopwatch.lap( "calculate cc images" );
++iter;
for (; iter != files.end(); ++iter ) {
Stopwatch stopwatch2( "diffima per image" );
stopwatch2.start();
// Stopwatch stopwatch2( "diffima per image" );
// stopwatch2.start();
//////////////////////////////////////////////////////////////////////////////
time_t now = time( NULL );
......@@ -454,7 +454,7 @@ int main( int argc, char **argv )
ei2mat.makeReference( eget( iname, P ) );
mydiff.calc_kern( i2mat, ei2mat, P.part, P.lef, false, P.nfields[0], P.nfields[1] );
stopwatch2.lap( "calculate kernel" );
// stopwatch2.lap( "calculate kernel" );
if ( P.verbose >= 2 ) {
string kernname = newname( iname, "kern-" );
FitsOut kfits( kernname );
......@@ -476,7 +476,7 @@ int main( int argc, char **argv )
mydiff.convolve(ei2mat, eresmat, ediffmat, 0);
}
stopwatch2.lap( "convolve" );
// stopwatch2.lap( "convolve" );
time_t later = time( NULL );
if ( P.verbose >=1 )
cout << " calculation finished after " << later-now << " sec" << endl;
......@@ -515,35 +515,36 @@ int main( int argc, char **argv )
ediff << ediffmat;
}
stopwatch2.lap( "save k- and d-images + error images" );
if ( P.verbose >= 3 ) {
// stopwatch2.lap( "save k- and d-images + error images" );
if ( P.verbose >= 4 ) {
string bname1 = newname( iname, "bg_eff-d" );
if ( P.verbose >=1 )
cout << "Saving " << bname1 << endl;
cout << "Saving " << bname1 << endl;
FitsOut bgfits1( bname1, image, false, true );
cout << "hallo1" << endl;
bgfits1 << mydiff.bgmat_eff;
cout << "hallo2" << endl;
string bname2 = newname( iname, "bg-d" );
if ( P.verbose >=1 )
cout << "Saving " << bname2 << endl;
cout << "Saving " << bname2 << endl;
FitsOut bgfits2( bname2, image, false, true );
cout << "hallo3" << endl;
bgfits2 << mydiff.bgmat;
string absname = newname( iname, "abs-d" );
if ( P.verbose >=1 )
cout << "Saving " << absname << endl;
cout << "hallo4" << endl;
string absname = newname( iname, "abs-d" );
cout << "Saving " << absname << endl;
FitsOut absfits( absname, image, false, true );
absfits << mydiff.absmat;
stopwatch2.lap( "write backgrond images" );
// stopwatch2.lap( "write backgrond images" );
}
mydiff.write_table( table, iname );
stopwatch2.stop( "write table" );
// stopwatch2.printStatus();
// stopwatch2.stop( "write table" );
// stopwatch2.printStatus();
}
table.close();
stopwatch.stop( "create differnce images" );
// stopwatch.printStatus();
// stopwatch.stop( "create differnce images" );
// stopwatch.printStatus();
}
catch ( exception &eww ) {
......
This diff is collapsed.
......@@ -163,7 +163,8 @@ public:
void find ( const MArray< float, 2 > bildmat, const MArray< float, 2 > ebildmat,
MArray< double, 1 >& stars_x, MArray< double, 1 >& stars_y, MArray< double, 1 >& stars_flux,
const double kappa, const double max_nchi, const double aperture, const string filename, const int verbose = 1 );
void binning ( const double sub_x, const double sub_y );
//void binning( const double sub_x, const double sub_y )
void binning( const double frac_x, const double frac_y ); // arri 090913
void write_psf ( const string filename );
void write_binned_psf ( const string filename );
void write_binned ( const string filename );
......@@ -849,8 +850,8 @@ void sort2( MArray< T1, 1 >& s, MArray< T2, 1 >& v )
}
}
template< class T1, class T2 >
void sort3( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T2, 1 >& v2 )
template< class T1, class T2, class T3 >
void sort3( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T3, 1 >& v2 )
{
const int i1 = s.minIndex(1);
const int i2 = s.maxIndex(1);
......@@ -864,14 +865,14 @@ void sort3( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T2, 1 >& v2 )
T2 dum2 = v1(i);
v1(i) = v1(j);
v1(j) = dum2;
dum2 = v2(i);
T3 dum3 = v2(i);
v2(i) = v2(j);
v2(j) = dum2;
v2(j) = dum3;
}
}
template< class T1, class T2 >
void sort4( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T2, 1 >& v2, MArray< T2, 1 >& v3 )
template< class T1, class T2, class T3, class T4 >
void sort4( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T3, 1 >& v2, MArray< T4, 1 >& v3 )
{
const int i1 = s.minIndex(1);
const int i2 = s.maxIndex(1);
......@@ -885,17 +886,17 @@ void sort4( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T2, 1 >& v2, MArray
T2 dum2 = v1(i);
v1(i) = v1(j);
v1(j) = dum2;
dum2 = v2(i);
T3 dum3 = v2(i);
v2(i) = v2(j);
v2(j) = dum2;
dum2 = v3(i);
v2(j) = dum3;
T4 dum4 = v3(i);
v3(i) = v3(j);
v3(j) = dum2;
v3(j) = dum4;
}
}
template< class T1, class T2 >
void sort5( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T2, 1 >& v2, MArray< T2, 1 >& v3, MArray< T2, 1 >& v4 )
template< class T1, class T2, class T3, class T4, class T5 >
void sort5( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T3, 1 >& v2, MArray< T4, 1 >& v3, MArray< T5, 1 >& v4 )
{
const int i1 = s.minIndex(1);
const int i2 = s.maxIndex(1);
......@@ -909,20 +910,20 @@ void sort5( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T2, 1 >& v2, MArray
T2 dum2 = v1(i);
v1(i) = v1(j);
v1(j) = dum2;
dum2 = v2(i);
T3 dum3 = v2(i);
v2(i) = v2(j);
v2(j) = dum2;
dum2 = v3(i);
v2(j) = dum3;
T4 dum4 = v3(i);
v3(i) = v3(j);
v3(j) = dum2;
dum2 = v4(i);
v3(j) = dum4;
T5 dum5 = v4(i);
v4(i) = v4(j);
v4(j) = dum2;
v4(j) = dum5;
}
}
template< class T1, class T2 >
void sort6( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T2, 1 >& v2, MArray< T2, 1 >& v3, MArray< T2, 1 >& v4, MArray< T2, 1 >& v5 )
template< class T1, class T2, class T3, class T4, class T5, class T6 >
void sort6( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T3, 1 >& v2, MArray< T4, 1 >& v3, MArray< T5, 1 >& v4, MArray< T6, 1 >& v5 )
{
const int i1 = s.minIndex(1);
const int i2 = s.maxIndex(1);
......@@ -936,23 +937,23 @@ void sort6( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T2, 1 >& v2, MArray
T2 dum2 = v1(i);
v1(i) = v1(j);
v1(j) = dum2;
dum2 = v2(i);
T3 dum3 = v2(i);
v2(i) = v2(j);
v2(j) = dum2;
dum2 = v3(i);
v2(j) = dum3;
T4 dum4 = v3(i);
v3(i) = v3(j);
v3(j) = dum2;
dum2 = v4(i);
v3(j) = dum4;
T5 dum5 = v4(i);
v4(i) = v4(j);
v4(j) = dum2;
dum2 = v5(i);
v4(j) = dum5;
T6 dum6 = v5(i);
v5(i) = v5(j);
v5(j) = dum2;
v5(j) = dum6;
}
}
template< class T1, class T2 >
void sort7( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T2, 1 >& v2, MArray< T2, 1 >& v3, MArray< T2, 1 >& v4, MArray< T2, 1 >& v5, MArray< T2, 1 >& v6 )
template< class T1, class T2, class T3, class T4, class T5, class T6, class T7 >
void sort7( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T3, 1 >& v2, MArray< T4, 1 >& v3, MArray< T5, 1 >& v4, MArray< T6, 1 >& v5, MArray< T7, 1 >& v6 )
{
const int i1 = s.minIndex(1);
const int i2 = s.maxIndex(1);
......@@ -966,21 +967,21 @@ void sort7( MArray< T1, 1 >& s, MArray< T2, 1 >& v1, MArray< T2, 1 >& v2, MArray
T2 dum2 = v1(i);
v1(i) = v1(j);
v1(j) = dum2;
dum2 = v2(i);
T3 dum3 = v2(i);
v2(i) = v2(j);
v2(j) = dum2;
dum2 = v3(i);
v2(j) = dum3;
T4 dum4 = v3(i);
v3(i) = v3(j);
v3(j) = dum2;
dum2 = v4(i);
v3(j) = dum4;
T5 dum5 = v4(i);
v4(i) = v4(j);
v4(j) = dum2;
dum2 = v5(i);
v4(j) = dum5;
T6 dum6 = v5(i);
v5(i) = v5(j);
v5(j) = dum2;
dum2 = v6(i);
v5(j) = dum6;
T7 dum7 = v6(i);
v6(i) = v6(j);
v6(j) = dum2;
v6(j) = dum7;
}
}
......
This diff is collapsed.
......@@ -538,6 +538,22 @@ int mfind( MArray< T, 1 >& marray, T value )
return found;
}
template< class T >
double mfind_closest( MArray< T, 1 >& marray, T value )
{
int min = marray.minIndex(1);
int max = marray.minIndex(1);
double dist = 1.e99;
double item = 0.;
for ( int i = min; i <= max; ++i )
if ( fabs( double( marray(i) ) - double( value ) ) < dist ) {
item = double( marray(i) );
dist = fabs( double( marray(i) ) - double( value ) );
}
return item;
}
template< class T >
int mcount( MArray< T, 1 >& marray, T value )
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment