cdfp_filter.sh
Updated: Apr14,2020

Filter a cdfp file using one quantity.

 

% cdfp_filter.sh --help 

Usage: cdfp_filter.sh filename.cdfp V 10.0 14.0 
arg1 - name of input cdfp file 1
arg2 - name of filter quantity
arg3 - minimum value 
arg4 - maximum value 

% cdfp_filter.sh 20191022T025524.2_acm_sci.cdfp NumPix 20 10000 > new.cdfp   

The example above shows how I use this routine in photom2_prep to filter the inital catalog of detections for an image. In may initial moments-based catalogs we may have many detections that have a small number of pixels. For computting aperture photometry I may may want to exclude sources with small NumPix values. Here is an example of using this:

 

% linecnt 20191022T025524.2_acm_sci.cdfp 
 360
% cdfp_filter.sh 20191022T025524.2_acm_sci.cdfp NumPix 20 10000 > new.cdfp  
% linecnt new.cdfp 
 49

Hence, by excluding all sources with fewer than 20 pixels, I reduce the number of sources in the cdfp file from 459 (20191022T025524.2_acm_sci.cdfp) to 48 (new.cdfp). Had there been any source with more than 10000 pixels, they would have been excluded also.




Back to scocodes page