removed auto computation, renamed some stuff
This commit is contained in:
57
playground.py
Normal file
57
playground.py
Normal file
@@ -0,0 +1,57 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import os
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
||||
def make_grid(
|
||||
dt: float | None = None,
|
||||
period: float | None = None,
|
||||
t_num: float | None = None,
|
||||
wl_min: float | None = None,
|
||||
):
|
||||
...
|
||||
|
||||
|
||||
class Root:
|
||||
dt: float = Param()
|
||||
period: float
|
||||
t_num: int
|
||||
|
||||
fiber: Fiber
|
||||
pulses: PulseTrain
|
||||
|
||||
def __init__(self, name: str):
|
||||
...
|
||||
|
||||
@dt.register
|
||||
def dt_from_lmin(wavelength_max: float, wavelength_pump: float):
|
||||
return 1 / 6e8 * 1 / (1 / wavelength_pump - 1 / wavelength_max)
|
||||
|
||||
|
||||
class PulseTrain:
|
||||
pulse_width: float
|
||||
shape: str = "gaussian"
|
||||
peak_power: float
|
||||
quantum_noise: bool = True
|
||||
|
||||
def load_noise_spectrum(self, path: os.PathLike):
|
||||
...
|
||||
|
||||
|
||||
class Fiber:
|
||||
beta2_arr: np.ndarray
|
||||
length: float
|
||||
|
||||
|
||||
params = Root(dt=2e-15, t_num=1024)
|
||||
|
||||
pulses = params.pulse_train
|
||||
pulses.pulse_width = 50e-15
|
||||
pulses.shape = "sech"
|
||||
pulses.load_noise_spectrum(dBm="./some_noise.csv", v_ref=3)
|
||||
|
||||
fiber = params.fiber
|
||||
fiber.length = 0.2
|
||||
Reference in New Issue
Block a user