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
|
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
|