View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

fscan/struct issue?

ako3004 wrote on Jul 09, 2009

Hi,

I'm having a frustrating time with fscan. Can anyone tell me why the following bit of code keeps asking me for "imagelist" when I run it? I have looked at other posts in this forum, and my task is declared correctly (i.e. without at "$", so it accepts parameters). It just won't run correctly. The code here: http://iraf.net/phpBB2/viewtopic.php?t=87149 works fine, but then my code doesn't work.

procedure fixlists
################
#
# 
#
################
string imgsA	
string imgsB	
string imgsC	
bool exp_lists	{no,prompt="Do lists contain exposure times?"}
struct *imagelist

begin

	#Declaration of Variables
	string imname		#Current image name
	string litem		#Current item to be added to list
	string listname		#Name of current list
	string x			#Strings internal to fscan.
	real y
	
	imagelist = imgsA
	
	#Initialize specifice variables	
	listname='temp.list'
		
	if(exp_lists) {
		#Strip exposure times from flat fields
		if(access(listname)){delete(listname)}
		
		imagelist = imgsA
		
		while(fscan(imagelist,x,y)!=EOF) {
			imname=x
			printf("%s \n",x,>>listname)
		;
		}
		copy(listname,imgsA)
		if(access(listname)){delete(listname)}
	} else {
		if(access(listname)) { delete(listname) }
		
		imagelist = imgsB
		while(fscan(imagelist,x)!=EOF) {
			imname=x
			litem=imname//" "//defexptm
			printf("%s \n",litem,>>listname)
		;
		}
		copy(listname,imgsB)

		if(access(listname)){delete(listname)}
		imagelist=imgsC
		while(fscan(imagelist,x)!=EOF) {
			imname=x
			litem=imname//" "//defexptm
			printf("%s \n",litem,>>listname)
		;
		}
		copy(listname,imgsC)
		if(access(listname)){delete(listname)}
	}
end


Thanks so much for any help!

Alex[/code]

ako3004 wrote on Jul 09, 2009

Never mind the above, it turns out that the lists i was looking for had gone missing. I'll have to remember to write an access in for those...

Thanks,
Alex

Last post on Jul 09, 2009