Status: offline
Registered: 06/07/2006
Posts: 95
|
Hi all.I wrote this script using examples of scripts from "An itroductory guide to iraf scripts". It "should" work, but I have a problem?[code:1:bf74ce3cda]# Allphot script for batch psf photometry, using daophot.procedure allphot (images, master_coo, master_pst)string images {prompt="Images to be used"}
string master_coo {prompt="The master.coo file containing the stars' coordinates"}
string master_pst {prompt="The master.pst file containing the PSF template stars"}
struct *imglistbegin
int i
string img, imgfile, coord, pststar, magfile, psffile, psgroup, imgpst
# Make sure the necessary packages are loaded
if (! defpac ("digiphot") || ! defpac("daophot"))
bye
# Expand the image template into a text file list
imgfile = mktemp ("tmp$apt")
sections (images, option="fullname", > imgfile)
# Get the rest of the parameters
coord = master_coo
pststar = master_pst
imglist = imgfile
while (fscan (imglist, img) != EOF) {
# Get rid of the ".imh" extention
i = strlen (img)
if (substr (img, i-4, i) == ".fits")
img = substr (img, 1, i-5)
# Make up the output files' names. These files will
# appear in the same directory as the images!
magfile = img // ".mag"
psffile = img // ".psf.fits"
psgroup = img // ".psg"
imgpst = img // ".pst"
# Do the photometry
if (access (img // ".fits")) {
phot (img, coord, >> magfile)
}
# Do the psf fitting
if (access (img // ".fits") || access (img // ".mag")) {
psf (img, magfile, pststar, >> psffile, >> imgpst, >> psgroup,
interactive = no, showplots = no)
#}
}
# Clean up
delete (imgfile, ver-, >& "dev$null")end[/code:1:bf74ce3cda]When a call phot and psf outside (i.e. indep.) All work as it should. When I write a small script nl:
[code:1:bf74ce3cda]string img="Star001V.fits"
string coord="master.coo"
string magfile="Star001V.mag"
if (access (img // ".fits")) {
phot (img, coord, >> magfile)
}
[/code:1:bf74ce3cda]
It works! And fast.But when I call allphot, with just one star as input (do photometry, psf on one star, which should be fast), it seems as if the PC hangs. I.E. nothing happens.I do not know if it is the code that is to "bulky" (shouldn't be), or if there are to many/few parameters. Or my PC that is to slow.Please HELP!Regards
PatP.S. If the script works properly, please feel free to use it if you want.
|
Status: offline
Registered: 06/07/2006
Posts: 95
|
The comment char was just a typing error. The problem was with the redirection to the output-files. Used 'default'. Now it works, to a degree.I now sit with the problem that it asks me for confirmation on some of the parameters for every single image. When you run through a star list of 60 images, it gets ...Q! How can i set up parameter textfiles, (datapars,centerpars,skypars, enc) so that it calls the files, and run through the script ONETIME, with the only time that I have to CR is at the beginning to run the procedure, If you understand what I mean.ThanX for the help.Regards
Pat
|
Status: offline
Registered: 06/07/2006
Posts: 95
|
Hi allThe prereduction scripts now work. See "photometry prereduction script"The problem is that now I wanted to test the pipeline and see what results the (WORKING) batch photometry scripts give me. At least they worked last time I used them.Now all of a sudden the script has a error. When I check the strlen, to remove the .imh or .fit extendtion it gives me the wrong value. I have checked it again and again, and somehow it gives me a value that is 6 less than the strlen. I.e strlen should be 14, gives 8, or 15 give 9, enc.I build the script under iraf 2.12.2a, am now using 2.13.Hope u understand my QThanx
Pat
|