/** * ApPhot extends the StarField class to do simple Aperture Photometry. * It uses an algorithm for peak merging appropriate for uncrowded star fields. * Glen Cowan, RHUL Physics Department * November 2004 */ import java.util.*; import java.math.*; import java.io.*; public class ApPhot extends StarField { // private data fields private Vector starVec; private Vector apVec; private Vector bckApVec; private double starThreshold; // constructors public ApPhot(){ super(); starVec = new Vector(); apVec = new Vector(); bckApVec = new Vector(); starThreshold = 0; } public ApPhot(int nx, int ny){ super(nx, ny); starVec = new Vector(); apVec = new Vector(); bckApVec = new Vector(); starThreshold = 0; } public ApPhot(double starThreshold){ super(); starVec = new Vector(); apVec = new Vector(); bckApVec = new Vector(); this.starThreshold = starThreshold; } public ApPhot(int nx, int ny, double starThreshold){ super(nx, ny); starVec = new Vector(); apVec = new Vector(); bckApVec = new Vector(); this.starThreshold = starThreshold; } // public methods public Vector getStarVec(){ return starVec; } public void setStarVec(Vector starVec){ this.starVec = starVec; } public Vector getApVec(){ return apVec; } public void setApVec(Vector apVec){ this.apVec = apVec; } public Vector getBckApVec(){ return bckApVec; } public void setBckApVec(Vector bckApVec){ this.bckApVec = bckApVec; } // fillStarVec puts the stars into order and inserts them into starVec public void fillStarVec(){ int numClus = clusterVec.size(); Star[] starArray = new Star[numClus]; for (int i=0; i= starThreshold ) { starVec.addElement( starArray[i] ); } } System.out.println ("starVec i, x, y, val..."); for (int i=0; i epsilon ) { outsideRInner = distSquared >= rInner*rInner; } boolean inAp = outsideRInner && insideROuter; return inAp; } boolean inOuterAperture(Pixel p){ double xAp = this.getX(); double yAp = this.getY(); double rOuter = this.getROuter(); double xPix = (double)p.getI(); double yPix = (double)p.getJ(); double distSquared = (xAp-xPix)*(xAp-xPix) + (yAp-yPix)*(yAp-yPix); boolean inAp = distSquared <= rOuter*rOuter; return inAp; } } // end of class Aperture