Pass input source table through selection expression; if (usecorr) { ra = readColumn(RA_CORR); dec = readColumn(DEC_CORR); } else { ra = readColumn(RA); dec = readColumn(DEC); } Convert ra, dec to pixel coordinates xima and yima; # Calculate radii: foreach i (1 .. numOfRows(sourceTable)) { protoRadius(i) = evaluateRadiusExpression(); } protoMedian = medianValue(protoRadius); scaledMedian = (protoMedian - minval(protoRadius)) / (maxval(protoRadius) - minval(protoRadius)); sag = (scaledMedian - radiusbias) / (radiusbias * (2 * scaledMedian - 1) - scaledMedian); foreach i (1 .. numOfRows(sourceTable)) { scaledRadius(i) = (protoRadius(i) - minval(protoRadius)) / (maxval(protoRadius) - minval(protoRadius)); radius(i) = scaledRadius(i) * (1 + sag) / (1 + sag * (2 * scaledRadius(i) - 1)); } # Sort the sources: foreach i (1 .. numOfRows(sourceTable)) { index(i) = i } Sort index in the style requested by --ncutsortstyle; if (--ncutsortstyle eq 'none') { numLastSource = numOfRows(sourceTable); } else { numLastSource = min(numOfRows(sourceTable), --ncut); } # Allocate source labels; # Output: foreach i (1 .. numLastSource) { writeOutputCircle(xima(index(i)), yima(index(i)), radius(index(i))); }