Welcome to iraf.net Sunday, April 28 2024 @ 09:37 AM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 string substitutions
   
Nostril585129
 12/12/2008 04:03AM (Read 1387 times)  
+----
Newbie

Status: offline


Registered: 12/09/2008
Posts: 9
So I am trying to take a piece of text out of a variable, but seem to be having trouble. I call for a variable n from a list using fscan, which comes out in the form20080519.0091.fitsI then try and insert it into XYXYMATCH in this way:
[code:1:90f9ea4ce0]xyxymatch (input="b_"//n//"%.fits%%.coo%", reference="b_"//f//".coo", output="b_"//n//"%.fits%%.match%", tolerance=10, xin=x, yin=y, separation=15, matching="triangles", nmatch=35, ratio=8, nreject=15)[/code:1:90f9ea4ce0]Because XYXYMATCH needs a coo file (which is already made), I am trying to feed it the string "b_20080519.0091.coo". Any thoughts on how to parse this string's extension? I know how to add to text to a string, just not take some away.Thanks

 
Profile Email
 Quote
fitz
 12/12/2008 04:03AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
A simpler approach may just be to create the root part of the filename and concatenate the appropriate extension as needed, e.g.[code:1:c6dd8b5b28]
root = "b_" // substr (n,1,strlen(n)-5)
xyxymatch (input=root // ".coo", ..... )
[/code:1:c6dd8b5b28]Depending on how you create your file list, you could also use the '%' operator to strip the root beforehand, e.g.[code:1:c6dd8b5b28]
files ("2008*%.fits%%", > "imglist")
[/code:1:c6dd8b5b28]
-Mike

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