Submit a Story  :  IRAF Links  :  Past Polls  :  Calendar  :  Advanced Search  
     iraf.net
FAQ
 Forum FAQForum FAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange problems with cl script/parameter file

 
Post new topic   Reply to topic    iraf.net Forum Index -> IRAFNet
View previous topic :: View next topic  
Author Message
btingley



Joined: 28 Jul 2008
Posts: 5

PostPosted: Mon Jul 28, 2008 1:51 pm    Post subject: Strange problems with cl script/parameter file Reply with quote

Hi Everyone,

I've been beating my head against this problem for a couple of days now, without being able to solve it myself. Maybe someone here can point me in the right direction.

I am attempting to run a cl script that someone gave me. It works for them and it works for them when they log into the same machine I am using. When I try to run the cl script (imal2.cl) myself WITHOUT a pre-existing .par file, I get the following message:

cl> imal2
ERROR: Required parameter `reference' not defined.

When I use the .par file from the person who gave me the script, I get the following message instead:

cl> imal2
unmatched quotes in prompt field for `images'
unmatched quotes in prompt field for `coords'
unmatched quotes in prompt field for `reference'
unmatched quotes in prompt field for `shifts'
unmatched quotes in prompt field for `copyorg'
'ust specify at least name,type,mode for `
unmatched quotes in prompt field for `shiftimages'
unmatched quotes in prompt field for `verbose'
'ust specify at least name,type,mode for `
unmatched quotes in prompt field for `boxsize'
unmatched quotes in prompt field for `bigbox'
'ust specify at least name,type,mode for `
unmatched quotes in prompt field for `negative'
unmatched quotes in prompt field for `autoback'
unmatched quotes in prompt field for `background'
unmatched quotes in prompt field for `lower'
unmatched quotes in prompt field for `upper'
unmatched quotes in prompt field for `niterate'
unmatched quotes in prompt field for `tolerance'
'ust specify at least name,type,mode for `
'ad mode spec `\r' in `h
in `tmplist'
'ad mode spec `\r' in `h
in `imglist'
ERROR: cannot read parameter file `scripts$imal2.par'

When I look at the parameter file, all of the parameters are enclosed by " ". However, judging from the error messages, IRAF is apparently looking for parameters to be enclosed by ` '. Does anyone know why this would happen?

Cheers,

Brandon Tingley
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3257
Location: Tucson

PostPosted: Mon Jul 28, 2008 4:58 pm    Post subject: Reply with quote

It is hard to comment without seeing either the script or the parameter file, could you please post these?

If your uparm directory has a corrupted version of the parameters then you could try unlearning the task to start fresh, this might explain why you're having problems but your friend isn't.

-Mike
Back to top
View user's profile Send private message
btingley



Joined: 28 Jul 2008
Posts: 5

PostPosted: Tue Jul 29, 2008 8:44 am    Post subject: Reply with quote

OK, I'll post them.

First the script:

procedure imal2 (images, coords, reference)

begin
bool shifts_found = no

string l_images, l_coords, l_reference
string workimage
string imgfile, imcefile,modefile, shiftfile, trimsect, tmp, junk
string ajunk,bjunk,cjunk
int n
real xshift, yshift
struct line
print("A")

imgfile = mktemp ("tmp$iag_tmp.")


l_images = images
l_reference = reference
l_coords = coords
print("B")

sections (l_images, option="fullname", > imgfile)
imglist = imgfile
while (fscan (imglist,workimage) != EOF) {
imcefile = mktemp ("tmp$iac_tmp.")
shiftfile = mktemp ("tmp$ias_tmp.")
#don't shift previous shifted frames
print("C")
imgets(workimage,"IMSHIFT", >& "dev$null")
if (imgets.value != '0') {
print(workimage," already shifted by ",imgets.value)
goto endloop
}

if (autoback) {
modefile = mktemp ("tmp$iam_tmp.")
imstat.fields = "mode"
imstat.format = no
imstat(workimage,>& modefile)

tmplist = modefile
while(fscan(tmplist,background) == 1) {
print("\n",workimage," background set to ",background)

}
delete (modefile, ver-, >& "dev$null")

}

print("D")

imcentroid (workimage, coords=l_coords, reference=l_reference,
shifts=shifts,
boxsize=boxsize, bigbox=bigbox, negative=negative,
background=background, lower=lower, upper=upper,
niterate=niterate, tolerance=tolerance, verbose=verbose, >& imcefile
)

if (verbose)
type (imcefile)

# read the shifts
shifts_found = no
tmplist = imcefile
while (fscan (tmplist, line) != EOF) {
if (substr(line,1,7) == '#Shifts') {
shifts_found = yes
break
}
}

if (shifts_found) {}
else{
print(workimage," no shift was calculated !")
print("Continue with next frame? (yes/no)")
n=scan(tmp)
if(stridx('yY',tmp) == 0) error (1, "aborted on request")
}


if (! shiftimages)
goto endloop


if (shifts_found) {
while (fscan (tmplist, junk, xshift, junk, yshift, junk) == 5){
print (xshift, " ", yshift, >& shiftfile)
}


if (copyorg) {
print("copying original image")
imcopy(workimage,"org_"//workimage,verbose=yes)
}

print(workimage," being shifted by ",str(xshift)//" "//str(yshift))

imshift (workimage, workimage, shifts_file=shiftfile,
interp_type="nearest", boundary_type="nearest",
constant=0)

hedit(workimage,"IMSHIFT",str(xshift)//" "//str(yshift),add=yes,delete=n
o,verify=no,update=yes,show=no)
}

tmplist = ""

endloop:
delete (imcefile, ver-, >& "dev$null")
delete (shiftfile, ver-, >& "dev$null")


}

imglist = ""
delete (imgfile, ver-, >& "dev$null")

end
Back to top
View user's profile Send private message
btingley



Joined: 28 Jul 2008
Posts: 5

PostPosted: Tue Jul 29, 2008 9:55 am    Post subject: Reply with quote

...and the parameters file:

images,s,a,,,,"List of images"
coords,s,a,,,,"Coordinate file"
reference,s,a,,,,"Reference image"
shifts,s,h,"",,,"Initial shift file"
copyorg,b,h,no,,,"Copy original images to org* ?\n"

shiftimages,b,h,yes,,,"Shift the images?"
verbose,b,h,yes,,,"Print the centers and shifts?\n"

boxsize,i,h,7,1,,"Size of the small centering box"
bigbox,i,h,45,1,,"Size of the big centering box\n"

negative,b,h,no,,,"Are the features negative?"
autoback,b,h,yes,,,"Find reference background level"
background,r,h,INDEF,,,"Reference background level"
lower,r,h,INDEF,,,"Lower threshold for data"
upper,r,h,INDEF,,,"Upper threshold for data"
niterate,i,h,5,2,,"Maximum number of iterations"
tolerance,i,h,0,0,,"Tolerance for convergence\n"

tmplist,*s,h
imglist,*s,h
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3257
Location: Tucson

PostPosted: Tue Jul 29, 2008 9:04 pm    Post subject: Reply with quote

I don't see anything obviously wrong with either the parameter file or the script. Did unlearning the task change anything? What happens if you create a new login.cl/uparm in some other directory and declare the task from there? I'm trying to work out whether this is a problem with your account, rarely there are problems with e.g. a file not containing an EOF (sometimes happens with emacs), but since things seem to work for me and your friend, it sounds like something in your setup is the issue.

-Mike
Back to top
View user's profile Send private message
btingley



Joined: 28 Jul 2008
Posts: 5

PostPosted: Wed Jul 30, 2008 8:42 am    Post subject: Reply with quote

Thanks for looking it over.

It's a brand new installation, this is the first thing I tried to do at my new job. All the other scripts I was given for this task work fine.

Tried unlearning before I posted here :-/

Could it possibly be something with the set-up of my computer account, rather than an iraf setting?
Back to top
View user's profile Send private message
btingley



Joined: 28 Jul 2008
Posts: 5

PostPosted: Wed Jul 30, 2008 2:48 pm    Post subject: Reply with quote

OK, my collaborator re-wrote a big chunk of it and now it works.

Problem avoided, if not resolved Rolling Eyes
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    iraf.net Forum Index -> IRAFNet All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2009 phpBB Group
 Copyright © 2005-2011 iraf.net
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.11 seconds