few operators improvements
This commit is contained in:
@@ -45,12 +45,8 @@ MANDATORY_PARAMETERS = {
|
|||||||
"length",
|
"length",
|
||||||
"adapt_step_size",
|
"adapt_step_size",
|
||||||
"tolerated_error",
|
"tolerated_error",
|
||||||
"repeat",
|
|
||||||
"linear_operator",
|
"linear_operator",
|
||||||
"nonlinear_operator",
|
"nonlinear_operator",
|
||||||
"soliton_length",
|
|
||||||
"nonlinear_length",
|
|
||||||
"dispersion_length",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOT_PARAMETERS = [
|
ROOT_PARAMETERS = [
|
||||||
|
|||||||
@@ -569,7 +569,11 @@ envelope_rules = default_rules + [
|
|||||||
Rule("gamma_op", operators.constant_quantity, ["gamma_arr"], priorities=1),
|
Rule("gamma_op", operators.constant_quantity, ["gamma_arr"], priorities=1),
|
||||||
Rule("gamma_op", lambda w_num, gamma: operators.constant_quantity(np.ones(w_num) * gamma)),
|
Rule("gamma_op", lambda w_num, gamma: operators.constant_quantity(np.ones(w_num) * gamma)),
|
||||||
Rule("gamma_op", lambda: operators.constant_quantity(0.0), priorities=-1),
|
Rule("gamma_op", lambda: operators.constant_quantity(0.0), priorities=-1),
|
||||||
Rule("ss_op", lambda w_c, w0: operators.constant_quantity(w_c / w0)),
|
Rule(
|
||||||
|
"ss_op",
|
||||||
|
lambda w_c, w0: operators.constant_quantity(w_c / w0),
|
||||||
|
conditions=dict(self_steepening=True),
|
||||||
|
),
|
||||||
Rule("ss_op", lambda: operators.constant_quantity(0), priorities=-1),
|
Rule("ss_op", lambda: operators.constant_quantity(0), priorities=-1),
|
||||||
Rule("spm_op", operators.envelope_spm, conditions=dict(spm=True)),
|
Rule("spm_op", operators.envelope_spm, conditions=dict(spm=True)),
|
||||||
Rule("spm_op", operators.no_op_freq, priorities=-1),
|
Rule("spm_op", operators.no_op_freq, priorities=-1),
|
||||||
@@ -579,6 +583,7 @@ envelope_rules = default_rules + [
|
|||||||
Rule("dispersion_op", operators.constant_polynomial_dispersion),
|
Rule("dispersion_op", operators.constant_polynomial_dispersion),
|
||||||
Rule("dispersion_op", operators.constant_direct_dispersion),
|
Rule("dispersion_op", operators.constant_direct_dispersion),
|
||||||
Rule("dispersion_op", operators.direct_dispersion),
|
Rule("dispersion_op", operators.direct_dispersion),
|
||||||
|
Rule("dispersion_op", lambda: operators.constant_quantity(0.0), priorities=-1),
|
||||||
Rule("linear_operator", operators.envelope_linear_operator),
|
Rule("linear_operator", operators.envelope_linear_operator),
|
||||||
Rule("conserved_quantity", operators.conserved_quantity),
|
Rule("conserved_quantity", operators.conserved_quantity),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ class NoiseMeasurement:
|
|||||||
sample on a log-log scale rather than on a linear scale, by default False
|
sample on a log-log scale rather than on a linear scale, by default False
|
||||||
"""
|
"""
|
||||||
nf = nf or len(self.freq)
|
nf = nf or len(self.freq)
|
||||||
if rng is None or isinstance(rng, int):
|
if rng is None or isinstance(rng, (int, np.integer)):
|
||||||
rng = np.random.default_rng(rng)
|
rng = np.random.default_rng(rng)
|
||||||
|
|
||||||
freq, amp = self.sample_spectrum(nf, dt, log_mode, left=0)
|
freq, amp = self.sample_spectrum(nf, dt, log_mode, left=0)
|
||||||
|
|||||||
Reference in New Issue
Block a user