Commit 5a7b5dc5 authored by Danny Boxhoorn's avatar Danny Boxhoorn
Browse files

Version sent by Johannes on 2014-05-02.

parent 24e56c9c
......@@ -199,7 +199,8 @@ diffima::diffima(MArray<int,1> d_in, MArray<double,1> sig_in,
// d = 6,4,2,0;
//}
//else {
if (verbose>=2) cout << " refpath = " << refpath << endl;
//if (verbose>=2)
cout << " refpath = " << refpath << endl;
d.makeReference(d_in);
//}
......@@ -219,7 +220,7 @@ diffima::diffima(MArray<int,1> d_in, MArray<double,1> sig_in,
exit(-1);
}
//create_basis
cout << " create kernel basis ..." << endl;
//nbg=0;
if (dbg >= 0) {
......@@ -229,7 +230,7 @@ diffima::diffima(MArray<int,1> d_in, MArray<double,1> sig_in,
}
}
}
mat = nbg;
for (int nn = nbg+1, n=1; n<=len; ++n) {
for (int dnx = 0; dnx <= d(n); ++dnx) {
......@@ -251,9 +252,9 @@ diffima::diffima(MArray<int,1> d_in, MArray<double,1> sig_in,
//quad = ((pow2(indexPos(quad,1))+pow2(indexPos(quad,2)))<(lek+0.5)*(lek+0.5));
for (int v = -leky; v <= leky; ++v) {
for (int u = -lekx; u <= lekx; ++u) {
quad(u,v)=0;
quad(u,v)=false;
if (pow2(float(u)/(lekx+0.5))+pow2(float(v)/(leky+0.5))<1.) {
quad(u,v)=1;
quad(u,v)=true;
}
}
}
......@@ -331,7 +332,7 @@ diffima::diffima(MArray<int,1> d_in, MArray<double,1> sig_in,
// bbfits << bb(Range::all(),Range::all(),i);
//}
///// end create_basis
cout <<" ... end create kernel basis" << endl;
}
......@@ -1929,11 +1930,19 @@ int diffima::calc_kern(const MArray<float,2>& imamat, const MArray<float,2>& ei
area.makeReference(MArray<int,2>(zzx,zzy)); area=0;
number_of_stars.makeReference(MArray<int,1>(tot_area_number)); number_of_stars=0;
//////////////////////////////////////
cout << "small definitions done" << endl;
//////////////////////////////////////
cout << "image_i size = " << (mx1-mx0)*(my1-my0)*4/1048576 << " MB" << endl;
image_i.makeReference(MArray<float,2>(Range(mx0,mx1),Range(my0,my1)));
if (!noerr_ima)
if (!noerr_ima) {
cout << "eimage_i size = " << (mx1-mx0)*(my1-my0)*4/1048576 << " MB" << endl;
eimage_i.makeReference(MArray<float,2>(Range(mx0,mx1),Range(my0,my1)));
}
cout << "irmask_calc size = " << (mx1-mx0)*(my1-my0)/1048576 << " MB" << endl;
irmask_calc.makeReference(MArray<bool,2>(Range(mx0,mx1),Range(my0,my1))); //WICHTIG!!!!
if (verbose>=2) cout << " load images and calculate mask ..." << endl<< endl;
......@@ -2032,7 +2041,8 @@ int diffima::calc_kern(const MArray<float,2>& imamat, const MArray<float,2>& ei
cout << " my1 = " << my1 << endl;
}
if (verbose>=2) cout << " loading rmask ... " << endl;
// if (verbose>=2)
cout << " loading rmask ... " << endl;
MArray<short,2> rmask_calc;
......@@ -2051,7 +2061,8 @@ int diffima::calc_kern(const MArray<float,2>& imamat, const MArray<float,2>& ei
//rmaskfits >> rmask_calc_buf ;
//rmask_calc(Range(mx0,mx1),Range(my0,my1))=rmask_calc_buf(Range(mx0,mx1),Range(my0,my1)); //WICHTIG!!!!
if (verbose>=3) {cout << "calc_kern: rmask_calc Array" << endl; rmask_calc.describeSelf();}
if (verbose>=3)
cout << "calc_kern: rmask_calc Array" << endl; rmask_calc.describeSelf();
// falsch: da rmaskfits nicht gross genug!!
//MArray<short,2> rmask_calc(Range(bx0,bx1),Range(by0,by1)); //WICHTIG!!!!
......@@ -2135,7 +2146,8 @@ int diffima::calc_kern(const MArray<float,2>& imamat, const MArray<float,2>& ei
list<FitsIn> infiles;
if (verbose>=2) cout << " start preparing fits files ..." << endl;
//if (verbose>=2)
cout << " start preparing fits files ..." << endl;
if (dbg >= 0) {
for (int nj = 1, i = 0; i <= dbg; ++i) {
for (int j = 0; j <= dbg - i; ++j, ++nj) {
......@@ -2150,7 +2162,8 @@ int diffima::calc_kern(const MArray<float,2>& imamat, const MArray<float,2>& ei
sprintf(cname,(refpath+"cc%4.4i.fits").c_str(),j);
infiles.push_back( FitsIn(cname,false,true) );
}
if (verbose>=2) cout << " end preparing fits files ..." << endl;
//if (verbose>=2)
cout << " ...end preparing fits files" << endl;
//////////////////////////////////////////////////////////////////////////
......@@ -2346,8 +2359,16 @@ int diffima::calc_kern(const MArray<float,2>& imamat, const MArray<float,2>& ei
/////////////// READING BASIS ////////
//cc.makeReference(MArray<float,3>(RX,RY,Range(1,mat)));
cout << "reserving memory for cc basis..." << endl;
cout << "cc basis array = " << mat << " "
<< fx1-fx0 << " " << fy1-fy0 << " size" << endl;
cout << "cc basis size = " << mat*(fx1-fx0)*(fy1-fy0)*4/1048576
<< " MB" << endl;
//cc.makeReference(MArray<float,3>(RX,RY,Range(1,mat)));
cc.makeReference(MArray<float,3>(Range(1,mat),RX,RY));
cout << "... reserving memory for cc basis" << endl;
cc=0.;
Region region(2);
......@@ -2366,6 +2387,8 @@ int diffima::calc_kern(const MArray<float,2>& imamat, const MArray<float,2>& ei
if (verbose>=3) cout << " start reading ..." << endl << " ";
cout << "reading basis" << endl;
MArray<float,2> c;
int nj = 0;
for (list<FitsIn>::iterator it=infiles.begin(); it!=infiles.end(); it++) {
......
......@@ -338,7 +338,9 @@ public:
private:
MArray<double,3> bb;
MArray<double,3> bb2;
public:
MArray<double,2> a;
private:
MArray<double,2> sa2;
MArray<double,1> NB;
MArray<double,1> N;
......
......@@ -1825,10 +1825,10 @@ void psf::mapping_full_best_source( const MArray< float, 2 >& imamat,
( my_nchi(px-1,py+1)>0. && my_nchi(px-1,py+1)<nnchi ) ||
( my_nchi(px ,py+1)>0. && my_nchi(px ,py+1)<nnchi ) ||
( my_nchi(px+1,py+1)>0. && my_nchi(px+1,py+1)<nnchi ) ) {
nchi(px,py) = -nnchi;
nchi(px,py) = -nnchi;
} else { // MINIMUM
nchi(px,py) = nnchi;
}
}
}
}
......
......@@ -247,7 +247,7 @@ int main( int argc, char **argv )
P.resname = newname(P.name,P.prefix);
P.eresname = newname(P.resname,"e.");
P.nchiname = newname(P.resname,"nchi-");
P.nchiname = newname(P.resname,"nchi_");
//MArray<float,2> resmat(Range(P.ber.getStart(1),P.ber.getEnd(1)),
// Range(P.ber.getStart(2),P.ber.getEnd(2)));
//resmat=0.;
......
This diff is collapsed.
/* -*- C++ -*-
*
* ---------------------------------------------------------------------
* skycalc.cpp, 2013/05/17
* skycalc.cpp, 2013/10/30
* ---------------------------------------------------------------------
*
* Copyright (C) 2003-2013 Arno Riffeser <arri@usm.lmu.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* ---------------------------------------------------------------------
*
*/
......@@ -3714,6 +3700,7 @@ void do_mydiff(double& abs, double& eabs, double& sky, double& esky,
const int npara, const double factor,
const string refpath,
const MArray<float,2>& imamat, const MArray<float,2>& eimamat,
MArray<float,2>& skymat,
Region& part, const int boxlen, const bool kreis)
{
......@@ -3730,7 +3717,9 @@ void do_mydiff(double& abs, double& eabs, double& sky, double& esky,
mydiff.stampxy(1,1,1) = part.getEnd(1);
mydiff.stampxy(2,1,1) = part.getEnd(2);
cout << "calc_kern" << endl;
mydiff.calc_kern(imamat, eimamat, part, boxlen, kreis); /// KERNEL
cout << "end calc_kern" << endl;
abs = mydiff.medabs;
eabs = mydiff.emedabs;
......@@ -3738,6 +3727,28 @@ void do_mydiff(double& abs, double& eabs, double& sky, double& esky,
esky = sqrt(pow2(mydiff.emedcon/abs)+
pow2(mydiff.medcon/pow2(abs)*eabs));
const int lenx=imamat.maxIndex(1);
const int leny=imamat.maxIndex(2);
const int area_number = 1;
//MArray<float,2> skymat(imamat.shape());
skymat = 0.;
for (int nj = 1, i = 0; i <= ordsky; ++i) {
for (int j = 0; j <= ordsky-i; ++j, ++nj) {
for (int y = 1; y <= leny; ++y) {
for (int x = 1; x <= lenx; ++x) {
double xi; double yj;
if (i == 0) xi = 1.;
else xi = pow(double(x),i);
if (j == 0) yj = 1.;
else yj = pow(double(y),j);
skymat(x,y) += mydiff.a(nj,area_number) * xi * yj;
}
}
}
}
skymat *= 1./abs;
//mydiff.reset();
}
......@@ -3836,7 +3847,7 @@ void fit_fielddia(const MArray<float,2>& i1mat, const MArray<float,2>& ei1mat,
double abs=0., eabs=0., sky=0., esky=0.;
do_mydiff(abs, eabs, sky, esky,
d, sig, P.lek, 0, P.ordsky, 1, 0., P.refpath,
i2mat, ei2mat, part, boxlen, false);
i2mat, ei2mat, sky_mat, part, boxlen, false);
cout << P.iname << " abs = " << abs << endl;
cout << P.iname << " eabs = " << eabs << endl;
......@@ -3892,7 +3903,9 @@ void fit_fielddia(const MArray<float,2>& i1mat, const MArray<float,2>& ei1mat,
// binspline("sky", new_i1, new_i2, sky_mat, P);
i2mat = merge( i2mat!=P.nan , i2mat/abs, P.nan );
binspline("sky", i1mat, i2mat, sky_mat, P);
if (P.binspline) {
binspline("sky", i1mat, i2mat, sky_mat, P);
}
abs_mat = 1./abs;
//R = (I-B)*A
......
......@@ -391,7 +391,7 @@ int fmoffat( MArray< double, 2 >& fun, MArray< double, 2 >& err,
refsa(0)+= sa(2) * est;
}
}
if (mof.iter_ == mof.lim_ )
return -8;
......@@ -1336,13 +1336,18 @@ int main( int argc, char **argv )
}
//Mihi 28.06.13
FitsHeader header( fsname );
FitsHeader header( name );
FitsCCS ccs( header );
FVector<double,2> resultPixel;
FVector<double,2> resultRaDec;
resultPixel(1) = H.xpos;
resultPixel(2) = H.ypos;
resultRaDec=ccs.getRADEC(resultPixel);
if(H.xpos != 0 && H.ypos != 0){
resultRaDec=ccs.getRADEC(resultPixel);
} else {
resultRaDec(1)=0;
resultRaDec(2)=0;
}
if ( P.verb >= 1 ) {
cout << " flag -1 : errmat( int( nx + a(5) ), int( ny + a(6) ) ) <= 0. " << endl
......
/* -*- C++ -*-
*
* ---------------------------------------------------------------------
* subby.cpp, 2013/02/23
* subby.cpp, 2014/03/06
* ---------------------------------------------------------------------
*
* Copyright (C) 2005-2013 Arno Riffeser <arri@usm.lmu.de>
* Copyright (C) 2005-2014 Arno Riffeser <arri@usm.lmu.de>
* Johannes Koppenhoefer <koppenh@mpe.mpg.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* ---------------------------------------------------------------------
*
*/
......@@ -126,7 +112,7 @@ int main( int argc, char **argv )
OptionParser OPT( &COM );
try {
OPT.addOption( new StringOption( "comp_stars", "", "list of comparison stars", 'c', &comp_stars ) );
OPT.addOption( new FloatOption ( "thresh", "0.1", "threshold", 't', &thresh ) );
OPT.addOption( new FloatOption ( "thresh", "0.", "threshold", 't', &thresh ) );
OPT.addOption( new FloatOption ( "radius", "4.", "radius", 'r', &radius ) );
OPT.addOption( new FloatOption ( "kappa", "0.", "kappa", 'k', &kappa ) );
OPT.addOption( new BoolOption ( "add", "false", "weighted adding of images", 'a', &add ) );
......@@ -139,7 +125,7 @@ int main( int argc, char **argv )
OPT.addOption( new FloatOption ("max_bad_to_good", "1.", "max_bad_to_good", 'g', &max_bad_to_good ) );
OPT.addOption( new IntOption ( "blocks", "1", "blocks to save memory", 0, &blocks ) );
OPT.addOption( new BoolOption ("use_replaced", "false", "use_replaced", 0, &use_replaced ) );
OPT.addOption( new BoolOption ( "simple", "false", "account only for fwhm", 0, &simple ) );
OPT.addOption( new BoolOption ( "simple", "false", "account only for fwhm", 0, &simple ) );
}
catch( UException e ) {
cout << "Caught exception : " << e.what() << endl;
......@@ -156,7 +142,7 @@ int main( int argc, char **argv )
cout << copyright;
exit(-1);
}
//////////////////////////////////////////////////////////////////////////
list< string > files = COM.fileArguments();
......@@ -227,9 +213,9 @@ int main( int argc, char **argv )
comp_xpos.makeReference( comp_stars_table.readDoubleColumn(2) );
comp_ypos.makeReference( comp_stars_table.readDoubleColumn(3) );
number_comp_stars = comp_xpos.length(1);
stamp.makeReference( MArray< float, 4 > ( number_files, number_comp_stars, 2 * box + 1, 2 * box + 1 ) );
stamp = 0.;
stamp.makeReference( MArray< float, 4 > ( number_files, number_comp_stars, 2 * box + 1, 2 * box + 1 ) );
estamp.makeReference( MArray< float, 4 > ( number_files, number_comp_stars, 2 * box + 1, 2 * box + 1 ) );
stamp = 0.;
estamp = 0.;
comp_diff.makeReference( MArray< double, 2 >( number_files, number_comp_stars ) ); comp_diff = 0.;
comp_diff_med.makeReference( MArray< double, 1 >( number_files ) ); comp_diff_med = 0.;
......@@ -239,6 +225,8 @@ int main( int argc, char **argv )
total_stars.makeReference( MArray< int, 2 >( number_files, number_files ) ); total_stars = 0;
for ( int actual_file=1; actual_file<=number_files; actual_file++ ) {
cout << name(actual_file) << endl;
/// create number_files x number_comp_stars stamps for comparision
string ename = newname( name( actual_file ), "e." );
FitsIn bild( name( actual_file ), false, false );
FitsIn ebild( ename, false, false );
......@@ -285,6 +273,7 @@ int main( int argc, char **argv )
comp_diff = 0.;
for ( int actual_file2 = 1; actual_file2 <= number_files; actual_file2++ ) {
//int total_N = 0;
// single_nchi enthaelt das nch fuer jeden Vergleichsstern
MArray< double, 1 > single_nchi( number_comp_stars ); single_nchi = 0.;
for ( int actual_comp_star = 1; actual_comp_star <= number_comp_stars; ++actual_comp_star ) {
int N_comp = 0;
......@@ -411,18 +400,25 @@ int main( int argc, char **argv )
p_ebild(j) = new FitsIn( ename , false, false );
}
MArray<float,1> bad_to_good(number_files); bad_to_good=0;
MArray<float,1> bad_to_good(number_files);
bad_to_good=0;
for ( int i = 1; i <= number_files; i++ ) {
cout << endl << name(i) << endl;
MArray< double, 1 > diff_integral ( number_files ); diff_integral = 0.;
MArray< double, 1 > diff_fwhm( number_files ); diff_fwhm = 0.;
MArray< double, 1 > diff_integral ( number_files );
MArray< double, 1 > diff_fwhm( number_files );
diff_integral = 0.;
diff_fwhm = 0.;
MArray< int, 1 > pos( number_files ); // Reihenfolge
// Aehnlichkeitsreihenfolge pos
MArray< int, 1 > pos( number_files );
if ( comp_stars == "" ) { // old method (take PSF information measured by starphot)
////////////////////////////////////////////////////////////////////////////////////
if ( comp_stars == "" ) { // take PSF information measured by starphot
// fuer jedes Bild die anderen Bilder nach uebereinstimmender PSF sortieren:
for ( int j = 1; j <= number_files; j++ ) {
......@@ -465,7 +461,7 @@ int main( int argc, char **argv )
}
diff_integral(j) = integral;
}
diff_fwhm(j) = fabs( fwhm(i) - fwhm(j) );
diff_fwhm(j) = fabs( fwhm(i) - fwhm(j) ); // simple
}
///// sortieren: ---> pos
......@@ -482,7 +478,7 @@ int main( int argc, char **argv )
}
}
if (simple) {
if ( diff_fwhm(pos(k)) < diff_fwhm(pos(j)) ) {
if ( diff_fwhm(pos(k)) < diff_fwhm(pos(j)) ) { // simple
const int buf = pos(j);
pos(j) = pos(k);
pos(k) = buf;
......@@ -528,12 +524,18 @@ int main( int argc, char **argv )
<< " " << name( pos(j) ) << endl;
}
}
else { // new method (compare several PSF reference stars)
////////////////////////////////////////////////////////////////////////////////////
else { // new method (compare several PSF reference stars) (Johannes)
// med_nchi enthaelt Sternvergleiche zwischen i und actual_file
MArray< double, 1 > median_nchi( number_files );
for ( int actual_file = 1; actual_file <= number_files; actual_file++ ) {
pos( actual_file ) = actual_file;
median_nchi( actual_file ) = med_nchi( i, actual_file );
for ( int j = 1; j <= number_files; j++ ) {
pos(j) = j;
median_nchi(j) = med_nchi(i,j);
}
sort2( median_nchi, pos );
......@@ -544,25 +546,28 @@ int main( int argc, char **argv )
<< "# stars"
//<< setw(12) << "# pixels" << setw(15) << "total_nchi"
<< setw(15) << "median_nchi" << setw(12) << "alphaweight" << setw(8) << "image" << endl;
for ( int actual_file = 1; actual_file <= number_files; actual_file++ ) {
if ( total_stars( i, pos( actual_file ) ) > 0. )
cout << setw(7) << actual_file << setw(7) << pos( actual_file )
<< setw(12) << total_stars( i, pos( actual_file ) )
//<< setw(12) << total_pixel( i, pos( actual_file ) )
//<< setw(15) << setprecision(5) << total_nchi( i, pos( actual_file ) )
<< setw(15) << setprecision(5) << median_nchi( actual_file )
<< setw(12) << setprecision(1) << alpha( pos( actual_file ) )
<< " " << name( pos( actual_file ) ) << endl;
else
cout << setw(7) << actual_file << setw(7) << pos( actual_file )
<< setw(12) << total_stars( i, pos( actual_file ) )
//<< setw(12) << total_pixel( i, pos( actual_file ) )
for ( int j = 1; j <= number_files; j++ ) {
if ( total_stars(i,pos(j))>0.) {
cout << setw(7) << j << setw(7) << pos(j)
<< setw(12) << total_stars( i, pos(j) )
//<< setw(12) << total_pixel( i, pos(j) )
//<< setw(15) << setprecision(5) << total_nchi( i, pos(j) )
<< setw(15) << setprecision(5) << median_nchi(j)
<< setw(12) << setprecision(1) << alpha( pos(j) )
<< " " << name( pos(j) ) << endl;
} else {
cout << setw(7) << j << setw(7) << pos(j)
<< setw(12) << total_stars( i, pos(j) )
//<< setw(12) << total_pixel( i, pos(j) )
//<< setw(15) << setprecision(5) << 0.
<< setw(15) << setprecision(5) << 0.
<< setw(12) << setprecision(1) << alpha( pos( actual_file ) )
<< " " << name( pos( actual_file ) ) << endl;
<< setw(12) << setprecision(1) << alpha( pos(j) )
<< " " << name( pos(j) ) << endl;
}
}
}
////////////////////////////////////////////////////////////////////////////////////
if (pos(1)!=i) {
cout << " some psfs are similiar: pos(1)!=i " << endl;
cout << " terminating program!" << endl;
......@@ -574,8 +579,8 @@ int main( int argc, char **argv )
cout << "calculating images... " << endl;
MArray< float, 2 > rmat ( x_size, y_size ); rmat = 0.;
MArray< float, 2 > ermat ( x_size, y_size ); ermat = 0.;
MArray< float, 2 > smat ( x_size, y_size ); smat = 0.;
MArray< float, 2 > esmat ( x_size, y_size ); esmat = 0.;
MArray< short, 2 > wmat ( x_size, y_size ); wmat = 0;
int bx_size=x_size/blocks;
......@@ -591,7 +596,8 @@ int main( int argc, char **argv )
MArray< short, 1 > limits( number_files );
for( int j = 1; j <= number_files; ++j ) {
if (!simple) {
if ( diff_integral(j) < thresh && alpha(j)>min_weight_ratio*alpha(i)) {
if ( (thresh==0. || diff_integral(j)<thresh ) &&
(min_weight_ratio==0. || alpha(j)>min_weight_ratio*alpha(i)) ) {
limits(j) = 1;
}
else {
......@@ -599,7 +605,8 @@ int main( int argc, char **argv )
}
}
if (simple) {
if ( diff_fwhm(j) < thresh && alpha(j)>min_weight_ratio*alpha(i)) {
if ( (thresh==0. || diff_fwhm(j)<thresh ) &&
(min_weight_ratio==0. || alpha(j)>min_weight_ratio*alpha(i)) ) {
limits(j) = 1;
}
else {
......@@ -714,8 +721,8 @@ int main( int argc, char **argv )
if (epixeli>0.) { // Pixel lassen
anzahl(1)++;
rmat( ix,iiy) = pixeli;
ermat(ix,iiy) = epixeli;
smat( ix,iiy) = pixeli;
esmat(ix,iiy) = epixeli;
wmat( ix,iiy) = i;
good(i)++;
}
......@@ -774,8 +781,8 @@ int main( int argc, char **argv )
for ( int j = 2; j <= number_files && zero; j++ ) {
if (ok(pos(j))==1) {
anzahl(j)++;
rmat(ix,iiy) = pixelj( pos(j) );
ermat(ix,iiy) = 3. * epixelj( pos(j) ); // wieseo 3 ???????????????
smat(ix,iiy) = pixelj( pos(j) );
esmat(ix,iiy) = 3. * epixelj( pos(j) ); // wieseo 3 ???????????????
// Fehler verstaerken nur Naeherung!!
wmat(ix,iiy) = pos(j);
//cout << " H1" << endl;
......@@ -785,8 +792,8 @@ int main( int argc, char **argv )
}
if ( zero ) { // immer noch Null
anzahl(0)+=1;
rmat(ix,iiy) = 0.;
ermat(ix,iiy) = 0.;
smat(ix,iiy) = 0.;
esmat(ix,iiy) = 0.;
wmat(ix,iiy) = 0;
//cout << " H2" << endl;
bad(i)++;
......@@ -796,8 +803,8 @@ int main( int argc, char **argv )
else { // saturierte 0/-1 setzen!
anzahl(0)+=1;
rmat(ix,iiy) = 0.;
ermat(ix,iiy) = -1.;
smat(ix,iiy) = 0.;
esmat(ix,iiy) = -1.;
wmat(ix,iiy) = 0;
//cout << " H0" << endl;
bad(i)++;
......@@ -833,21 +840,21 @@ int main( int argc, char **argv )
<< endl;
// Ergebnisbilder Schreiben: werden dann wieder gelesen!!
string rname = newname( name(i),"s" );
string sname = newname( name(i),"s" );
cout << rname << endl;
FitsOut rfits( rname, *p_bild(i) );
rfits.addValueCard( "BAD2GOOD", bad_to_good(i), "bad to good pixel ratio", true );
rfits.addValueCard( "SUBBY_NR", i, "internal numbering for subby", true );
rfits << rmat;
cout << sname << endl;
FitsOut sfits( sname, *p_bild(i) );
sfits.addValueCard( "BAD2GOOD", bad_to_good(i), "bad to good pixel ratio", true );
sfits.addValueCard( "SUBBY_NR", i, "internal numbering for subby", true );
sfits << smat;
string ername = newname( name(i), "e.s" );
cout << ername << endl;
FitsOut erfits( ername, *p_ebild(i) );
erfits.addValueCard( "SUBBY_NR", i, "internal numbering for subby", true );
erfits << ermat;
string esname = newname( name(i), "e.s" );
cout << esname << endl;
FitsOut esfits( esname, *p_ebild(i) );
esfits.addValueCard( "SUBBY_NR", i, "internal numbering for subby", true );
esfits << esmat;
// ms-Bild schreiben:
// w-Bild schreiben:
string wname = newname( name(i), "w.s" );
cout << wname << endl;
FitsOut wfits( wname, *p_bild(i) );
......
/* -*- C++ -*-
*
* --------------------------------------------------------------------------
* usmlib.cpp, 2013/06/25
* usmlib.cpp, 2013/08/27
* --------------------------------------------------------------------------
*
* Copyright (C) 2003-2013 Johannes Koppenhoefer <koppenh@mpe.mpg.de>
......@@ -1007,7 +1007,7 @@ void Lightcurve::simulate_noise( MArray< double, 1 > observations, MArray< doubl
}
}