Commit ae09a3d4782d06e00df6497b62b7a57f75275a13

Authored by Simon Bonnefoy
Committed by Jürgen Knödlseder
1 parent d30392d5

small changes in the ctfindvar.cpp (#2713)

Showing 1 changed file with 12 additions and 7 deletions
src/ctfindvar/ctfindvar.cpp
... ... @@ -264,8 +264,8 @@ void ctfindvar::run(void)
264 264 m_pixsigsrc = GNdarray(1, nbins); //TODO: Update this to allow for multiple sources in 1st dimension
265 265  
266 266 // creating GSkyDir to get the position of the source and each pixels
267   - GSkyDir srcSkyDir;
268 267  
  268 + GSkyDir srcSkyDir;
269 269 if ((*this)["coordsys"].string()=="CEL")
270 270 {
271 271 srcSkyDir.radec_deg((*this)["xsrc"].real(),(*this)["ysrc"].real());
... ... @@ -274,6 +274,7 @@ void ctfindvar::run(void)
274 274 {
275 275 srcSkyDir.lb_deg((*this)["xsrc"].real(),(*this)["ysrc"].real());
276 276 }
  277 +
277 278 //Getting the index of pixel on which falls the source of interest
278 279 int srcInxPix = m_counts.dir2inx(srcSkyDir);
279 280  
... ... @@ -285,18 +286,20 @@ void ctfindvar::run(void)
285 286 for (int pix_number=0; pix_number<m_counts.npix(); pix_number++)
286 287 {
287 288 double total_counts=0;
288   - for (int i=0;i<m_counts.nmaps();i++)
  289 + for (int k=0;k<m_counts.nmaps();k++)
289 290 {
290   - total_counts += m_counts(pix_number, i);
  291 + total_counts += m_counts(pix_number, k);
291 292 }
292 293 if(pix_number%20==0)
293 294 {
294   - std::cout << "checking pixel number " << pix_number << std::endl;
295   - std::cout << "number of counts in pixel" << total_counts<< std::endl;
  295 + std::cout << "checking pixel number " << pix_number << " with total number of counts of: " << total_counts << std::endl;
296 296 }
297 297  
  298 + //Getting the variability significance for the pixel
298 299 get_variability_sig(pix_number,nbins, pixSig);
299   - if (srcInxPix == pix_number) //Getting the significance evolution for the source
  300 +
  301 + //Getting the significance evolution for the source
  302 + if (srcInxPix == pix_number)
300 303 {
301 304 for (int i=0; i<nbins; i++) {
302 305 m_pixsigsrc(0,i) = pixSig(i);
... ... @@ -304,6 +307,8 @@ void ctfindvar::run(void)
304 307 #ifdef G_DEBUG
305 308 std::cout << "checking pixel number of the source of interest" << pix_number << std::endl;
306 309 std::cout << "number of counts in pixel of the source of interest" << total_counts << std::endl;
  310 + pixSigSrc=pixSig;
  311 + std::cout << "checking pixel number " << pix_number << " with total number of counts of: " << total_counts << std::endl;
307 312 std::cin.ignore();
308 313 #endif
309 314 }
... ... @@ -906,4 +911,4 @@ void ctfindvar::write_srchist_fits(const GNdarray&amp; time_info,
906 911 GFits fitsfile;
907 912 fitsfile.append(table);
908 913 fitsfile.saveto(outfile, (*this)["clobber"].boolean() );
909   -}
910 914 \ No newline at end of file
  915 +}
... ...