The Sector class¶
The Sector class is used to manage imaging parameters for an image.
- class rapthor.lib.sector.Sector(name, ra, dec, width_ra, width_dec, field)¶
The Sector object contains various parameters for a sector of the field. Sectors are used only in image and predict operations
- Parameters:
- namestr
Name of sector
- rafloat
RA in degrees of sector center
- decfloat
Dec in degrees of sector center
- width_rafloat
Width of sector in RA degrees
- width_decfloat
Width of sector in Dec in degrees
- fieldField object
Field object
- filter_skymodel(skymodel, invert=False)¶
Filters input skymodel to select only sources that lie inside the sector
- Parameters:
- skymodelLSMTool skymodel object
Input sky model
- invertbool, optional
If True, invert the selection (so select only sources that lie outside the sector)
- Returns:
- filtered_skymodelLSMTool skymodel object
Filtered sky model
- get_distance_to_obs_center()¶
Return the overall minimum and maximum distance in degrees from any sector vertex (and sector center) to the phase center of the observation
- Returns:
- min_dist, max_distfloat, float
Minimum and maximum distance in degrees
- get_matplotlib_patch(wcs=None)¶
Returns a matplotlib patch for the sector polygon
- Parameters:
- wcsWCS object, optional
WCS object defining (RA, Dec) <-> (x, y) transformation. If not given, the field’s transformation is used
- Returns:
- patchmatplotlib patch object
The patch for the sector polygon
- get_nwavelengths(cellsize_deg, timestep_sec)¶
Returns nwavelengths for WSClean BL-based averaging
The value depends on the integration time given the specified maximum allowed smearing. We scale it from the imaging cell size assuming normal sampling as:
max baseline in nwavelengths = 1 / theta_rad ~= 1 / (cellsize_deg * 3 * pi / 180) nwavelengths = max baseline in nwavelengths * 2 * pi * integration time in seconds / (24 * 60 * 60) / 4
- Parameters:
- cellsize_degfloat
Pixel size of image in degrees
- timestep_secfloat
Length of one timestep in seconds
- get_obs_parameters(parameter)¶
Returns list of parameters for all observations
- Parameters:
- parameterstr
Name of parameter to return
- Returns:
- parameterslist
List of parameters, with one entry for each observation
- get_vertices_radec()¶
Return the vertices as RA, Dec for the sector boundary
- intialize_vertices()¶
Determines the vertices of the sector polygon
- make_region_file(outputfile, region_format='ds9')¶
Make a ds9 or CASA region file for the sector boundary
- Parameters:
- outputfilestr
Name of output region file
- region_formatstr, optional
Format of region file: ‘ds9’ or ‘casa’
- make_skymodel(index)¶
Makes predict sky model
- Parameters:
- indexint
Processing cycle index
- make_vertices_file()¶
Make a vertices file for the sector boundary
- set_imaging_parameters(do_multiscale=False, recalculate_imsize=False, imaging_parameters=None, preapply_dde_solutions=False)¶
Sets the parameters needed for the imaging operation
- Parameters:
- do_multiscalebool, optional
If True, multiscale clean is done
- recalculate_imsizebool, optional
If True, the image size is recalculated based on the current sector region
- imaging_parametersdict, optional
Dict of imaging parameters to use instead of those defined by the field’s parset. If supplied, the following keys are expected to be present:
‘cellsize_arcsec’: cell (pixel) size in arcsec ‘robust’: Briggs robust value ‘taper_arcsec’: taper in arcsec ‘local_rms_strength’: local RMS strength factor ‘local_rms_window’: local RMS window size ‘local_rms_method’: local RMS method ‘min_uv_lambda’: minimum uv distance cut in lambda ‘max_uv_lambda’: maximum uv distance cut in lambda ‘mgain’: cleaning gain ‘idg_mode’: IDG processing mode ‘mem_gb’: maximum memory in GB ‘reweight’: reweighting flag ‘dd_psf_grid’: DD PSF grid ‘max_peak_smearing’: maximum allowed peak smearing
- preapply_dde_solutionsbool, optional
If True, use setup appropriate for case in which all DDE solutions are preapplied before imaging is done
- set_prediction_parameters()¶
Sets the predict parameters