Welcome to iraf.net Monday, May 13 2024 @ 06:09 AM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 Calling CCDPROC from a procedure script
   
bpohl
 06/20/2006 09:30PM (Read 3231 times)  
+----
Newbie

Status: offline


Registered: 06/20/2006
Posts: 6
Greetings and apologies if this question has already been asked and answered.
i'm trying to write a procedure script to automate some basic CCD processing tasks. I call ccdproc from within the script, but it seems to get confused when I sepcify the zero parameter. for example, ccdproc ("@darklist", output="@bcdarklist", ccdtype="", fixpix-, \
overscan-, trim-, zerocor+, darkcor-, flatcor-, \
zero="ZERO-foobar.fits")produces the following error messageERROR on line 101: ambiguous parameter `zero' within `<searchpath>'this only occurs in a procedure script. cutting and pasting this line onto the command line works fine. it also works from a cl scripts. also, although i haven't verified this, i suspect setting the dark and flat parameters will produce the same error message. thanks for your help,bri.

 
Profile Email Website
 Quote
fitz
 06/20/2006 09:30PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Without seeing the entire script it is hard to give a specific answer. Sometimes unlearning the task and/or package (CCDPROC and CCDRED in this case) will fix it but sometimes there really is an ambiguity in the parameters. The <searchpath> for CL scripts is first in the task, then the package, then the general CL environment for a parameter, keep in mind that abbreviations are permitted.A common mysterious workaround to get rid of the message is to simply define a script variable of the same name, if that or unlearning doesn't help (and the script isn't too long) please post the script.Cheers,
-Mike

 
Profile Email
 Quote
bpohl
 06/20/2006 09:30PM  
+----
Newbie

Status: offline


Registered: 06/20/2006
Posts: 6
Mike, adding a dummy variable called 'zero', as you suggested, made the error go away. Here's the script anyway, the zero variable declaration line is commented out in order to duplicate the error message.hope this helps.
# DARKPROC - A script for processing PROMPT dark images. Prompt bias and dark
# images are all stored in the same job, so after downloading they should all
# be in the same directory.
#
# Usage: The input is a list of the dark and bias files. The bias images
# are identified and combined. The combined bias is subtracted from the
# remaining darks. The darks are then combined according to exposure time.
# prompt darks are taken at the following exposure times, each exposure should
# have a set of 20 darks.
#
# 2.5 5.0 10 20 40 80 160 seconds.



procedure darkproc (input, fileroot)

string input {prompt="List of input images "}
string fileroot {prompt="Root name of output files "}
bool clean {yes,prompt="Delete temporary files? "}

begin

# Parameter declarations
string Input
string Fileroot
bool Clean

# other declarations
string mainlist
string zerolist
string darklist
string bcdarklist
string infile
real exptime
# int zero

# output filenames
string zerofile
string darkfile

# get parameters
Input = input
Fileroot = fileroot
Clean = clean

mainlist = "mainlist"
zerolist = "zerolist"
darklist = "darklist"
bcdarklist = "bcdarklist"

if (access (mainlist)) {
delete (mainlist)
}

if (access (zerolist)) {
delete (zerolist)
}

if (access (darklist)) {
delete (darklist)
}

if (access (bcdarklist)) {
delete (bcdarklist)
}



# get exposure times from the images
hselect ("@"//input, "$I,EXPTIME", yes, > mainlist)

list = mainlist

# sort images into lists of bias (zero) frames and dark images
while (fscan (list, infile, exptime) != EOF) {

if (exptime == 0.0) {
print (infile, >> zerolist)
} else if (exptime > 0.0) {
print (infile, >> darklist)
}

}

list = ""


zerofile = "ZERO-"//Fileroot//".fits"

if (access (zerofile)) {
imdelete (zerofile)
}

print ("Creating master bias image "//zerofile)

# Combine the bias frames into the master zero image
zerocombine ("@"//zerolist, output=zerofile, combine="average", \
ccdtype="", rdnoise="0.0", gain="1.0")

# Subtract the bias from the darks.
sed ("s/^/BC_/", darklist, >> bcdarklist)

print ("Bias subtracting the darks... ")
ccdproc ("@"//darklist, output="@"//bcdarklist, ccdtype="", fixpix-, \
overscan-, trim-, zerocor+, darkcor-, flatcor-, \
zero=zerofile)

if (Clean) {

delete (mainlist)
delete (zerolist)
delete (darklist)
# imdelete ("@"//bcdarklist)
delete (bcdarklist)

}

end

 
Profile Email Website
 Quote
   
Content generated in: 0.11 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login