#include #include //#include #include using namespace std; void printDetails(int num,Detection &obj); DetectionList *search3D(Cube &cube, Param &par) { DetectionList *objectList = new DetectionList; int count=0; long size = cube.getSize(); float *arr = new float[size]; float *newarr = new float[size]; int goodSize=0; float blankPixValue = par.getBlankPixVal(); bool flagFDR = par.getFlagFDR(); for(int i=0;i0){ findMedianStats(arr,goodSize,mean,sigma); cube.getArray(arr); long xdim = cube.getDimX(); long ydim = cube.getDimY(); long zdim = cube.getDimZ(); cerr<"; cerr<=par.getMinMW()) && (channel<=par.getMaxMW()); // ignore the Milky Way. if(!skipThisOne){ Image *slice = new Image(dim); for(long j=0;jsetPixValue( j, newarr[j+channel*xdim*ydim]); float *temparr = new float[xdim*ydim]; int ct=0; for(int i=0;isetStats(mean,sigma,par.getCut()); if(flagFDR) setupFDR(*slice,par); lutz_detect(*slice,par); for(int i=0;igetNumObj();i++){ count++; Detection *obj = new Detection; *obj = slice->getObject(i); for(int j=0;jgetSize();j++) obj->setZ(j,channel); obj->calcParams(); objectList->addObject(*obj); printDetails(count,*obj); delete obj; } for(int i=0;igetSize();i++) cube.setDetectMapValue(i,cube.getDetectMapValue(i) + slice->getMaskValue(i)); delete slice; } } /* Search in velocity */ cerr<setPixValue( zpos, newarr[npixel+zpos*xdim*ydim] ); float *temparr = new float[zdim]; int ct=0; for(int i=0;isetStats(mean,sigma,par.getCut()); if(flagFDR) setupFDR(*spectrum,par); lutz_detect(*spectrum,par); for(int i=0;igetNumObj();i++){ count++; Detection *obj = new Detection; *obj = spectrum->getObject(i); for(int j=0;jgetSize();j++){ obj->setZ(j,obj->getX(j)); obj->setX(j,npixel%xdim); obj->setY(j,npixel/xdim); } obj->calcParams(); objectList->addObject(*obj); printDetails(count,*obj); delete obj; } for(int i=0;igetSize();i++) cube.setDetectMapValue(npixel,cube.getDetectMapValue(npixel)+spectrum->getMaskValue(i)); delete spectrum; } } delete [] arr; delete [] newarr; cerr<<"Found "<