// Pour boucher les trous d'une sphere HEALPIX en utilisant // une autre sphere HEALPIX // cmv 13/6/01 // extrap2sph -w sph143k05_e.fits sph143k05.fits sphred.fits sphout_2.fits // extrap2sph -m -1.e-30 -M +1.e-30 sph143k05.fits sphred.fits sphout_22.fits #include "sopnamsp.h" #include "machdefs.h" #include #include #include #include #include #include "skymapinit.h" #include "skymap.h" #include "fitsspherehealpix.h" /*! \ingroup PrgMap \file extrap2sph.cc \brief \b extrap2sph: Fill holes in a sphere of datas by using an other sphere of datas. A mask to define the place to be tested in the sphere might be given. \verbatim csh> extrap2sph -h extrap2sph [-m valmin -M valmax -r rvalmin -R rvalmax] [-w sphinw.fits] sphin.fits sphred.fits sphout.fits -w sphinw.fits : input sphere weight, if sphinw_value<=0. (def=NULL) if sphinw_value<=0. pixel has not to be filled -m minval : min value to identify EMPTY pixel of sphin (def=no_test) -M maxval : max value to identify EMPTY pixel of sphin (def=no_test) condition for EMPTY pixel is (minval<=val<=maxval) -n : negate the previous condition, condition for EMPTY pixel becomes: (val=narg) {usage(); exit(1);} char * fsphin = arg[optind]; char * fsphred = arg[optind+1]; char * fsphout = arg[optind+2]; cout<<"Input Sphere : "< sphin; {FitsInFile sfits(fsphin); sfits >> sphin;} int nlat = sphin.SizeIndex(); cout<<"Opening Input Sphere :"< sphinw; if(fsphinw) { FitsInFile sfits(fsphinw); sfits >> sphinw; cout<<"Opening Input Weight Sphere :"< sphred; {FitsInFile sfits(fsphred); sfits >> sphred;} cout<<"Opening Input Reducted Sphere :"<valmax)) skp = !neg; if(skp) continue; // Do nothing double theta,phi; sphin.PixThetaPhi(i,theta,phi); int_4 ir = sphred.PixIndexSph(theta,phi); // Test if pixel of Reducted Sphere is good skp = (rtstmin || rtstmax) ? rneg : false; if((rtstmin && sphred(i)rvalmax)) skp = !rneg; if(skp) continue; // Do nothing sphin(i) = sphred(ir); n++; if(sphred(ir)!=0.) n0++; } cout<<" Number of pixels filled " <