src.Libs.Simulation.Telescope package
Subpackages
- src.Libs.Simulation.Telescope.Functions package
- src.Libs.Simulation.Telescope.Specifications package
- Submodules
- src.Libs.Simulation.Telescope.Specifications.APEX module
- src.Libs.Simulation.Telescope.Specifications.Effelsberg module
- src.Libs.Simulation.Telescope.Specifications.EffelsbergSec module
- src.Libs.Simulation.Telescope.Specifications.Lovell module
- src.Libs.Simulation.Telescope.Specifications.MRO module
- src.Libs.Simulation.Telescope.Specifications.SRT_F1 module
- src.Libs.Simulation.Telescope.Specifications.SRT_F2 module
- Module contents
Submodules
src.Libs.Simulation.Telescope.TelescopeDataClass module
This file is part of the PAFFrontendSim.
The PAFFrontendSim is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3 as published by the Free Software Foundation.
The PAFFrontendSim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the PAFFrontendSim. If not, see https://www.gnu.org/licenses/.
- class src.Libs.Simulation.Telescope.TelescopeDataClass.Telescope(log=None)[source]
Bases:
object
This module represents the telescope and defines the surfaces for the optical physics simulation.
It contains methods to generate the primary and secondary reflectors as well as the sky and spillover regions. Blockage caused by support structures can be taken into account. Customs specifications and geometries can be imported as external Python modules. Optionally an atmosphere (through AtmosphereDataClass) and receiver optics (through OpticsDataClass) can be added to the simulation environment. This module uses the UFO modules to perform the optical physics simulation.
Initialize class.
- Parameters:
log (LogClass) – Logging Class used by the calling application.
- GregorianOrCass(wavelength, CalcSpill=True, RMS=0.0, spillPrim=True, TelRMS=0.0, TelDiam=12000.0, TelTaper=-12.0, TelPrimF=4800.0, TelSecDiam=750.0, TelSecR1=-294.0, TelSecR2=5880.0, TelBlockage=-1, TelLegWidth=50.0, TelLegRadius=3500.0, TelLegDistance=-1, TelRotSupport=0.0)[source]
Creates a generalized Gregorian or Cassegrain telescope.
- Parameters:
wavelength (float) – wavelength to adjust gridding
CalcSpill (boolean) – Shall the spill-over area be calculated and set for simulation
RMS (float) – RMS of the surface (< 0 : uses telescope RMS as measured; >= 0: uses given number for the surface RMS)
spillPrim (boolean) – flag if primary mirror outer spill-over is used or not (mainly because of calculation time for higher frequencies)
**kargs – as defined in constants for the telescope dictionaries
- Parabolic(wavelength, CalcSpill=True, RMS=0.0, spillPrim=True, TelRMS=0.0, TelDiam=100000.0, TelTaper=-12.0, TelPrimF=30000.0, TelBlockage=-1, TelLegWidth=-1, TelLegRadius=-1, TelLegDistance=-1, TelRotSupport=0.0)[source]
Creates a generalized Parabolic main dish (primary focus telecope).
- Parameters:
wavelength (float) – wavelength to adjust gridding
CalcSpill (boolean) – Shall the spill-over area be calculated and set for simulation
RMS (float) – RMS of the surface (< 0 : uses telescope RMS as measured; >= 0: uses given number for the surface RMS)
spillPrim (boolean) – flag if primary mirror outer spill-over is used or not (mainly because of calculation time for higher frequencies)
**kargs – as defined in constants for the telescope dictionaries
- addOptics(optics=None, FocalPoint=[0, 0, 0])[source]
Adds a fore-optics to the telescope.
- Parameters:
optics (OpticsData) – optics to be added. The output port of the optics is connected to the telescope, simulation starts at the input port. If no optics is given, an existing optics is removed.
FocalPoint (3d point, float) – point in the focal plane at which the receiver beam is entering (usually the center, but for of-axis optics an offset can be given).
- attemptTelescopeDataImport(telescopePath, moduleType, name)[source]
Attempts to retrieve a module of telescope data.
It checks if the file exists and uses self.importTelescopeDict() to import the data in said file.
- Parameters:
telescopePath (Path) – The path preceding the folder in which the module is expected to be located.
moduleType (String) – Name of the module’s folder. Must be either “Specifications” or “Functions”.
name (String) – Name of the module, excluding the “.py” file-extension.
- Returns:
telescopeDataDict (dict) – Contains the data found in the module, otherwise None.
- createFromSpecs(telDict, wavelength, CalcSpill, RMS, spillPrim)[source]
Create the telescope assembly.
- Parameters:
wavelength (float) – spacial rastering of the telescope along this dimension
CalcSpill (boolean) – Add spill over calculation to the telescope model (only useful if a noise model is established)
RMS (float) – Main dish RMS (if negative telescope nominal RMS is used)
spillPrim (boolean) – indicating if primary spill-over area is used or not
- createWithFunction(wavelength, CalcSpill, RMS, spillPrim)[source]
Creates a telescope using an external function.
If a corresponding specification dictionary exists then it is passed to the function. The function might require it for calculations and it might return the dictionary with modified specifications.
- Parameters:
wavelength (float) – spacial rastering of the telescope along this dimension
CalcSpill (boolean) – Add spill over calculation to the telescope model (only useful if a noise model is established)
RMS (float) – Main dish RMS (if negative telescope nominal RMS is used)
spillPrim (boolean) – indicating if primary spill-over area is used or not
- extractET(minR=-1, obj=0)[source]
Extracts the edge-taper of the power distribution after simulation on object number obj using the minimum radius of minR. It averages all values above the given radius.
- Parameters:
minR (float) – If negative, value is set to 98% of the nominal radius of the object being analyzed
obj (int) – Number of the object to look at (per default it is the first object in the simulation sequence)
- Returns:
float – Value in dB
- getAngularSizes(diam, distance, raster, conicData, focalPointDistance=None)[source]
Iteratively calculate angular size of a conical section from its linear diameter. This includes the curvature of the surface.
- Parameters:
diam (float) – diameter [mm] of the object (resulting in an angular size in theta direction)
distance (float) – distance [mm] of the origin to the conical surface vertex
raster (float) – linear raster size [mm], gets converted to an angulat step-size
conicData (list) – conicData of the conical surface as calculated by UFO.UFOGaussCalc.calcConicData
focalPointDistance (float) – distance of the conical surface reflection point to the focal point
- Returns:
tuple (tuple) – sizeDeg (float, degree), radius (float, mm, from origin to surface edge), rasterDeg (float, angular raster (float, degree), converged (boolean, flag)
- importAtmosphere(folder, name, season, pwv)[source]
Attempts to import new atmospheric data for using AtmosphereDataClass.
If the file doesn’t exist then nothing is done.
- Parameters:
folder (string) – Path of the folder the file is expected in
name (string) – Name of the telescope
season (string) – Season of the data (in 3 letter format)
pwv (string) – Perceptible water vapor in percent
- importTelescopeDict(moduleString, name)[source]
Imports a Python module containing the definition of a telescope.
Modules must define a telescope either through a dictionary of specifications or a function.
- Parameters:
moduleString (string) – Import string of the module.
name (string) – Name of the telescope.
- Returns:
telescopeDataDict (dict) – Contains either the specifications of the telescope or a description + function call.
- makePrimary(wavelength, PrimF, primZpos, primRot=True, CalcSpill=True, blockage=-1.0, legWidth=-1.0, legRadius=-1.0, legDistance=-1.0, spillPrim=True, rotSupport=0.0)[source]
Create the primary mirror out of the data set in the class.
- Parameters:
wavelength (float) – wavelength in mm for which the rastering of the surface is calculated. This is the lower end of the usable frequency range for simulations
PrimF (float) – focal length of the secondary mirror [mm]
primZpos (float) – z-position of the primary vertex [mm]
primRot (boolean) – False = facing upwards, no rotation, True = facing downwards means rotating sky
CalcSpill (boolean) – indicating if a spill over region is calculated and inserted into the simulation setup.
blockage (float) – radius of central blockage [mm]; if negative, default value is calculated (size of the sub-reflector)
legWidth (float) – leg-half-width [mm]; if negative, default value of 0. mm is taken
legRadius (float) – radius at which the support legs hit the subreflector [mm]; if negative, primary radius is taken
legDistance (float) – radial distance at which the legs pass the primary focal point [mm], if negative, subreflector radius is taken.
rotSupport (float) – Angle of the support of the secondary (0 : horizontal and vertical)
- makeSecondary(wavelength, SecR2, SecF, CalcSpill=True)[source]
Create the secondary mirror out of the data set in the class.
- Parameters:
wavelength (float) – wavelength in mm for which the rastering of the surface is calculated. This is the lower end of the usable frequency range for simulations
SecR2 (float) – distance to phase center [mm], or distance to nominal geometric focus point (this is equivalent for geometric optics)
SecF (float) – focal length of the secondary mirror [mm]
CalcSpill (boolean) – indicating if a spill over region is calculated and inserted into the simulation setup.
- makeSky(primZpos=0.0, primRot=False, wavelength=90.0, skySize=25)[source]
Create the sky representation for the simulation.
- Parameters:
primZpos (float) – z-position of the primary vertex [mm]
primRot (boolean) – False = facing upwards, no rotation, True = facing downwards means rotating sky
- makeSpill(ufo, center=[0.0, 0.0, 0.0])[source]
Points given in the ufo-object are arranged on a sphere with the center center. The system is rotated until the refPoint and the sphere center are aligned on the z-axis. All z coordinates are then replaced by values bringing them on the shpere. Sphere radius is the length of the difference vector between refPoint and center.
- Parameters:
ufo (ufo-object) – to modify
center (list) – vector pointing to the spill-over center
- plotTelescope(figname='', show=False)[source]
Plot the telescope projections.
- Parameters:
figname (string) – file-name of the figure (if given figure is only shown on screen if show == True
show (boolean) – flag to show plot on screen even when being written to disk (True)
- printOut(line, message_type, prefix=True, lineFeed=True)[source]
Wrapper for the printOut method of the actual log class.
- setTelescope(name, wavelength=90.0, folder='', CalcSpill=True, Raster=1, RMS=0, spillPrim=True, Elevation=90.0)[source]
Set and create a telescope
- Parameters:
name (string) – The name of the telescope we want to use
wavelength (float) – spacial rastering of the telescope along this dimension
folder (string) – If given, folder where the telescope data files are stored for debugging
CalcSpill (boolean) – Add spill over calculation to the telescope model (only useful if a noise model is established)
Raster (float) – Multiplicator for internal telescope rastering (sometimes required for higher frequencies)
RMS (float) – Main dish RMS (if negative telescope nominal RMS is used)
spillPrim (boolean) – indicating if primary spill-over area is used or not
Elevation (float) – Elevation in degrees at which the telescope is created. 90deg corresponds to zenith (default)
- simulate(farfield, scaleWaveLength=-1)[source]
Simulate the far-field pattern ‘farfield’ and return sky and spill-over region data.
- Parameters:
farfield (FarFieldDataClass) – With the farfield of the antenna
scaleWaveLength (int) – Wavelength to scale the sky-size with (if negative, farfield wavelength is taken)
- Returns:
sky (UFODataClass) – with type ‘CURRENT’ of the sky beam-pattern
spill list of (UFODataClass) – with type ‘CURRENT’ of the spill-over area without temperature weighting
spillT list of (UFODataClass) – with type ‘CURRENT’ of the spill-over area with temperature weighting
- simulateAndAnalyze(farfield, scaleWavelength=-1, SignalChain=None, center=[0.0, 0.0, 0.0], useMax=False, lossTemp=-1, lossField=None, lossFieldT=None, inputPower=None)[source]
Outdated, check if it is in still in use and delete the function
Simulate the far-field pattern ‘farfield’ and return sky and spill-over region data.
- Parameters:
farfield (FarFieldDataClass) – With the farfield of the antenna
scaleWavelength (float) – Wavelength to scale the sky-size with (if negative, farfield wavelength is taken)
SignalChain (SignalChainDataClass) – To calculate rx noise and so on
center (list) – 3D vector defining the beam-center for the analysis
useMax (boolean) – True indicates to use the maximum intensity as beam-center
lossTemp (float) – Temperature [K] at which the losses are realized (negative value uses the default from PAF-simulations)
lossField (ufoDataClass) – with field data representing the losses
lossFieldT (ufoDataClass) – ufoDataClass with field data representing the temperature correted losses. lossField and lossFieldT must be given together to have an effect
inputPower (float or None) – positive value gives the inputPower into the telescope, None: input power is calculated from input surface, negative: use full power as from excitation current
- Returns:
tuple (tuple) – sky, spill, spillT, DataPack – UFOData of the simulation, and a list of analysis data