-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 79d06c8
Showing
68 changed files
with
11,029 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 2eb3af4a329af07b2e72d057c034206b | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
fast.ao_power_spectra | ||
===================== | ||
|
||
.. py:module:: fast.ao_power_spectra | ||
Module Contents | ||
--------------- | ||
|
||
.. py:function:: zernike_ft(fabs, phi, D, n_noll) | ||
.. py:function:: zernike_filter(fabs, fx, fy, D, n_noll, n_noll_start=1, gamma=None) | ||
.. py:function:: zernike_squared_filter(fabs, fx, fy, D, n_noll, n_noll_start=1, gamma=None, plusminus=False) | ||
.. py:function:: piston_gtilt_filter(fabs, fx, fy, D) | ||
.. py:function:: piston_filter(fabs, D) | ||
.. py:function:: tiptilt_filter(fabs, D) | ||
.. py:function:: piston_tiptilt_filter(fabs, D) | ||
.. py:function:: mask_lf(freq, d_WFS, modal=False, modal_mult=1, Zmax=None, D=None, Gtilt=False) | ||
.. py:function:: mask_hf(freq, d_WFS, modal=False, modal_mult=1, Zmax=None, D=None, Gtilt=False) | ||
.. py:function:: Jol_noise_openloop(freq, Dsubap, noise_variance, lf_mask) | ||
.. py:function:: Jol_alias_openloop(freq, Dsubap, p, lf_mask, v=None, Delta_t=None, wvl=None, lmax=3, kmax=3, L0=numpy.inf, l0=1e-06) | ||
.. py:function:: G_AO_PAOLA(freq, mask, mode='AO', h=None, v=None, dtheta=[0, 0], Tx=None, wvl=None, Zmax=None, tl=0, Delta_t=0, Dsubap=None, modal=False, modal_mult=1) | ||
.. py:function:: logamp_powerspec(freq, h, cn2, wvl, pupilfilter=None, layer=True, L0=numpy.inf, l0=1e-06) | ||
.. py:function:: DM_transfer_function(fx, fy, fabs, mode, Zmax=None, D=None, dsubap=None) | ||
.. py:function:: G_AO_PAOLA_closedloop(fx, fy, fabs, h, dtheta=[0, 0], Delta_t=0.0, tl=0.0, gloop=1.0, v=None, dsubap=None, DM='perfect', Zmax=None, D=None, nu=1, modal=False, modal_mult=1) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,227 @@ | ||
fast.comms | ||
========== | ||
|
||
.. py:module:: fast.comms | ||
.. autoapi-nested-parse:: | ||
|
||
Functions regarding optical communications | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Module Contents | ||
--------------- | ||
|
||
.. py:data:: logger | ||
.. py:class:: Modulator(power, modulation, EsN0=None, symbols_per_iter=1000, data=None) | ||
Takes array of optical powers and modulates/demodulates according to a modulation | ||
scheme (OOK, BPSK, QPSK, QAM, etc) with random bits. Can add AWGN at a given | ||
average signal-to-noise ratio. | ||
|
||
This allows Monte Carlo computation of bit error rate or symbol error probability. | ||
|
||
Parameters: | ||
power (numpy.ndarray): array of optical powers | ||
modulation (string): modulation scheme | ||
EsN0 (float, optional): (average) symbol signal to noise ratio | ||
symbols_per_iter (int, optional): Number of symbols per iteration of FAST. | ||
Defaults to 1000. | ||
|
||
|
||
.. py:attribute:: power | ||
.. py:attribute:: amplitude | ||
.. py:attribute:: modulation | ||
.. py:attribute:: symbols_per_iter | ||
.. py:attribute:: EsN0 | ||
.. py:attribute:: data | ||
.. py:method:: generate_symbols() | ||
.. py:method:: modulate() | ||
.. py:method:: demodulate() | ||
.. py:method:: compute_sep() | ||
Symbol error probability, from random bits | ||
|
||
|
||
|
||
.. py:method:: compute_evm() | ||
Error Vector Magnitude (EVM), from random bits | ||
|
||
|
||
|
||
.. py:method:: run() | ||
.. py:class:: FastFSOC(*args, **kwargs) | ||
Subclass of Fast simulation object, adds optical comms functionality | ||
(modulation, demodulation, generating random symbol sequences for testing) | ||
|
||
|
||
.. py:attribute:: modulation | ||
.. py:attribute:: EsN0 | ||
.. py:method:: run() | ||
.. py:method:: make_header(params) | ||
.. py:function:: fade_prob(I, threshold, min_fades=30) | ||
.. py:function:: fade_dur(I, threshold, dt=1, min_fades=30) | ||
.. py:function:: ber_ook(EbN0, samples=None) | ||
Bit Error Rate for On-Off-Keying communications channel. | ||
|
||
Monte Carlo integration of Eq. 58 from Andrews and Phillips (2005) Ch 11. | ||
Note that electrical SNR per bit (Eb/N0) is used, not OSNR as in A+P. | ||
|
||
Args: | ||
EbN0 (float): average signal-to-noise ratio per bit Eb/N0 in electrical domain, dB | ||
samples (numpy.ndarray, optional): random samples of received power from FAST. | ||
If None is provided, assume no atmosphere (i.e. intensity pdf = delta function) | ||
|
||
Returns: | ||
Bit error rate for OOK | ||
|
||
|
||
.. py:function:: sep_qam(M, EsN0, samples=None) | ||
Symbol error probabilty for square M-ary QAM, from Rice. | ||
|
||
Parameters: | ||
M (int): Number of symbols (must be perfect square) | ||
EsN0 (float): Average electrical symbol signal-to-noise ratio [dB] | ||
samples (numpy.ndarray, optional): random samples of received power from FAST. | ||
|
||
|
||
.. py:function:: ber_qam(M, EbN0, samples=None) | ||
Bit error rate for square M-ary QAM, from Rice. Assumes only nearest neighbour | ||
bit errors and Gray coding, i.e. 1 bit error per symbol error. | ||
|
||
Parameters: | ||
M (int): Number of symbols (must be perfect square) | ||
EbN0 (float): Average electrical signal-to-noise ratio per bit [dB] | ||
samples (numpy.ndarray, optional): random samples of received power from FAST. | ||
|
||
|
||
.. py:function:: Q(x) | ||
Q function from Rice book | ||
|
||
|
||
.. py:function:: generalised_mutual_information_qam(samples, M, npxls, EsN0, N0=None, shot=False) | ||
Generalised Mutual Information (GMI), adapted from Alvarado et al (2016) | ||
[10.1109/JLT.2015.2450537] and Cho et al (2017) [10.1109/ECOC.2017.8345872]. | ||
|
||
Assumes | ||
1) Perfect interleaving (no correlation between bits) | ||
2) Bit-wise decoder (no memory of other bits sent) | ||
3) Gray encoding of QAM symbols | ||
4) Soft decision decoding with FEC | ||
|
||
Args: | ||
samples (numpy.ndarray): Array of Monte Carlo complex field measurements or amplitudes | ||
M (int): number of symbols (must be perfect square) | ||
npxls (int): Number of pixels to use for binning | ||
EsN0 (float): Symbol signal-to-noise ratio [dB] | ||
N0 (float, optional): Noise variance (overrides EsN0, can be set to 0) | ||
|
||
Returns: | ||
GMI (float): the generalised mutual information value, in bits/symbol | ||
|
||
|
||
.. py:function:: mutual_information_qam(samples, M, npxls, EsN0, N0=None, shot=False) | ||
Equation 16 from Alvarado et al (2016) 10.1109/JLT.2015.2450537. | ||
|
||
This is for a memoryless receiver (no knowledge of other bits transmitted) | ||
|
||
|
||
.. py:function:: convolve_awgn_qam(samples, M, npxls, EsN0, N0=None, region_size='individual', shot=False) | ||
Method of computing received I-Q plane for M-ary QAM under AWGN assumptions | ||
given a series of complex field measurements. | ||
|
||
Bins the Monte Carlo field measurements into a 2D array of npxls x npxls bins. | ||
The overall size of the 2d array is determined by the decision region size, | ||
which depends on the M-ary QAM constellation. This is then convolved with a | ||
gaussian to include AWGN. | ||
|
||
By integrating this distribution, and averaging over all constellation regions, | ||
we can obtain the probability that a transmitted symbol ends up outside the | ||
decision region, i.e. a symbol error. This [may be] more robust than simply | ||
adding AWGN to the individual Monte Carlo datapoints, because that method | ||
is limited by the number of samples. | ||
|
||
Args: | ||
samples (numpy.ndarray): Array of Monte Carlo complex field measurements or amplitudes | ||
M (int): number of symbols (must be perfect square) | ||
npxls (int): Number of pixels to use for binning | ||
EsN0 (float): Symbol signal-to-noise ratio [dB] | ||
N0 (float, optional): Noise variance (overrides EsN0, can be set to 0) | ||
separate (bool, optional): Separate each region of the constellation (default: True) | ||
region_size (str, optional): "individual" or "full" region to define the PDF (default: "individual") | ||
|
||
Returns: | ||
out (numpy.ndarray): (nsymbols x npxls x npxls) array consisting of the | ||
binned histogram for each symbol. | ||
|
||
|
||
.. py:function:: define_constellation(modulation) | ||
Define constellations for coherent modulation schemes. Schemes supported: | ||
|
||
OOK - On-Off Keying | ||
BPSK - Binary Phase Shift Keying | ||
QPSK - Quadrature Phase Shift Keying | ||
QAM - Quadrature Amplitude Modulation | ||
M-PSK - M-ary PSK (e.g. 16-PSK) | ||
M-QAM - M-ary QAM (e.g. 16-QAM) | ||
|
||
Parameters: | ||
modulation (string): Modulation scheme (e.g. "BPSK" or "64-QAM") | ||
|
||
Returns: | ||
constellation (numpy.ndarray): Complex array representing the constellation, | ||
of dimension (nsymbols), real and imaginary parts correspond to the | ||
two axes of the modulation. | ||
|
||
|
||
.. py:function:: flip_bits(data, ber) | ||
91 changes: 91 additions & 0 deletions
91
_sources/autoapi/fast/complete_orbit_simulation/index.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
fast.complete_orbit_simulation | ||
============================== | ||
|
||
.. py:module:: fast.complete_orbit_simulation | ||
Module Contents | ||
--------------- | ||
|
||
.. py:data:: ts | ||
.. py:function:: get_satellite_obj(TLE_file_path, satellite_name=None) | ||
Function to directly obtain a skyfield satellite object from a TLE and a satellite name (if different TLEs in the file) | ||
|
||
INPUTS: | ||
TLE_file_path : [string] - path to a local or online TLE file | ||
satellite_name : [string] - Name of the satellite to look at if different satellites are present in the same file | ||
|
||
OUTPUTS: | ||
satellite : the corresponding skyfield satellite object | ||
|
||
|
||
|
||
.. py:function:: get_sample_time(satellite, tele_lat, tele_lon, N=10, start=None, period=10, min_altitude_degrees=5.0, max_altitude_degree=90.0, zenith_stop=False) | ||
Function to "sample" a satellite orbit passing over a telescop. | ||
Research - on a given period - a moment when the sattelite is visible by the telescop, obtain the rising and falling times, and then samples this last period. | ||
The function returns the sampled times (in [s]) as a list of int values starting at 0, and the initial time t0 as a datetime object. | ||
|
||
INPUTS: | ||
satellite : a skyfield satellite object | ||
tele_lat/tele_lon : [float] - latitude and longitude of the telescop | ||
N : [int] - Number of samples expected | ||
start : [datetime object] - starting epoch for the research of a period when the satellite is visible by the telecsop. Current time by default. | ||
period : [int] - the time range in which the research is proceed (given in [days]) | ||
min_altitude_degrees : [float] - minimum satellite altitude expected | ||
max_altitude_degrees : [float] - maximum satellite altitude considered | ||
zenith_stop : [bool] - if True, the sampling is done between min_altitude_degrees and max_altitude_degrees, instead of min_altitude_degrees/min_altitude_degrees | ||
|
||
OUTPUTS: | ||
sample_times : [int list] - delay between t0 and each sample (in [s]) | ||
t0 : [datetime] - epoch of the first sample, given in UTC reference system. | ||
|
||
|
||
|
||
.. py:function:: get_angles_positions(sample_times, satellite, tele_lat, tele_lon, t_rise, Tloop, rotations=False) | ||
Function to obtain the Point-Ahead Angle (PAA), or the apparent wind equivalent angle, on each given sample time. | ||
|
||
INPUTS: | ||
t_rise = [datetime] - epoch of the first sample, in the UTC reference system | ||
sample_times = [int list] - delay between t_rise and each sample (in [s]) | ||
satellite = a skyfield satellite object | ||
tele_lat/tele_lon = [float] - latitude and longitude of the telescop | ||
Tloop = [float] - AO loop delay (in [s]) | ||
|
||
OUTPUTS: | ||
paa = [float list] - PAAs | ||
aniso_dl = [float list] - anisoplanetism angle for the downlink | ||
altitudes = [float list] - altitude of the satellite on each sample (in [°]) | ||
azimuts = [float list] - azimut of the satellite on each sample (in [°]) | ||
distances = [float list] - distance between the satellite and the telescop on each sample (in [m]) | ||
rotations = [float list] - telescop Field of View rotation on each sample (in [°]) | ||
|
||
|
||
|
||
.. py:function:: FAST_sat_orbit(fast_params, simu_params, TLE_file) | ||
Function that samples an satellite orbit - while this satellite is passing over a telescop - and generate a FAST simualtion object for each sample. | ||
|
||
INPUTS : | ||
fast_params = [dic] - parameters for the fast simulation | ||
simu_params = [dic] - complementary parameters associated to this simulation | ||
TLE_fil = [string] - path to a local or online TLE file | ||
cn2_turb = [float list] - Cn^2 profile ( in [m^1/3]) | ||
wind_speed = [float list] - wind speed profile (in [m/s]) | ||
wind_dir = [float list] - wind direction profile (in [°]) | ||
h_turb = [float list] - height associated to the previous profiles (in [m]) | ||
|
||
OUTPUTS : | ||
sampled_fast_sim = [dic] - a dictionary containing all the FAST simulation objects and the list of the associated altitudes. The dictionary keays are wrote : 'simulation_idx', with idx in [0, N-1] | ||
|
||
|
||
|
||
.. py:function:: FAST_sat(sat_apparent_speed, fast_params) | ||
Oops, something went wrong.