View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Fwd: drizzle with wregister

Francisco Valdes wrote on Jun 19, 2007

From: "Mike Fitzpatrick" <fitz@iraf.net ([email]fitz@iraf.net[/email])>
Date: March 26, 2007 1:39:49 PM MST
To: valdes@noao.edu ([email]valdes@noao.edu[/email])
Subject: Fwd: drizzle with wregister

Hi Frank,

I can see the "grid lines" Frank mentions in the image, but I have no
idea what might be causing it.  Since you did the drizzle interpolation
(?right), would you mind having a look in case this is a bug of some
kind, or can you offer an explanation?

Thanks,
-Mike

---------- Forwarded message ----------
From: Frank Winkler <winkler@middlebury.edu ([email]winkler@middlebury.edu[/email])>
Date: Mar 23, 2007 2:43 PM
Subject: drizzle with wregister
To: Mike Fitzpatrick <fitz@iraf.net ([email]fitz@iraf.net[/email])>

Hi Mike,
I have very commonly used wregister to put a bunch of images on a
common system prior to combining them, etc, but usually in the past
I've done used the "linear" interpolant.   However, for a variety of
reasons, I wanted to try using drizzle (an algorithm with which I am
not very familiar).   This afternoon I did some experiments that
turned out rather curiously, and wonder if you can shed any light on
this.  When I use the drizzle[0.5] interpolant, the output images
have what look like "little dashed lines" on a coarse grid pattern.
Comparing the result to the linearly interpolated image, the
registration is good, but there are systematic shifts that appear to
be such that if we could excise the dashed line pattern, and move the
remaining pixels slightly closer together, all would be well.

I'm not explaining this very well, but I put a set of images where
you can look for yourself when you have a chance:
anonymous ftp to
polaris.middlebury.edu
cd pub/pfw
get (as binary) winkler_drizzle.tar

That has the original image (tobj3018), and a 1000x1000 section of
both transformed images.   Also the parameter file I used for
wregister.  Names should be obvious.  By the way, I tried different
drizzle factors (.5, .498, .6) and although the grid pattern is
somewhat different, none registers perfectly with the linear-
interpolated image.

Don't know if you'll have any insight into this, but if you do I'd
sure appreciate it, as it seems a bit baffling.

Thanks!
Frank

From: Frank Valdes <valdes@noao.edu ([email]valdes@noao.edu[/email])>
Date: March 26, 2007 2:18:40 PM MST
To: winkler@middlebury.edu ([email]winkler@middlebury.edu[/email])
Cc: Mike Fitzpatrick <fitz@iraf.net ([email]fitz@iraf.net[/email])>
Subject: Re: drizzle with wregister

Hi Frank,

The drizzle algorithm is intended for stacking images while preserving more resolution than you would get with other resampling methods.  It does this by "shrinking" the pixels and then adding them to an output image.  Depending on the shrinking factor, the drizzle scale, the pixel scale in the output, and the transformation function between input and output, you can get points where there is no data.  I believe this is what is causing your artifacts.

As I noted, on way to get rid of these is if you are going to combine dithered exposures to fill in the places where there is no data.  Note this would require a way to tell when there is no data in an image so that the weights in the stacked image can be correctly adjusted.  Another way is to adjust the output pixel scale to a finer sampling so that an output pixel typically covers one or more of the "shrunk"   drizzle pixels.  Finally, you could make the drizzle scale larger.  If 0.6 doesn't work try 0.7, etc.

I believe, at this point, that the behavior of the drizzle interpolator is correct.

Your tar file seems to mistakenly have the linear and drizzle versions as the same image.  A subtraction shows identically zero.  I cannot comment at this point on the astrometric effect you mention.   If you want to check the linear version I would be glad to take a look at it. I did not write wregister and I've never actually used it but if there appears to be an astrometric effect I would investigate further.

Yours,
Frank Valdes

From: Frank Winkler <winkler@middlebury.edu ([email]winkler@middlebury.edu[/email])>
Date: March 26, 2007 2:41:53 PM MST
To: Frank Valdes <valdes@noao.edu ([email]valdes@noao.edu[/email])>
Cc: Mike Fitzpatrick <fitz@iraf.net ([email]fitz@iraf.net[/email])>
Subject: Re: drizzle with wregister

Dear Frank and Mike,
Thanks for looking at this.   Let me carefully review the images I sent and put up the correct ones if I didn't do that.  I'll also try a few more experiments.

Just for information, the original scale on these images is about 0.401 arcsec/pixel (CTIO 0.9m), and my resampled images are put on an arbitrary scale of exactly 0.2 arcsec/pix.  My understanding of the drizzle procedure is that the recommended drizzle scale is exactly the ratio of these two, i.e. almost exactly 0.5 in my case.  That's why I chose this value.

I do have several dithered images, so can try transforming the lot of them via drizzle and combining.   In any case I'll be back in touch soon.

Thanks again,
Frank

From: Frank Winkler <winkler@middlebury.edu ([email]winkler@middlebury.edu[/email])>
Date: June 5, 2007 9:03:06 AM MST
To: Frank Valdes <valdes@noao.edu ([email]valdes@noao.edu[/email])>
Cc: Mike Fitzpatrick <fitz@iraf.net ([email]fitz@iraf.net[/email])>, Karl Twelker <ktwelker@middlebury.edu ([email]ktwelker@middlebury.edu[/email])>
Subject: Re: drizzle with wregister

Dear Frank (and Mike),
Thanks for your suggestions back in March.   With the impending end of the school year, etc, I laid this problem aside, but am now returning to confront it, along with my student Karl Twelker.

Your suggestion about varying the drizzle scale factor is exactly right.   I find that using a factor a few percent bigger than the ratio of output to original pixel size is fine and eliminates the "dashed-line" pattern entirely.

But the astrometry problem is still with us.  In comparing the output of wregister from linear vs. drizzle[0.55] algorithms, we see differences of as large as 1/3 output pixel in the positions for stars.   Zooming in on this pair of images and blinking, it appears that small sections of the image appear to rotate slightly back and forth.     Although the effect is small, we are trying to do astrometry of the filaments in our images to a precision of a fraction of the (0.2 arcsec) pixels, so it matters.   The drizzled images clearly do a better job of preserving resolution, but if this comes at the cost of even small artifacts in position, I think we better go back to the linear interpolation.

I will follow this message with one containing a tar file with small sections from both drizzled and linearly interpolated images, along with a section of the original one used as input to wregister.   This time I  have checked, and the files are, indeed, different!  The tar file is 2.6 Mbytes.   I will also put it where you can grab it by ftp, in case this chokes your mailer:
ftp polaris.middlebury.edu
cd pub/pfw
get drizzle_example.tar

Many thanks!
Frank

P.S.  If you would prefer that I follow this up, if necessary, via iraf.net, I'm happy to do that--as for future inquiries.  Just let me know.  But having started by direct email, I thought I'd continue in that mode.

From: Frank Valdes <valdes@noao.edu ([email]valdes@noao.edu[/email])>
Date: June 19, 2007 2:07:56 PM MST
To: Frank Winkler <winkler@middlebury.edu ([email]winkler@middlebury.edu[/email])>
Cc: Mike Fitzpatrick <fitz@iraf.net ([email]fitz@iraf.net[/email])>, Karl Twelker <ktwelker@middlebury.edu ([email]ktwelker@middlebury.edu[/email])>
Subject: Re: drizzle with wregister

Hi Frank,

I was away on vacation and have now returned to look at your astrometry question.  Thanks to your example data I have been able to reproduce what you see and understand it.

Drizzle interpolation is intended for registering and combining exposures with subpixel dithers with minimal loss of resolution.  It is not appropriate for single exposures except in as far as a drizzle factor of 1 is essentially the same as linear interpolation.  The behavior of drizzle is that for small factors (such as your 0.55) it is close to "nearest" interpolation and, as I just noted, for factors near 1 it is close to "linear".  This can be verified by running your experiment with those two interpolation options.

So then it comes down to why does nearest interpolation show the "twisting" behavior when blinked against linear interpolation.  The reason is that the mapping function (the function mapping your input data to the WCS of the registration target) is a higher order smooth distortion which includes the twists.  A nearest interpolation, or a drizzle with a small factor, does not well follow this function at the subpixel scale.  I don't know if this is clear but it is like the fact that if you truncate real numbers to the nearest integer the truncated numbers will show patterns of offsets relative to a real function.

So my recommendation is that unless you have a number of exposures with sufficient shifts that have good coverage of subpixel positions that you are going to stack then you should use "poly5" interpolation (which I think is better than linear though you could just use that if you want).

Let me know if you want to discuss this further.

Yours,
Frank

Post generated using Mail2Forum (http://www.mail2forum.com)

Francisco Valdes wrote on Jun 19, 2007

From: Frank Winkler <winkler@middlebury.edu ([email]winkler@middlebury.edu[/email])>
Date: June 19, 2007 6:16:35 PM MST
To: Frank Valdes <valdes@noao.edu ([email]valdes@noao.edu[/email])>
Cc: Karl Twelker <ktwelker@middlebury.edu ([email]ktwelker@middlebury.edu[/email])>, Mike Fitzpatrick <fitz@iraf.net ([email]fitz@iraf.net[/email])>
Subject: Re: drizzle with wregister

Hi Frank,
Thanks for the very full response.   This is roughly what I had figured must be going on, though you have expressed it far more clearly than I ever could have.   Since in many cases we do not have enough individual frames to compensate for the twisting pattern, we'd already decided to use simple linear interpolation.   My experience (limited) with higher orders is that they introduce some ringing around the stars.

Many thanks,
Frank

On Jun 19, 2007, at 5:07 PM, Frank Valdes wrote:

Hi Frank,

I was away on vacation and have now returned to look at your astrometry question.  Thanks to your example data I have been able to reproduce what you see and understand it.

Drizzle interpolation is intended for registering and combining exposures with subpixel dithers with minimal loss of resolution.  It is not appropriate for single exposures except in as far as a drizzle factor of 1 is essentially the same as linear interpolation.  The behavior of drizzle is that for small factors (such as your 0.55) it is close to "nearest" interpolation and, as I just noted, for factors near 1 it is close to "linear".  This can be verified by running your experiment with those two interpolation options.

So then it comes down to why does nearest interpolation show the "twisting" behavior when blinked against linear interpolation.  The reason is that the mapping function (the function mapping your input data to the WCS of the registration target) is a higher order smooth distortion which includes the twists.  A nearest interpolation, or a drizzle with a small factor, does not well follow this function at the subpixel scale.  I don't know if this is clear but it is like the fact that if you truncate real numbers to the nearest integer the truncated numbers will show patterns of offsets relative to a real function.

So my recommendation is that unless you have a number of exposures with sufficient shifts that have good coverage of subpixel positions that you are going to stack then you should use "poly5" interpolation (which I think is better than linear though you could just use that if you want).

Let me know if you want to discuss this further.

Yours,
Frank

On Jun 5, 2007, at 9:03 AM, Frank Winkler wrote:

Dear Frank (and Mike),
Thanks for your suggestions back in March.   With the impending end of the school year, etc, I laid this problem aside, but am now returning to confront it, along with my student Karl Twelker.

Your suggestion about varying the drizzle scale factor is exactly right.   I find that using a factor a few percent bigger than the ratio of output to original pixel size is fine and eliminates the "dashed-line" pattern entirely.

But the astrometry problem is still with us.  In comparing the output of wregister from linear vs. drizzle[0.55] algorithms, we see differences of as large as 1/3 output pixel in the positions for stars.   Zooming in on this pair of images and blinking, it appears that small sections of the image appear to rotate slightly back and forth.     Although the effect is small, we are trying to do astrometry of the filaments in our images to a precision of a fraction of the (0.2 arcsec) pixels, so it matters.   The drizzled images clearly do a better job of preserving resolution, but if this comes at the cost of even small artifacts in position, I think we better go back to the linear interpolation.

I will follow this message with one containing a tar file with small sections from both drizzled and linearly interpolated images, along with a section of the original one used as input to wregister.   This time I  have checked, and the files are, indeed, different!  The tar file is 2.6 Mbytes.   I will also put it where you can grab it by ftp, in case this chokes your mailer:
ftp polaris.middlebury.edu
cd pub/pfw
get drizzle_example.tar

Many thanks!
Frank

P.S.  If you would prefer that I follow this up, if necessary, via iraf.net, I'm happy to do that--as for future inquiries.  Just let me know.  But having started by direct email, I thought I'd continue in that mode.

On Mar 26, 2007, at 5:18 PM, Frank Valdes wrote:

Hi Frank,

The drizzle algorithm is intended for stacking images while preserving more resolution than you would get with other resampling methods.  It does this by "shrinking" the pixels and then adding them to an output image.  Depending on the shrinking factor, the drizzle scale, the pixel scale in the output, and the transformation function between input and output, you can get points where there is no data.  I believe this is what is causing your artifacts.

As I noted, on way to get rid of these is if you are going to combine dithered exposures to fill in the places where there is no data.  Note this would require a way to tell when there is no data in an image so that the weights in the stacked image can be correctly adjusted.  Another way is to adjust the output pixel scale to a finer sampling so that an output pixel typically covers one or more of the "shrunk"   drizzle pixels.  Finally, you could make the drizzle scale larger.  If 0.6 doesn't work try 0.7, etc.

I believe, at this point, that the behavior of the drizzle interpolator is correct.

Your tar file seems to mistakenly have the linear and drizzle versions as the same image.  A subtraction shows identically zero.  I cannot comment at this point on the astrometric effect you mention.   If you want to check the linear version I would be glad to take a look at it. I did not write wregister and I've never actually used it but if there appears to be an astrometric effect I would investigate further.

Yours,
Frank Valdes

From: Frank Winkler <winkler@middlebury.edu ([email]winkler@middlebury.edu[/email])>
Date: Mar 23, 2007 2:43 PM
Subject: drizzle with wregister
To: Mike Fitzpatrick <fitz@iraf.net ([email]fitz@iraf.net[/email])>

Hi Mike,
I have very commonly used wregister to put a bunch of images on a
common system prior to combining them, etc, but usually in the past
I've done used the "linear" interpolant.   However, for a variety of
reasons, I wanted to try using drizzle (an algorithm with which I am
not very familiar).   This afternoon I did some experiments that
turned out rather curiously, and wonder if you can shed any light on
this.  When I use the drizzle[0.5] interpolant, the output images
have what look like "little dashed lines" on a coarse grid pattern.
Comparing the result to the linearly interpolated image, the
registration is good, but there are systematic shifts that appear to
be such that if we could excise the dashed line pattern, and move the
remaining pixels slightly closer together, all would be well.

I'm not explaining this very well, but I put a set of images where
you can look for yourself when you have a chance:
anonymous ftp to
polaris.middlebury.edu
cd pub/pfw
get (as binary) winkler_drizzle.tar

That has the original image (tobj3018), and a 1000x1000 section of
both transformed images.   Also the parameter file I used for
wregister.  Names should be obvious.  By the way, I tried different
drizzle factors (.5, .498, .6) and although the grid pattern is
somewhat different, none registers perfectly with the linear-
interpolated image.

Don't know if you'll have any insight into this, but if you do I'd
sure appreciate it, as it seems a bit baffling.

Thanks!
Frank








Post generated using Mail2Forum (http://www.mail2forum.com)

Last post on Jun 19, 2007