oopt-gnpy
oopt-gnpy copied to clipboard
Inconsistent docs about amplifier models
@ggrammel 's brownfield docs refers to gain_flatmax
. The definition within examples/edfa_model/amplifier_models_description.rst
looks good, but the short summary that is in the word document (and which originated either in the wiki, or in README.rst
) is different and a bit confusing (it looks like refers to a different thing on a fixed-gain amp vs. a variable-gain one).
- ensure that we only have one place where this is defined
- let's make sure that the definition is correct
The definition in amplifier_models_description.rst
says:
If gain > gain_flatmax, the amplifier will tilt, based on its dgt function
If gain > gain_flatmax + target_extended_gain, the amplifier output power is reduced to not exceed the extended gain range.
While this sounds reasonable with respect to how a real EDFA operates, it doesn't seem to describe what is currently implemented in GNPy.
It does in auto-design mode. Didn't want to force a power reduction when the settings are input by the user: see this bloc For the tilt, I have implemented it a long time ago and not checked since as we didn't have fiber SRS support. May be worth re-checking now.
Ok, but I don't think this is implemented:
If gain > gain_flatmax, the amplifier will tilt, based on its dgt function
Correct me if I'm wrong but as far as I can see, what is implemented today is that you can set tilt target independently of gain.
Have you tested it ? It used to work (a year ago) when I added the VOA in the code. It happens down here
Maybe we're talking past each other. In my understanding, if gain > gain_max, the amplifier gain should tilt even if tilt target is set to 0. Now, looking at the code you linked to (I have looked at it before and maybe I have misunderstood something so please help):
g1st = array(self.interpol_gain_ripple) + self.params.gain_flatmax \
+ array(self.interpol_dgt) * dgts1
voa = lin2db(mean(db2lin(g1st))) - self.effective_gain
Assuming tilt target is 0 (so we have dgts1 = 0
) and gain_ripple is flat, then g1st
is flat. (Here, if effective_gain
is higher than gain_flatmax
, voa
will be negative which is a bit confusing).
Further down we have:
deltax = max(g1st) - min(g1st)
# if no ripple deltax = 0 and xlow = xcent: div 0
# TODO|jla: add check for flat gain response
if abs(deltax) <= 0.05: # not enough ripple to consider calculation
return g1st - voa
Since g1st
is flat deltax = 0
, and a flat gain will be returned even if gain > gain_max.
It is written in the code: not enough ripple to consider calculation. See other cases. And try it with an advanced edfa model.
DGT and ripple are two separate things. I'm talking about DGT. I have tried setting gain_target in the network json much higher than gain_flatmax specified in the eqpt config json and the gain is still flat. It does not matter which amplifier model is used.
I'm seeing the same problem, no matter which amplifier model is used, gain is always flat, gain tilting based on gain_flatmax and DGT is not working. Meanwhile ripple is OK. Are there any plans to validate that functionality ?
Hi I bumped into same issue. Some observation would love to have the author to confirm. As long as my understanding is correct, it shall be fine to wait for another release with this issue closed.
- gain> gain_flatmax, if target_tilt =0, then the gain_profile will have tilt = 0. ( I tried to set the target_tilt to the value we actually measured at particular gain, the outcome utilizing DGT can match with the measurement)
- the polyfit for the NF take gain_flatmax as if its gain_max, for gain > gain_flatmax, the -dg will be 0 and the NF is not correctly represented in this case.
dg = max(gain_flatmax - gain_target, 0)