AstrOmatic forum
long arrays - Printable Version

+- AstrOmatic forum (
+-- Forum: AstrOmatic software (/forumdisplay.php?fid=3)
+--- Forum: SWarp (/forumdisplay.php?fid=5)
+--- Thread: long arrays (/showthread.php?tid=14)

long arrays - august_fly - 06-07-2006 20:55


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

RE: long arrays - Emmanuel Bertin - 06-08-2006 16:09

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.


RE: long arrays - august_fly - 06-08-2006 16:25

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