galight.data_process package¶
Submodules¶
galight.data_process module¶
Created on Thu Sep 10 09:10:39 2020
@author: Xuheng Ding
A class to process the data
- class galight.data_process.DataProcess(fov_image=None, target_pos=None, pos_type='pixel', header=None, exptime=None, fov_noise_map=None, rm_bkglight=False, if_plot=False, zp=None, **kwargs)[source]¶
Bases:
object- A class to Process the data, including the following feature:
automaticlly estimate and remove background light.
cutout the target photo stamp.
search all the avaiable PSF in the field.
creat mask for the objects.
measure the target surface brightness profile, PSF FWHM, background.
- fov_image: 2D array.
The field of view image of the data.
- target_pos: list or tuple or array, length = 2.
The position of the target.
- pos_type: string.
‘pixel’ or ‘wcs’ Define the position of the target, i.e., if the position is in ‘pixel’ or ‘wcs’.
- header: io.fits.header.Header.
-The header information given by the fits file. Note: should including the exposure time and WCS information.
- exptime: float / 2D array.
The exposure time of the data in (s) a the exptime_map
- fov_noise_map: 2D array.
The field of view noise map, should have same shape as the ‘fov_image’.
- rm_bkglight: bool.
If ‘True’, the FOV background light will be modeled and removed.
- if_plot: bool.
If ‘True’, the plots will made during the data processing.
- zp: float.
The zeropoint of the telescope. To calcualte the magnitude. If not provided will assign as 27.0
- find_PSF(radius=50, PSF_pos_list=None, pos_type='pixel', psf_edge=120, FWHM_sort=False, if_filter=False, FWHM_filer=None, user_option=False, select_all=False, nearyby_obj_filter=False, **kwargs)[source]¶
Find all the available PSF candidates in the field of view.
- radius: int/float.
The radius of the cutout frames of the PSF. PSF size = 2*radius + 1
- PSF_pos_list: None or list of position.
Input a list if PSF star position has decided.
- pos_type: string.
‘pixel’ or ‘wcs’ Define the position of the target
- user_option: bool.
Only works when PSF_pos_list = None.
- psf_edge: int/float.
The PSF should be avoid at the edge by how many pixels.
- neighborhood_size (**kwargs): digit.
Define the region size to filter the local minima.
- threshold {**kwargs}: digit.
Define the significance (flux value) of the maximazation point. The lower, the more would be found.
- generate_target_materials(cut_kernel=None, radius=None, radius_list=None, bkg_std=None, if_select_obj=False, create_mask=False, if_plot=None, use_moments=True, show_materials=None, skip=False, **kwargs)[source]¶
Prepare the fitting materials to used for the fitting, including the image cutout, noise map and masks (optional). More important, the apertures that used to define the fitting settings are also generated.
- cut_kernel: string or ‘None’.
The args will be input as kernel into galight.tools.cutout_tools.cut_center_auto()
- radius: int or float
The radius to cutout the image data. The final framesize will be 2*radius+1
- cut_kernel: None or ‘center_gaussian’ or ‘center_bright’.
if ‘None’, directly cut.
if ‘center_gaussian’, fit central as 2D Gaussian and cut at the Gaussian center.
if ‘center_bright’, cut the brightest pixel in the center
- bkg_std: float
To input the background noise level.
- if_select_obj:
if ‘True’, only selected obj will be modelled.
- create_mask: bool.
‘True’ if to define a mask based on the apertures. Note that the corresponding aperture will de removed automaticlly.
- if_plot: bool.
If ‘True’, the plots will made during the cut out.
- **kwargs:
Arguments can also passed to detect_obj()
- plot_overview(**kargs)[source]¶
Use galight.tools.cutout_tools.plot_overview to plot image overview.