Preprocessing FIT Files: A Guide to Bias and Flat Correction Using Python Script

  • I
  • Thread starter tryingtolearn1
  • Start date
  • Tags
    files Fit
In summary, preprocessing FIT files involves correcting for bias and flat images using a Python script. This involves identifying and removing any unwanted noise or artifacts in the images, as well as correcting for variations in the sensor's sensitivity. Through the use of specialized techniques and functions in Python, the FIT files can be processed and prepared for further analysis and manipulation. This guide provides a comprehensive overview of the steps involved in bias and flat correction using Python script, making it a valuable resource for those working with FIT files in their data analysis.
  • #1
tryingtolearn1
58
5
TL;DR Summary
I am trying to understand the steps for prepossessing fits files and what exactly needs to be done with the target and standard stars files.
I have a list of about 35 fit files, where there are 10 dome flats files, 10 bias files, 10 standard stars files, and 5 target files. Where each file has been filtered with BVI filter. So a third of the dome flat files were taken with a I-filter, a third with V-filter and a third with B-filter and so on with the remaining files.

I am using a python script to conduct the pre-processing. When conducting preprocessing, I understand you need to first apply a bias and flat correction by finding the median of all the BIAS files and subtracting that median from each of the dome flat files. Once you subtracted the median for each of the DOME files then you get the median of the DOME-subtracted files which then you can normalize. I understand this two parts but what exactly is the target and standard files for? What do I need to do with those files?
 
Astronomy news on Phys.org
  • #2
Well, I don't know exactly what you are trying to do, but probably the target files have the actual observations of the objects you care about. All of the other files (dome flats, bias, standard stars) are used to calibrate the target files so you can get quantitative measurements of the objects you care about. The standard star files should have images of "standard" stars of a known brightness so that you can determine the calibration factors from the measured instrument counts to actual number of incoming photons.
 
  • Like
Likes tryingtolearn1
  • #3
phyzguy said:
Well, I don't know exactly what you are trying to do, but probably the target files have the actual observations of the objects you care about. All of the other files (dome flats, bias, standard stars) are used to calibrate the target files so you can get quantitative measurements of the objects you care about. The standard star files should have images of "standard" stars of a known brightness so that you can determine the calibration factors from the measured instrument counts to actual number of incoming photons.

Thank you now I understand about that the image that needs to be calibrated is the target but I am still confused about what needs to be done with the standard star.

For example,

I am looking at the following astronomical images that are fits files.

I understand that the dome and bias files need to be calibrated by subtracting the bias from the flat and normalizing it but what calibration needs to be done with the standard star?
 
Last edited:
  • #4
So after you've done the bias subtraction and flat normalization to the standard star file, you do the following:
(1) Take one of the standard stars and add up all of the signal within some radius. You'll have to decide how far out to go to get all of the light that arrived from the star.
(2) Now knowing the brightness of the star, the exposure time, the filter bandpass, and the telescope aperture, you should be able to calculate how many photons arrived at the telescope from the star in that time.
(3) This gives you the calibration factor from the signal as reported in your fits file to actual photons.

Does this make sense?
 
  • #5
phyzguy said:
So after you've done the bias subtraction and flat normalization to the standard star file, you do the following:
(1) Take one of the standard stars and add up all of the signal within some radius. You'll have to decide how far out to go to get all of the light that arrived from the star.
(2) Now knowing the brightness of the star, the exposure time, the filter bandpass, and the telescope aperture, you should be able to calculate how many photons arrived at the telescope from the star in that time.
(3) This gives you the calibration factor from the signal as reported in your fits file to actual photons.

Does this make sense?

Hmm, just so I understood correctly, the reason why we need to calibrate the standard star with the target is because the images are each slightly shifted from each other therefore we need to align the images? And in order to align the images we will need to choose one of the standard star which will be used to figure out how much each other frame is offset by in pixels?

I actually just opened both the target fits file and one standard star on DS9 and both images are noticiably different but are similar so what exactly is the difference between a standard star and target?
 
  • #6
What are you trying to do? Just make a pretty picture or do a quantitative measurement?
 
  • #7
phyzguy said:
What are you trying to do? Just make a pretty picture or do a quantitative measurement?

I am following this tutorial but with a different dataset in order to practice preprocessing (https://users.astro.ufl.edu/~ajtownsend/OBSTECH_REDUX_2017.html) . The thing that throws me off is that in that tutorial there were no standard stars. There were only BIAS, FLAT and TARGET. But in this dataset, it has BIAS, FLAT, STANDARD STARS and TARGET. I am not sure what I am suppose to do with the standard stars.
 
  • #8
The standard stars allow you to do quantitative photometric measurements. Without the standard stars you get an image, but you have no idea how bright anything is, quantitatively. If you have the locations of the standard stars, they also allow you to do quantitative astrometric measurements.
 
  • Like
Likes tryingtolearn1

1. What is the purpose of preprocessing FIT files?

The purpose of preprocessing FIT files is to correct for any bias and flat field variations in the raw data. This ensures that the final image is free from any artifacts or imperfections caused by the camera or telescope.

2. Why is bias correction important in preprocessing FIT files?

Bias correction is important because it removes any signal that is present in the image even when no light is hitting the camera. This signal can be caused by electronic noise or thermal effects, and if not corrected, can result in a noisy final image.

3. How does flat field correction improve the quality of FIT files?

Flat field correction removes any variations in the sensitivity of the camera or telescope across the image. This ensures that the final image has a uniform level of brightness and reduces any vignetting or other artifacts that may be present in the raw data.

4. What is the role of Python script in preprocessing FIT files?

Python script is used to automate the process of bias and flat correction. It allows for the correction to be applied consistently and efficiently to a large number of FIT files, saving time and reducing the potential for human error.

5. Are there any other preprocessing steps that should be taken before using FIT files for analysis?

Yes, there are other important preprocessing steps such as dark frame subtraction, which removes any thermal noise from long exposure images, and image calibration, which corrects for any optical distortions. These steps should be performed before bias and flat correction for the best results.

Similar threads

  • Programming and Computer Science
Replies
16
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
4K
Replies
9
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
Replies
7
Views
2K
Replies
9
Views
2K
Replies
152
Views
5K
Replies
10
Views
2K
  • Astronomy and Astrophysics
Replies
15
Views
4K
  • Programming and Computer Science
Replies
2
Views
2K
Back
Top