Welcome to iraf.net Friday, April 26 2024 @ 06:35 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Snow Leopard and scripts
   
dbrenner
 09/13/2009 02:43PM (Read 4225 times)  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
I'm having trouble running scripts on Snow Leopard. I ran a script using print and imarith but am having no luck using imexpr and iminsert. I've used imexpr many times previous with earlier versions of Mac OS.Here is one example of what didn't work.
procedure makemask
begin
imexpr expr = "( (I > -1) && (J > -1) ) ? 0:1", output="/nrm/blank.fits", dims = "256,256", verbose = no
end

 
Profile Email
 Quote
fitz
 09/13/2009 02:43PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
In the "command mode" syntax you use for the IMEXPR line, there should be no commas between the parameters. It is "program mode" where you use braces around the parameters and commas between them. Try e.g.[code:1:53a85f2461]imexpr (expr="...", output="blank.fits", dims="256,256", .....)[/code:1:53a85f2461]I think this may also explain your other IMINSERT posting, I'll have to check whether this should be producing a syntax error but I don't think it has anything to do with Snow Leopard.-Mike

 
Profile Email
 Quote
dbrenner
 09/13/2009 02:43PM  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
imexpr expr = "( (I > -1) && (J > -1) ) ? 0:1", output="/nrm/blank.fits", dims = "256,256", verbose = noimexpr (expr = "( (I > -1) && (J > -1) ) ? 0:1", output="/nrm/blank.fits", dims = "256,256", verbose = no)imexpr (expr = "( (I > -1) && (J > -1) ) ? 0:1" output="/nrm/blank.fits" dims = "256,256" verbose = no)
imexpr expr = "( (I > -1) && (J > -1) ) ? 0:1" output="/nrm/blank.fits" dims = "256,256" verbose = notried them all.
writing in text edit but haven't had much luck with vi either.Which one should work?

 
Profile Email
 Quote
dbrenner
 09/13/2009 02:43PM  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
procedure makeblank
begin
imexpr (expr = "( (I > -1) && (J > -1) ) ? 0:1", output="/nrm/blank.fits", dims = "2556,256" verbose = no)
end
modified and saved in vi.
no luck

 
Profile Email
 Quote
fitz
 09/13/2009 02:43PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
The second one should work, but I notice you're not specifying an 'a' parameter for the input image, did you set this before running the script?
Your script doesn't have any parameters, are you declaring the task with the '$' before the name to indicate this?

 
Profile Email
 Quote
dbrenner
 09/13/2009 02:43PM  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
Yes, I use the $ and I gave it a parameter a = 0 even though I don't use it but no luck

 
Profile Email
 Quote
fitz
 09/13/2009 02:43PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
The 'I' and 'J' are pixel indices so you need to specify 'a' as an image. If you simply want a blank image, see the MKPATTERN task in ARTDATA.

 
Profile Email
 Quote
dbrenner
 09/13/2009 02:43PM  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
procedure makeblank
begin
imexpr (expr = "( (I > -1) && (J > -1) ) ? 0:1", output="/nrm/blank.fits", a="/nrm/fft.fits", dims = "256,256" verbose = no)
endno luck.
Will try mkpattern but really need to know what is wrong here and with iminsert. I check my syntax there.

 
Profile Email
 Quote
dbrenner
 09/13/2009 02:43PM  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
procedure preparetofft
begin
iminsert (input1 = "zeros.fits", input2 = "test.fits[1:125,1:125]", output = "prepared.fits", option = "replace", coordfile = "starts/lltour.txt")endno luck.

 
Profile Email
 Quote
fitz
 09/13/2009 02:43PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
It looks like it should work, what are the image sizes and what is in the coordfile? Could it be you're moving pixels off the end of the image?If that same command works from the cl prompt you can try turning on the 'd_trace' flag (just type d_trace to toggle it) to see what's happening and post those results, using d_on/d_off will produce more verbose output.

 
Profile Email
 Quote
dbrenner
 09/13/2009 02:43PM  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
It works on the command line; file sizes (256 x 256) and (125x125) and the coordfile ( 1 131) are not the problem. preparetofft
----- task cl - line 0 (CALL) -----
0 0+7: call preparetofft
0 7+3: exec
----- exec script preparetofft (/nrm/preparetofft.cl) - line 0 -----
----- task cl - line 0 (END) -----
0 10+3: endd_on
ecl> preparetofft
parse init (block)...
----- task cl - line 0 (CALL) -----
0 0+7: call preparetofft
run: pc=0, op=CALL
callnewtask: name=preparetofft, currentask=3196DC
0 7+3: exec
run: pc=7, op=EXEC
execnewtask: pc = 10 (line 0)
paramfind() looking down pfile `preparetofft'/359360 for `$nargs'
----- exec script preparetofft (/nrm/preparetofft.cl) - line 0 -----
Returning from execnewtask.yyin, ct_in, nt_in:2076916 2076916 2076916
startblock (1)
startblock: ifseen=0
ÿþpparse init (block)...
received `eof' from `preparetofft'
paramfind() looking down pfile `cl'/31EBD8 for `$errno'
paramfind() looking down pfile `cl'/31EBD8 for `$errmsg'
paramfind() looking down pfile `cl'/31EBD8 for `$errtask'
flushing io for task `preparetofft'
restoring task `cl', tp: 3249884
topd 60276/59896
----- task cl - line 0 (END) -----
0 10+3: end
run: pc=10, op=END
startblock (1)
startblock: ifseen=0
ecl>

 
Profile Email
 Quote
dbrenner
 09/13/2009 02:43PM  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
It seems that I can no longer use text edit. I was able to get scripts working using vi instead. My knowledge of Unix editors is slim. What editors work with cl?
thanks.

 
Profile Email
 Quote
rohit
 09/13/2009 02:43PM  
++++-
Regular Member

Status: offline


Registered: 06/01/2006
Posts: 86
I have been using Snow Leopard and creating scripts on TextEdit. When writing scripts make sure you have disable formatting Do not use Rich Text rather plain text. Alternately, you can use AquaMacs.

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