Dealing With The Flatfield
13. Make an avs file to subtract the darkfield from the flatfield avi, similarly
to what you did with the event avi. It should look like this:
a = AVIsource("C:\path3\flatfield.avi")
b = AVIsource("C:\path4\oneframedarkfield.avi")
overlay(a,b,mode="subtract",pc_range=true)
See note.
14. Open this avs file with VirtualDub, and run the dub. Then save it as your
dark-adjusted flatfield avi file.
15. Use Registax to make averages of the new flatfield-with-dark-subtracted avi.
This is done by loading it into Registax, clicking on the
"Flat/Dark/Reference" menu and then clicking [pay attention now] "Create
Darkframe". Do NOT click "Create Flatfield" because that is
a mysterious and incompletely documented function. Registax will then
stack and average the flatfield-with-dark-subtracted as though it were a
darkfield. Save it as a jpg file that calls it a flatfield, not a
darkfield.
16. In VirtualDub, open the flatfield one-frame jpg file, and save it as an avi.
17. Open Windows Paintbrush. There will be a blank image there, all white. Use the
image attributes function to adjust the blank image's dimensions to match
those of your avi's. This will probably be 720 pixels horizontally by 480
vertically. When you set it up that way, you will note that the horizontal
pixels are numbered from 0 through 719, and the vertical from 0 through
479. Save this image as a jpg, with a name something like "allwhite.jpg".
18. Open the plain white jpg in VirtualDub, and then save it as an avi. This will
create a one-frame avi that is plain white.
19. Open the one-frame flatfield avi file in Limovie, and measure it at multiple
points, emphasizing measurements in the areas of the flatfield that
correspond to the areas that contain the occultation star near the time of
the event in the data video. First, make estimates of the *mean*
brightness of the background. To do this, set the background outer radius
at 25, and by setting the aperture radius to zero you will be able to set
the background inner radius at 1. Then read the background value, called
"BKG/Frame" in the lower left corner of the interface. Click around the
critical areas of the field to get an idea of what the mean value is.
Remember this mean brightness number. Let's call it 'm'. Then calculate
(2m - 255)/16. Let's call that 'n.' It may be postive or negative. You
will use this number in an operation in step 21. Second, leaving the
aperture and background radius settings as they are, read the one-pixel
aperture value at multiple points of this flatfield in the critical areas.
This value is in the box labelled "Frame" at the very lower left corner of
the interface. You need to add the "Frame" number to the BKG/Frame value
to get the total brightness of the pixel. Click around the critical areas
to ascertain the highest value you can find of such a pixel. Call that
value (after adding the BKG/Frame value) 'p.' Calculate (255/p)*100. Let's
call that 'q.' You will use this number, too, in an operation in step 21.
20. Make an avs file that manipulates the one-frame flatfield avi. Let 'a' be the
flatfield avi, and let 'b' be the pure white one-frame avi. Here is the
avs file:
a = AVIsource("C:\path5\oneframeflatfield.avi")
b = AVIsource("C:\path6\allwhite.avi")
overlay(a,b,mode="exclusion",pc_range=true)
See note.
21. Open this avs file in VirtualDub. Before you run the dub, add a video filter
called 'brightness/contrast.' Adjust this filter's brightness slider
leftward or rightward by a number of gradations equal to n (from step 19.)
Negative n is to the left, positive to the right. (Each notch on the
slider adjusts the entire file by 16 in brightness on the 0 to 255 scale.
The resolution of this adjustment is 1.6, because there are 10 pixels of
slider movement per notch. So, if n is 0.65, you will want to move the
slider 0.65 x 10 pixels, or 7 pixels, to the right.) Leave the contrast
slider at 100%. Then click "OK." Then, click on the 'brightness/contrast'
filter a second time, so as to bring up a second instance of this filter,
to run after the first instance. This time, set the brightness slider to
normal (the middle position,) and move the contrast slider to q. (The
contrast slider has a resolution of 6.25%. You should move it to the
highest level you can that is *less than* q, so as not to exceed q.) Then
click "OK" twice to return to the main interface. Then run the dub. Save
the result as an avi file, called something like, 'AdjustedFlatfield.avi.'
The new flatfield avi is a negative of the original dark-subtracted
flatfield, with the same proportions of contrast in its dark and light
areas, but with the contrast stretched to the maximum allowed in the 255
level grayscale.
22. Make another avs file, this one to apply the fully adjusted flatfield to the
event avi by multiplication (not by division!) It should look like this:
a = AVIsource("C:\path7\DarkAdjustedEvent.avi")
b = AVIsource("C:\path8\FullyAdjustedOneFrameFlatfield.avi")
overlay(a,b,mode="multiply",pc_range=true)
23. Open this avs file in VirtualDub. Be sure the "brightness/contrast" filter is
not applied, because you applied it in step 21, and you don't want it
here. Then run the dub. Then save the result as an avi. This is your fully
calibrated event avi.
|