Astronomy and programming question: How should I use bash 'grep' command?

ciara

New member
I am writing a data pipeline program for astrometry and photometry, using SExtractor and solve-field. If there is a reasonable number of stars in the field, I would like to continue the program. If not, I would like to abort. I am trying to set the value of the number of stars found by SExtractor as the variable 'nstars'. This is what the lines in the program say:

let nstars="sex ${datastore}/${frame}.fit -c ./default.sex -catalog_name ${frame}.phot | tee -a ${frame}.summary | grep "sextracted" "

echo "${nstars} stars found in frame"

The program executes SExtractor and outputs all of the extracted data to the terminal.
It then echoes: " stars found in frame".

Please help make this work!!
 
Forget the astronomy. Just go for the sex tractor. That sounds like it could be a fun ride!!

(sorry, couldn't resist)

You might want to try breaking that down into several steps.
Instead of piping the sex output into grep, pipe it to a file, and then grep the file.

(is the output it's writing pre-grep or post-grep?, pre or post tee?
 
Forget the astronomy. Just go for the sex tractor. That sounds like it could be a fun ride!!

(sorry, couldn't resist)

You might want to try breaking that down into several steps.
Instead of piping the sex output into grep, pipe it to a file, and then grep the file.

(is the output it's writing pre-grep or post-grep?, pre or post tee?
 
Back
Top