Welcome to iraf.net Monday, May 20 2024 @ 02:55 PM GMT


 Forum Index > Help Desk > Systems New Topic Post Reply
 imaccess specification
   
Jason Quinn
 12/18/2008 06:43PM (Read 3889 times)  
+++++
Active Member

Status: offline


Registered: 04/07/2006
Posts: 175
Where can I read the language specification for [i:4f51816400]imaccess[/i:4f51816400]? 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:1:4f51816400]
language> touch jason.fits
language> print(imaccess("jason.fits")
yes
language> print(imaccess("jason"))
yes
language> touch jason.pl
language> print(imaccess("jason"))
no
[/code:1:4f51816400]The workaround solution would be for me to just use some other name for the bad-pixel mask. But knowing exactly how [i:4f51816400]imaccess[/i:4f51816400] produces its output would be useful. There doesn't appear to be a help page like with [i:4f51816400]access[/i:4f51816400].If I had to speculate on how the behavior should work, I would guess that, when the extension is left off the filename, [i:4f51816400]imaccess[/i:4f51816400] should [i:4f51816400]always[/i:4f51816400] print "yes" or "no" depending on the existence of a file using the imtype value for the file extension. If [i:4f51816400]imaccess[/i:4f51816400] 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.JasonPS The [i:4f51816400]imaccess[/i:4f51816400] function doesn't appear in the help list for the language package ("help language").

 
Profile Email
 Quote
fitz
 12/18/2008 06:43PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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

 
Profile Email
 Quote
   
Content generated in: 0.12 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