Post Reply 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
long arrays
06-07-2006, 20:55
Post: #1
long arrays


though I see there is mention of this in the changelog for swarp, I still seem to have trouble with long arrays even though I'm running 2.15.7-MP.

I'm swarping (many ~ 200) 2mass atlas images together and subtracting a manual mode of the sky. it works pretty darn well, but at some point the array input for the list of manual sky values gets truncated, and the last value before the truncation is used for the sky of each subsequent image.

From my experiments it appears that the break occurs at the 496th character of the input to BACK_DEFAULT. It does not occur at a particular element to the input array, but at a particular character in that list.

The three indications/warnings I have that soemthing went wrong were:

Swarp says:
1) > WARNING: 514.7 keyword unknown
where 514.7 in this case is the first value past the 496th character in the BACK_DEFAULT array. If the 496th character fell on the decimal of 9.4, for example, it says

> WARNING: 4 keyword unknown.

2) as swarp verbosely runs, i can see that 'Background:' value starts repeating the last value before the 496th character of the input sky array.

3) the ouput image has elevated/negative skies since the repeated value doesn't match the actual sky. of course.

thanks for any help here.


- gus muench
Find all posts by this user
Quote this message in a reply
06-08-2006, 16:09 (This post was last modified: 06-08-2006 16:12 by Emmanuel Bertin.)
Post: #2
RE: long arrays
It took me some time to understand what would go wrong, but I think I found the reason. Let me guess: you put your long BACK_DEFAULT string in the configuration file, right?
I just found out that the buffer length when reading the configuration file is still limited to 512 characters (including the "BACK_DEFAULT\t\t"), which would explain why the bug appears beyond "512 - something" chars. The solution: until the next SWarp release and until our SVN (CVS) is online you should apply the attached patch to src/prefs.c in the SWarp source code and recompile it, or put the infamous BACK_DEFAULT as a command-line argument (if your shell supports such long strings).
Please tell me if this solves the problem.


Attached File(s)
.txt  conflinepatch.txt (Size: 181 bytes / Downloads: 956)
Visit this user's website Find all posts by this user
Quote this message in a reply
06-08-2006, 16:25
Post: #3
RE: long arrays

dear Emmanuel:

That fix worked perfectly and no, i could not use the commandline (which is how i ended up in the changelog to see the first long array fix). the results are really nice.

- gus
Find all posts by this user
Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 1 Guest(s)