Hi Dave,
The Star object, which is defined in the standard pjsr/StarDetector.jsh file, only provides pos, flux and size properties. Here is an excerpt of code starting in line #104 of StarDetector.jsh:
function Star( pos, flux, size )
{
// Centroid position in pixels, image coordinates.
this.pos = new Point( pos.x, pos.y );
// Total flux, normalized intensity units.
this.flux = flux;
// Area of detected star structure in square pixels.
this.size = size;
}
The local background estimate for each star is not stored in Star objects, although it is computed in the StarDetector.starParameters() method. You can modify StarDetector.jsh very easily to include local background estimates in Star objects. Replace the Star object constructor as follows from line #104:
function Star( pos, flux, size, bkg )
{
// Centroid position in pixels, image coordinates.
this.pos = new Point( pos.x, pos.y );
// Total flux, normalized intensity units.
this.flux = flux;
// Area of detected star structure in square pixels.
this.size = size;
// Local background estimate.
this.bkg = bkg;
}
Then replace line #578:
S.push( new Star( p.pos, p.flux, p.size ) );
as follows:
S.push( new Star( p.pos, p.flux, p.size, p.bkg ) );
Now you get an array of Star objects with background estimates returned by the StarDetector.stars() method. Let me know if this helps.