Changeset 193 in Sophya for trunk/SophyaPI
- Timestamp:
- Jan 20, 1999, 2:54:14 PM (27 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/piacmd.cc
r189 r193 881 881 //| : la = "a" niveau de print 882 882 //| : c = la surface pour la photometrie est un carre (defaut=cercle) 883 //| : C = recentrage du pave sur le pixel le + brillant (defaut=non) 883 884 //| tokens[2] = options graphiques 884 885 //| Return: 0 si Ok, <0 sinon. … … 888 889 int typ_fond=1, rmin=0, rmax, npt_gliss=4, lp=0; 889 890 float fondimpos=0., fondbord=0., fondautre; 890 bool cercle = true;891 bool cercle=true, centre=false; 891 892 string opt=""; 892 893 string dummy; string dum; … … 910 911 if(dum.length()>2) sscanf(dum.c_str(),",l%d",&lp); 911 912 } 912 if(strstr(dummy.c_str(),",c")) { 913 cercle = false; 914 } 913 if(strstr(dummy.c_str(),",c")) cercle = false; 914 if(strstr(dummy.c_str(),",C")) centre = true; 915 915 } 916 916 … … 953 953 if(rmin>=rmax) 954 954 {cout<<"rayon mini="<<rmin<<">= rmax="<<rmax<<endl; return(-11);} 955 if(centre) { // Recentrage autour du pixel le + brillant? 956 int xcnew=-1, ycnew=-1; float pxnew=-1.e20,pxold=-1.e20,px; 957 for(int j=yc-rmax;j<=yc+rmax;j++) { 958 if(j<0 || j>=img->YSize()) continue; 959 for(int i=xc-rmax;i<=xc+rmax;i++) { 960 if(i<0 || i>=img->XSize()) continue; 961 px = (*img)(i,j); 962 if(i==xc && j==yc) pxold = px; 963 if((xcnew==-1 && ycnew==-1) || px>=pxnew) {xcnew=i; ycnew=j; pxnew=px;} 964 // cout<<"xcnew,ycnew,pxnew="<<xcnew<<" "<<ycnew<<" "<<pxnew<<endl; 965 } } 966 if(lp>1) cout<<"Re-centrage(x,y,px): old=("<<xc<<","<<yc<<","<<pxold<<")" 967 <<" -> new=("<<xcnew<<","<<ycnew<<","<<pxnew<<")"<<endl; 968 if(xcnew!=-1 && ycnew!=-1 && pxnew>pxold) {xc=xcnew; yc=ycnew;} 969 } 955 970 int x0=xc-rmax, y0=yc-rmax, x1=xc+rmax, y1=yc+rmax; 956 971 if(x0<0||y0<0||x1>=img->XSize()||y1>=img->YSize()) … … 964 979 if(lp>1) 965 980 cout<<"photom_ouv[cercle="<<cercle<<",typ="<<typ_fond<<"]: pav[" 966 <<dx<<","<<dy<<" ("<<dxym967 <<"] xc,yc= "<<xc<<","<<yc<<"] ic,jc="<<ic<<","<<jc<<endl968 <<" ](fond="<<fondimpos<<") pxmil="<<(*pav)(ic,ic)981 <<dx<<","<<dy<<","<<dxym 982 <<"] xc,yc=["<<xc<<","<<yc<<"] ic,jc="<<ic<<","<<jc<<endl 983 <<" (fond="<<fondimpos<<") pxmil="<<(*pav)(ic,ic) 969 984 <<" -> Rph de "<<rmin<<" a "<<rmax<<endl; 970 985
Note:
See TracChangeset
for help on using the changeset viewer.