en:praktikum:sternspektren_baches

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:praktikum:sternspektren_baches [2024/12/06 09:31] – [Report] rhainichen:praktikum:sternspektren_baches [2025/04/02 09:10] (current) – [Reduce the data] rhainich
Line 33: Line 33:
  
    Star_1/    Star_1/
-      Darks+      darks
-      Flatdarks+      flat_darks
-      Flats/+      ThAr_darks/ 
 +      flats/
       ThAr/       ThAr/
       Star_1/       Star_1/
    Star_2/    Star_2/
-      Darks+      darks
-      Flatdarks/+      flat_darks/
       ...       ...
  
Line 87: Line 88:
 The scripts for the data reduction can be found on the [[en:praktikum: zugang| lab course computer]] in the folder ''~/scripts/n1_baches''. Copy the script ''1_masterimages.py'' into the local directory where you want to analyze the star (e.g. ''Star_1''). This script will create among other files the masterdark and the masterflat needed in the following processing steps. Furthermore, this script stacks all star images, if more than one was taken during the observations. It also offers the possibility to bin the observed images, if this was not done during the observation. It also cuts not needed parts of the captured images. This simplifies the further analysis steps. Last but not least, you should specify in this script if the exposures have to be mirrored (see previous step), so that this can be corrected as well. The configuration area of the script looks like this: The scripts for the data reduction can be found on the [[en:praktikum: zugang| lab course computer]] in the folder ''~/scripts/n1_baches''. Copy the script ''1_masterimages.py'' into the local directory where you want to analyze the star (e.g. ''Star_1''). This script will create among other files the masterdark and the masterflat needed in the following processing steps. Furthermore, this script stacks all star images, if more than one was taken during the observations. It also offers the possibility to bin the observed images, if this was not done during the observation. It also cuts not needed parts of the captured images. This simplifies the further analysis steps. Last but not least, you should specify in this script if the exposures have to be mirrored (see previous step), so that this can be corrected as well. The configuration area of the script looks like this:
  
-   ############################################################################ + 
-   ####           Configuration: modify the file in this section           #### +<code Python> 
-   ############################################################################+############################################################################ 
 +####           Configuration: modify the file in this section           #### 
 +############################################################################
        
-   ### +### 
-   #   Path to the directories with the images +#   Path to the directories with the images 
-   +
-   #   Darks: +#   Darks: 
-   path_darks = '?'+path_darks: str = '?'
        
-   #   Flat darks: +#   Flat darks: 
-   path_flat_darks = '?'+path_flat_darks: str = '?'
        
-   #   Flats: +#   Flats: 
-   path_flats = '?'+path_flats: str = '?' 
 + 
 +#   Darks for wavelength calibration exposures: 
 +path_wavelength_darks: str = '?' 
 + 
 +#   Wavelength calibration exposures: 
 +path_wavelength: str = '?' 
 + 
 +#   Spectra: 
 +path_spectra: str = '?'
        
-   #   Thorium Argon exposures: +#   Output directory for the reduced flats. The master files will be saved in 
-   path_thorium_argon = '?'+  the current directory. 
 +out_path: str = 'output'
        
-   #   Spectra+### 
-   path_spectra '?'+#   Flip images? PossibilitiesTrue and False 
 +
 +flip_images: bool False
        
-     Output directory for the reduced flats. The master files will be saved in +### 
-   #   the current directory. +#   Bin the images? Possibilities: True and False 
-   out_path 'output'+
 +bin_images: bool False
        
-   ##+  Binning factor 
-   #   Flip images? PossibilitiesTrue and False +binning_valuebool 2
-   # +
-   flip_images False+
        
-   ### +### 
-   #   Bin the images? Possibilities: True and False +#   Trim images to remove non essential parts and thus simplify MIDAS handling 
-   # +#   Possibilities: True and False; Default: True 
-   bin_images = False +
-    +trim_image: bool = True 
-   #   Binning factor +</code>
-   binning_value = 2 +
-    +
-   ### +
-   #   Trim images to remove non essential parts and thus simplify MIDAS handling +
-   #   Possibilities: True and False; Default: True +
-   +
-   trim_image = True+
  
-In ''path_darks'', ''path_flat_darks'', ''path_flats'', ''path_thorium_argon'' and ''path_spectra'' the corresponding subfolders are to be entered, which were created in section //Preparations//. ''out_path'' is the directory where the script places intermediate results. The reduced files (**master_dark.fit**, **master_flat.fit**, **master_thar.fit**, **master_spectrum.fit**) are stored in the local directory so that they are more easily available for the following analysis steps. +In ''path_darks'', ''path_flat_darks'', ''path_flats'', ''path_wavelength_darks'', ''path_wavelength'', and ''path_spectra'' the corresponding subfolders are to be entered, which were created in section //Preparations//. The variable ''path_wavelength_darks'' can be set to **'?'** if no darks were taken for the ThAr exposures. ''out_path'' is the directory where the script places intermediate results. The reduced files (**master_dark.fit**, **master_flat.fit**, **master_wave.fit**, **master_spectrum.fit**) are stored in the local directory so that they are more easily available for the following analysis steps. 
  
 If you want to mirror the recordings you have to set ''flip_images'' to ''True''. If the images should also be binned, set ''bin_images'' to ''True''. The binning factor can be determined via the variable ''binning_value''. If you want to mirror the recordings you have to set ''flip_images'' to ''True''. If the images should also be binned, set ''bin_images'' to ''True''. The binning factor can be determined via the variable ''binning_value''.
Line 186: Line 193:
 The identification of the individual orders, the identification of the emission lines in the ThAr spectrum, and the correlation between the pixel and the wavelength scale is performed by the //MIDAS// script ''calibrate/baches''. The call could look like: The identification of the individual orders, the identification of the emission lines in the ThAr spectrum, and the correlation between the pixel and the wavelength scale is performed by the //MIDAS// script ''calibrate/baches''. The call could look like:
  
-   calibrate/baches master_flat.fit master_thar.fit 26 26 24+   calibrate/baches master_flat.fit master_wave.fit 26 26 24
  
 The five parameters have the following meaning: The five parameters have the following meaning:
Line 201: Line 208:
    ===============================    ===============================
    Flat field  = master_flat.fit    Flat field  = master_flat.fit
-   Calibration lamp = master_thar.fit+   Calibration lamp = master_wave.fit
    Calibration table = thar.fit    Calibration table = thar.fit
    Num. of orders  = 0026    Num. of orders  = 0026
Line 235: Line 242:
 In this case, the script should be stopped by entering a ''2''. Afterwards the script can be restarted with a reduced number of orders, e.g.: In this case, the script should be stopped by entering a ''2''. Afterwards the script can be restarted with a reduced number of orders, e.g.:
  
-   calibrate/baches master_flat.fit master_thar.fit 23 20 20+   calibrate/baches master_flat.fit master_wave.fit 23 20 20
  
 A solid method is to gradually reduce the number of orders until the script executed successfully. Afterwards, the flatfield with the identified orders will be displayed in an external window (see below). It should be checked whether the marks of the orders are horizontal and whether they coincide with the actual orders that are visible on the flatfield. The left figure shows a successful test run, whereas the middle figure depicts a failure. The right figure shows a flatfield image taken with the QHY268M, where it can happen that //MIDAS// does not finish drawing all identified orders. From the order numbers, however, it can be assessed if all orders were successfully identified or not. The numbers also depend on whether the images are binned. As we usually use 2x2 binning, the above values should suffice. In case we have used 1x1 binning for the spectra however, you might have to double the second and third value. A solid method is to gradually reduce the number of orders until the script executed successfully. Afterwards, the flatfield with the identified orders will be displayed in an external window (see below). It should be checked whether the marks of the orders are horizontal and whether they coincide with the actual orders that are visible on the flatfield. The left figure shows a successful test run, whereas the middle figure depicts a failure. The right figure shows a flatfield image taken with the QHY268M, where it can happen that //MIDAS// does not finish drawing all identified orders. From the order numbers, however, it can be assessed if all orders were successfully identified or not. The numbers also depend on whether the images are binned. As we usually use 2x2 binning, the above values should suffice. In case we have used 1x1 binning for the spectra however, you might have to double the second and third value.
Line 513: Line 520:
 | ''percentage_line_flux_must_be_below_continuum'' | This variable determines how deep lines must be in comparison to the continuum so that line identifications are displayed for the corresponding lines. The higher this value, the fewer line identifications are displayed, since only the stronger lines then fulfill this criterion. **Note:** If the radial velocity is wrong and a value greater than zero is set here, then the line identification often does not work. Therefore this variable should be set to zero if the radial velocity is unknown. | | ''percentage_line_flux_must_be_below_continuum'' | This variable determines how deep lines must be in comparison to the continuum so that line identifications are displayed for the corresponding lines. The higher this value, the fewer line identifications are displayed, since only the stronger lines then fulfill this criterion. **Note:** If the radial velocity is wrong and a value greater than zero is set here, then the line identification often does not work. Therefore this variable should be set to zero if the radial velocity is unknown. |
  
- +<code Python> 
-   ############################################################################ +############################################################################ 
-   ####          Configuration: modify the file in this section            #### +####          Configuration: modify the file in this section            #### 
-   ############################################################################+############################################################################
        
-   #   Name of file with individual orders +#   Name of file with individual orders 
-   file_with_orders = "master_spectrum_wr.fit"+file_with_orders = "master_spectrum_wr.fit"
        
-   #   Name of file with merged spectrum +#   Name of file with merged spectrum 
-   file_with_merged_spectrum = "master_spectrum_wrm.fit"+file_with_merged_spectrum = "master_spectrum_wrm.fit"
        
-   #   Name of the object +#   Name of the object 
-   object_name = "?"+object_name = "?"
        
              
-   ### +### 
-   #   Radial velocity [km/s] +#   Radial velocity [km/s] 
-   #       The specification of the radial velocity is necessary for the +#       The specification of the radial velocity is necessary for the 
-   #       line identification to work correctly (see below). +#       line identification to work correctly (see below). 
-   radial_velocity = 0.+radial_velocity = 0.
        
        
-   ### +### 
-   #   Line identifications +#   Line identifications 
-   +
-   #   Ions for which line markers are to be drawn. +#   Ions for which line markers are to be drawn. 
-   #   Example: ["HI", "FeI", ...] +#   Example: ["HI", "FeI", ...] 
-   ions = []+ions = []
        
-   #   Add lines that are not in the default database +#   Add lines that are not in the default database 
-   #   Format: {"Element descriptor": [[wavelength, alignment parameter]]} +#   Format: {"Element descriptor": [[wavelength, alignment parameter]]} 
-   #           alignment parameter possibilities: "center", "left", "right" +#           alignment parameter possibilities: "center", "left", "right" 
-   manual_lines = {"Example Element": [[0.,"center"]], "Example Element 2": [[0.,"left"]]}+manual_lines = {"Example Element": [[0.,"center"]], "Example Element 2": [[0.,"left"]]}
        
-   #   Percent the line flux must be lower than the continuum +#   Percent the line flux must be lower than the continuum 
-   percentage_line_flux_must_be_below_continuum = 3.+percentage_line_flux_must_be_below_continuum = 3. 
 +</code>
  
 Execute the script with: Execute the script with:
  • en/praktikum/sternspektren_baches.1733477519.txt.gz
  • Last modified: 2024/12/06 09:31
  • by rhainich