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 

imaccess specification

 
Post new topic   Reply to topic    iraf.net Forum Index -> Systems
View previous topic :: View next topic  
Author Message
Jason Quinn
IRAF Guru


Joined: 07 Apr 2006
Posts: 151

PostPosted: Thu Dec 18, 2008 6:43 pm    Post subject: imaccess specification Reply with quote

Where can I read the language specification for imaccess? I have a situation where I added some bad-pixel mask support to a script. Since there are now two extensions corresponding to each image filename (one for a fits file and the other for the pl mask), the logic of the script is now no longer correct because it returns "no" when I expect it to return yes. Here is a snippet showing the problem.

Code:

language> touch jason.fits
language> print(imaccess("jason.fits")
yes
language> print(imaccess("jason"))
yes
language> touch jason.pl
language> print(imaccess("jason"))
no


The workaround solution would be for me to just use some other name for the bad-pixel mask. But knowing exactly how imaccess produces its output would be useful. There doesn't appear to be a help page like with access.

If I had to speculate on how the behavior should work, I would guess that, when the extension is left off the filename, imaccess should always print "yes" or "no" depending on the existence of a file using the imtype value for the file extension. If imaccess also considers other known image extensions, it just makes the logic of the program too messy when there exists several images with the same prefix but multiple extensions.

Jason

PS The imaccess function doesn't appear in the help list for the language package ("help language").
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3255
Location: Tucson

PostPosted: Thu Dec 18, 2008 9:26 pm    Post subject: Reply with quote

Hi Jason,

I just added a help page for the next release. The function is supposed to mimic the same function in the SPP code, however the CL imaccess() is a boolean and the SPP version is an integer function. For the SPP code, the func returns YES/NO/ERR where ERR is the return value when the image name may be ambiguous (e.g. a foo.fits and foo.pl in the same directory). As currently implemented, a 'yes' is returned by the CL function only when the image exists and is unambiguous, so by supplying the extension you should also be able to get the expected answer.

I'm not sure whether the behavior should be changed or not since an ambiguous filename is an error that may be triggered later, so the thinking is that having imaccess() fail provides more control over your error checking. I can tell you how to easily change this if you're interested.

Cheers,
-Mike
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    iraf.net Forum Index -> Systems 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.91 seconds