astrohack.cassegrain_ray_tracing¶
Module Contents¶
Functions¶
|
Create a dictionary with a cassegrain telescope parameters |
|
Execute the cassegrain ray tracing pipeline to determine phase effects caused by optical mis-alignments. |
|
Plot 2D maps of keys in the ray tracing Xarray Dataset |
|
Plot a radial projection of some of the rays simulated in the ray tracing Xarray Dataset. |
|
Feed phase image from ray tracing Xarray dataset to Astrohak’s default phase fitting tool for VLA data. |
-
create_ray_tracing_telescope_parameter_dict(primary_diameter: Union[float, int] = 25, secondary_diameter: Union[float, int] = 2.5146, focal_length: Union[float, int] = 9.0, z_intercept: Union[float, int] = 3.14, foci_half_distance: Union[float, int] = 3.662, inner_radius: Union[float, int] = 2.0, horn_diameter: Union[float, int] = 0.2, length_unit: str = 'm')[source]¶ Create a dictionary with a cassegrain telescope parameters
- Parameters
primary_diameter (float, int, optional) – Diameter of the primary mirror.
secondary_diameter (float, int, optional) – Diameter of the secondary mirror.
focal_length (float, int, optional) – Focal length of the primary mirror.
z_intercept (float, int, optional) – Distance between the Z intercept of the secondary and the mid-point between the primary and secondary focus, usually refered to as ‘a’.
foci_half_distance (float, int, optional) – Half-distance between the primary and secondary foci, usually refered to as ‘c’.
inner_radius (float, int, optional) – Inner valid surface radius of the primary reflector, usually refered to as Blockage.
horn_diameter (float, int, optional) – Diameter of the horn detecting the signals, used to determine if rays are detected or lost.
length_unit (str, optional) – Unit for the telescope dimensions, default is “m”.
- Returns
A dictionary filled with the user inputs and also the horn position and orientation.
- Return type
dict
Create a basic description of a Cassegrain radio telescope from user inputs. This function assumes that the horn is positioned at the secondary focus and is pointed directly upwards, i.e. an axi-symmetric design. Default values reflect the values for the VLA available in EVLA memo 211.
-
cassegrain_ray_tracing_pipeline(output_xds_filename: str, telescope_parameters: dict, grid_size: Union[float, int] = 28, grid_resolution: Union[float, int] = 0.1, grid_unit: str = 'm', x_pointing_offset: Union[float, int] = 0, y_pointing_offset: Union[float, int] = 0, pointing_offset_unit: str = 'asec', x_focus_offset: Union[float, int] = 0, y_focus_offset: Union[float, int] = 0, z_focus_offset: Union[float, int] = 0, focus_offset_unit: str = 'mm', phase_offset: Union[float, int] = 0, phase_unit: str = 'deg', observing_wavelength: Union[float, int] = 1, wavelength_unit: str = 'cm', overwrite: bool = False)[source]¶ Execute the cassegrain ray tracing pipeline to determine phase effects caused by optical mis-alignments.
- Parameters
output_xds_filename (str) – Filename for the output Xarray dataset on disk using a Zarr container.
telescope_parameters (dict) – Dictionary containing the parameters of the cassegrain telescope in use.
grid_size (float, int, optional) – Size of the grid onto which to compute phase effects in grid_unit.
grid_resolution (float, int, optional) – Resolution of the grid onto which to compute phase effects in grid_unit.
grid_unit (str, optional) – Length unit for grid_size and grid_resolution, default is “m”.
x_pointing_offset (float, int, optional) – X Pointing offset in pointing_offset_unit.
y_pointing_offset (float, int, optional) – Y Pointing offset in pointing_offset_unit.
pointing_offset_unit (str, optional) – Angle unit for pointing offsets, default is “asec”.
x_focus_offset (float, int, optional) – X offset of the secondary in focus_offset_unit.
y_focus_offset (float, int, optional) – Y offset of the secondary in focus_offset_unit.
z_focus_offset (float, int, optional) – Z offset of the secondary in focus_offset_unit, what is usually refered to as simply focus.
focus_offset_unit (str, optional) – Length unit for focus offsets, default is “mm”.
phase_offset (float, int, optional) – A phase offset to be applied to the phase image.
phase_unit (str, optional) – Angle unit for the phase offset, default is “deg”.
observing_wavelength (float, int, optional) – Wavelength of the rays to be simulated in wavelength unit.
wavelength_unit (str, optional) – Length unit for the observing wavelength, default is “cm”.
overwrite (bool, optional) – Overwrite rt_xds file on disk, default is False.
- Returns
X array dataset object with the results from the ray tracing.
- Return type
xr.Dataset
Code Outline
A Gridded representation of the primary dish and the normal to its surface are created and stored in an XDS.
The reflection between the incident light and the primary mirror is computed for each of the gridded points.
The reflected rays from the primary are progated and the intercept between them and the secondary is calculated.
Compute the reflection at the secondary for each ray reflected at the primary that touches it.
Check which rays from the secondary intercept the mouth of the horn.
Compute the total path from the rim of the primary up to horn for detected rays.
Compute the phase for each ray based on the total path.
Limitations
This ray tracing code only aims at estimating aperture phases, not its amplitude.
Detection from sidelobes is not estimated.
Beam shape estimations cannot be computed from the results as amplitudes are not modeled.
This model is axi-symmetric, i.e. it cannot be used to estimate the full range of phase effects present in VLA apertures.
If large pointing or focus offsets are chosen the rays may stop intercepting the horn and hence produce partially or fully blank phase images.
-
plot_2d_maps_from_rt_xds(rt_xds_filename: str, keys: Union[str, list], rootname: str, phase_unit: str = 'deg', length_unit: str = 'm', colormap: str = 'viridis', display: bool = True, dpi: int = 300)[source]¶ Plot 2D maps of keys in the ray tracing Xarray Dataset
- Parameters
rt_xds_filename (str) – Name on disk of the Xarray dataset containing the results of the Ray tracing pipeline
keys (str, list) – Key or keys in rt_xds to be plotted.
rootname (str) – Root name for the plots to be created.
phase_unit (str, optional) – Unit for the phase plot, default is “deg”.
length_unit (str, optional) – Unit for the plots of keys other than phase, default is “m”.
colormap (str, optional) – Colormap to be used for plots, default is “viridis”.
display (bool, optional) – Display plots inline or suppress, defaults to True
dpi (int, optional) – dots per inch to be used in plots, default is 300
Produce plots from the Xarray dataset containing ray tracing results for analysis. All Xarray dataset data variables except for the x and y axes can be plotted.
-
plot_radial_projection_from_rt_xds(rt_xds_filename: str, plot_filename: str, nrays: int = 20, display: bool = True, dpi: int = 300)[source]¶ Plot a radial projection of some of the rays simulated in the ray tracing Xarray Dataset.
- Parameters
rt_xds_filename (xr.Dataset) – Name on disk of the Xarray dataset containing the results of the Ray tracing pipeline
plot_filename (str) – Name of the file to contain the plot.
nrays (int, optional) – Number of random rays to be plotted, default is 20.
display (bool, optional) – Display plot inline or suppress, default is True
dpi (int, optional) – dots per inch to be used in plots, default is 300
Produce a plot of a random selection of nrays that are present on the input Xarray dataset.
-
apply_holog_phase_fitting_to_rt_xds(rt_xds_filename: str, phase_plot_filename: str, fit_pointing_offset: bool = True, fit_xy_secondary_offset: bool = True, fit_focus_offset: bool = True, phase_unit: str = 'deg', colormap: str = 'viridis', display: bool = True, dpi: int = 300)[source]¶ Feed phase image from ray tracing Xarray dataset to Astrohak’s default phase fitting tool for VLA data.
- Parameters
rt_xds_filename (xr.Dataset) – Name on disk of the Xarray dataset containing the results of the Ray tracing pipeline
phase_plot_filename (str) – filename for the plot containing the RT phase image the fitted phase effects and the residuals
fit_pointing_offset (bool, optional) – Toggle to determine if pointing offsets are to be fitted, default is True.
fit_xy_secondary_offset – Toggle to determine if lateral displacements of the secondary are to be fitted,
default is True. :type fit_xy_secondary_offset: bool, optional
- Parameters
fit_focus_offset (bool, optional) – Toggle to determine if vertical displacements of the secondary are to be fitted, default is True.
phase_unit (str, optional) – Unit for the phase plot, default is “deg”.
colormap (str, optional) – Colormap to be used for plots, default is “viridis”.
display (bool, optional) – Display plots inline or suppress, defaults to True
dpi (int, optional) – dots per inch to be used in plots, default is 300
Apply the phase fitting engine used in
astrohack.holog.hologto the phase image computed by the ray tracing pipeline. At the end of the fitting produces a table so that fitting results can be compared to the inputs given for the ray tracing pipeline. Along with the table a plot is produced containing the ray tracing modelled phases, the correction derived from the phase fitting tool and the residuals of the fitting. For easier comparison simple statistics of each image are provided.