Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WEIGHT_TYPE MAP_RMS does not work correctly
01-24-2016, 10:58
Post: #1
WEIGHT_TYPE MAP_RMS does not work correctly
Hi Emmanuel and all,

Julian Taylor submitted a bug report on Debian (812432) for the ESO VISIR pipeline which actually uses SWarp for some of its data reduction steps. While ESO uses a patched version 2.38.1, on Debian we are on the current official version 2.38.

The problem appears when running the pipeline with the options

Code:
WEIGHT_TYPE            MAP_RMS
BLANK_BADPIXELS        Y

for example with visir_util_clip_error_000.fits.xz and visir_util_detect_shift_001_Aoff.fits.xz (unpack them with xz -d):

Code:
SWarp -WEIGHT_TYPE MAP_RMS -BLANK_BADPIXELS Y \
-WEIGHT_IMAGE visir_util_clip_error_000.fits \
        visir_util_detect_shift_001_Aoff.fits

In this case, the weight field is always set to zero, resulting in all-zero data and weight output files. Bisecting the SVN commits, I could trace this down to this commit (125).
The problem here is that, in src/coadd.c, the following lines are added:

Code:
if ((thresh=wfield->weight_thresh)>0.0)
    {
    linet = line;
    for (x=field->width; x--; linet++)
      if (*linet<=thresh)
        *linet = 0.0;
    }

They reset the variance (for the resampled weight image) to zero when they are below the configured threshold (which is, by default 1e10 (!)).

The same patch replaces the calculation of the weights for the RMS field (as in our case) in src/weight.c from (basically)

Code:
*data *= *data

to

Code:
*data *= *data<weight_thresh? *data : BIG;

Here, the treshold is an upper limit. So, independently of where the threshold is set, the resulting field is set to 0, with the consequences mentioned above.

Could you explain what the purpose of the change in src/coadd.c is? The code there is executed after the code from src/weight.c, and here the data already do not contain the weights, but the variances (changed by weight_to_var()). Setting them to zero based on a lower limit seems not to be useful to me.

Could these lines just removed, or is there a case when they are used?

Best regards

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


Forum Jump:


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