STScI-Citizen-Science / MTPipeline

Pipeline to produce CR rejected, astrodrizzled, png's of HST WFPC2 solar system data.
6 stars 1 forks source link

Testing CTE Correction on WFC3 Data #100

Closed ktfhale closed 10 years ago

ktfhale commented 10 years ago

WFC3 data, like ACS data, also requires/can take advantage of CTE correction. We may want to add it to our pipeline. Some information on it is here:

ktfhale commented 10 years ago

It appears that CTE correction exists for UVIS observations. I think these comprise the majority of our WFC3 observations, although there were duplicate files still in our archive when I ran the count.

UVIS: 8510 flt files IR: 1344 flt files

EDIT: Looks like all the files outside of their proper directories were indeed duplicates. The actual flt filecount for our WFC3 data is just half the above:

UVIS: 4255 flt files IR: 672 flt files

acviana commented 10 years ago

So, I think the next step is to try to get the CTE correction to run. Pick some images that you think would be good test cases (maybe consult with Max on this if you're unsure), maybe chose some ideal cases and some worst cases. I think what we're interested in is:

1) How hard it is to run this? 2) How noticeable are the effects?

ktfhale commented 10 years ago

FORTRAN 77 CTE correction routines are available for WFC's UVIS detector. No CTE correction is available for WFC's IR detector. We have 4255 UVIS datasets and 672 IR datasets.

Compiling and running the CTE correction on UVIS data is very easy, requiring only a couple terminal commands.

Several versions of the FOTRAN code are available. One version features multi-thread parallel processing using OpenMP. Another version is made to handle data taken using only subsets of the WFC3 UVIS detector. These are the UVIS subsets:

c06_uvis05 2

UVIS Aperture Number of _flt.fits files
UVIS2-C512C-SUB 1715
UVIS1-C512B-SUB 625
UVIS1-C512A-SUB 500
UVIS1 242
UVIS-QUAD-SUB 222
UVIS1-M512-SUB 216
UVIS2-C1K1C-SUB 186
UVIS2-2K2C-SUB 164
UVIS2 106
UVIS2-M512C-SUB 68
UVIS 65
UVIS1-FIX 51
UVIS1-2K2B-SUB 33
UVIS1-2K2A-SUB 27
UVIS2-M1K1C-SUB 12
UVIS1-2K4-SUB 11
UVIS2-FIX 8
UVIS-CENTER 4

I first ran the CTE correction on an image of Jupiter and Europa taken with the 2K2C aperture. It took 51 minutes. Most of our UVIS data comes from subsets smaller 2K2C, however. Images taken with the C512C aperture, which are the most common, take 14 minutes. These would take less time. Hundreds of our datasets, however, were taken on full chips, which have 4 times the pixels than the image I ran, and the correction take much longer. The parallel-processing version of the CTE code, which only takes non-subset images, could help with this.

However, in addition to the code's runtime also need to consider the impact of CTE correction. While not visually apparent, CTE correction does change the image. Below are before CTE correction, after it, and the difference:

cte_beforeafter jupiter_compare

CTE correction is, to my understanding, primarily of interest to those wanting precise photometry on point sources. CTE errors are also directional, following the read out direction along the CCD. As a result, I think, CTE is biased about the edges of extended objects. We see that it darkens the upper limb of Jupiter, and brightens the lower limb. We can see the correction behaving the same way, albeit possibly on actual CTE errors, in the various free pixels along the upper half of the image. The CTE correction seems to treat the entire upper and lower limbs of Jupiter as CTE errors.

jupiter_hist

These are some fairly sizable changes in the pixel value, although their significance is difficult to judge. Most concerning to me is the potential for bias along the edges of extended objects.

I also looked at the effects of CTE correction on a field in our UVIS dataset more alike what the software was probably developed for: a field much more uniform in brightness, and containing more extended sources. I picked an image of the dwarf planet Haumea:

haumea

other_compare

other_hist

These results seem more acceptable. Note the much more compact range of differences in the pixel value, and not merely due to the absence of extreme outliers. The adjustments to the pixel values are much more slight than they were for Jupiter. I would need someone more familiar with CTE correction to tell me whether this was good behavior.

Overall, I'm wary of adding CTE correction to the pipeline. We can only run it on UVIS data, not IR data. It will increase processing times per image by 15 minutes for our smallest WFC3 images, and by at least an hour for others. What's more, running it on extended sources like planets yields clearly undesirable behavior. Finally, users could still run CTE correction on the data the pipeline serves up, if they need the more accurate photometry CTE correction yields.

ktfhale commented 10 years ago

As we will probably not implement CTE correction into the pipeline, this ticket can be closed.