TimeSeries¶
- class photonforge.TimeSeries(values, time_step, time_index=0)¶
Time series data.
- Parameters:
values – (dict[str, Sequence[complex]]) Values in the time series as a dictionary mapping names to the sequence of values corresponding to consecutive time steps.
time_step – The time step in the between consecutive values in the time series.
time_index – The starting index of the time series. The time series starts at time
t = time_index * time_step.
Example
The time series data can be indexed by port name or time index:
>>> data = pf.TimeSeries( ... {"P0@0": [0, 1, 2, 3], "T1": [-1, -2, -3]}, 1e-10, 5 ... ) >>> data["T1"] # note missing values filled with zeros array([-1.+0.j, -2.+0.j, -3.+0.j, 0.+0.j]) >>> data[6] # time_index == 5, so index 6 means the 2nd value {'P0@0': (1+0j), 'T1': (-2+0j)}
Methods
copy()Create a copy of this time_series.
Attributes
Object properties.
Starting index in the time series.
Time step dt in the time series (read only).
Times in the time series (read only).
Values in the time series (read only).
- copy()¶
Create a copy of this time_series.
- Returns:
New copy.
- properties¶
Object properties.
- Type:
- time_index¶
Starting index in the time series.
- Type:
int
- time_step¶
Time step dt in the time series (read only).
- Type:
float
- times¶
Times in the time series (read only).
- Type:
ndarray
- values¶
Values in the time series (read only).
- Type:
dict[str, ndarray]