Changeset 189 in Sophya for trunk/SophyaPI/PIext


Ignore:
Timestamp:
Jan 18, 1999, 7:33:42 PM (27 years ago)
Author:
ercodmgr
Message:

photom circ. dans photom_ouv (cmv 18/1/99)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/piacmd.cc

    r186 r189  
    575575else if (kw == "aper" ) {
    576576  if (tokens.size() < 1) {
    577     cout << "PIACmd::Do() Usage: aper fond_typ [options_calcul]" << endl;
     577    cout << "PIACmd::Do() Usage: aper fond_typ [opt_calcul opt_disp]" << endl;
    578578    return(0);
    579579    }
     
    876876//|   : faa.bbb = fond fixe a aa.bbb
    877877//|   defaut : "b"
    878 //| tokens[1] = options pour le fit ex: l1.0
     878//| tokens[1] = options pour le fit ex: l1
    879879//|      : ra = "a" rayon minimal de scan (def=0)
    880880//|      : ga = "a" taille de la fenetre glissante pour les extrapolations (def=4)
    881881//|      : la = "a" niveau de print
     882//|      : c  = la surface pour la photometrie est un carre (defaut=cercle)
    882883//| tokens[2] = options graphiques
    883884//| Return: 0 si Ok, <0 sinon.
     
    887888int typ_fond=1, rmin=0, rmax, npt_gliss=4, lp=0;
    888889float fondimpos=0., fondbord=0., fondautre;
     890bool cercle = true;
    889891string opt="";
    890892string dummy; string dum;
     
    896898    size_t p = dummy.find(",r"); size_t q = dummy.find_first_of(',',p+1);
    897899    dum = dummy.substr(p,q-p);
    898     if(dum.length()>2) sscanf(dum.c_str(),",r%d",&lp);
     900    if(dum.length()>2) sscanf(dum.c_str(),",r%d",&rmin);
    899901  }
    900902  if(strstr(dummy.c_str(),",g")) {
     
    907909    dum = dummy.substr(p,q-p);
    908910    if(dum.length()>2) sscanf(dum.c_str(),",l%d",&lp);
     911  }
     912  if(strstr(dummy.c_str(),",c")) {
     913    cercle = false;
    909914  }
    910915}
     
    958963// Print
    959964if(lp>1)
    960   cout<<"photom_ouv[typ="<<typ_fond<<"]: pav["<<dx<<","<<dy<<" ("<<dxym
     965  cout<<"photom_ouv[cercle="<<cercle<<",typ="<<typ_fond<<"]: pav["
     966      <<dx<<","<<dy<<" ("<<dxym
    961967      <<"] xc,yc="<<xc<<","<<yc<<"] ic,jc="<<ic<<","<<jc<<endl
    962968      <<"] (fond="<<fondimpos<<") pxmil="<<(*pav)(ic,ic)
     
    985991  double sum=0.; int ns=0, nf=0;
    986992  for(int i=0;i<dxym;i++) for(int j=0;j<dxym;j++) {
    987     if(ic-r<=i && i<=ic+r && jc-r<=j && j<=jc+r ) {sum += (*pav)(i,j); ns++;}
     993    double ray2 = (i-ic)*(i-ic)+(j-jc)*(j-jc)-0.1;
     994    if( (cercle && ray2<=r*r) ||
     995        (!cercle && ic-r<=i && i<=ic+r && jc-r<=j && j<=jc+r) )
     996          {sum += (*pav)(i,j); ns++;}
    988997    else {p[nf] = (*pav)(i,j); nf++;}
    989998  }
Note: See TracChangeset for help on using the changeset viewer.