mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-10-30 17:47:50 +00:00
Compare commits
1364 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d236fd31e | ||
|
|
9a84e29433 | ||
|
|
143f63170e | ||
|
|
b2d7f883a1 | ||
|
|
73dbdf3042 | ||
|
|
4a071c53d7 | ||
|
|
dcde64a8db | ||
|
|
38cc0e3cc5 | ||
|
|
fb70413784 | ||
|
|
87e10c240e | ||
|
|
43c1085be6 | ||
|
|
4ace60bea2 | ||
|
|
f950a6aee8 | ||
|
|
fb4195c775 | ||
|
|
29f42666e5 | ||
|
|
9bf7f336e3 | ||
|
|
eed6564f11 | ||
|
|
fbb2f2c587 | ||
|
|
44040c4d06 | ||
|
|
ee9af69558 | ||
|
|
ce21609fec | ||
|
|
a1289e6a9b | ||
|
|
138115e1d7 | ||
|
|
ed41305f55 | ||
|
|
9736f7c032 | ||
|
|
be7ae35db3 | ||
|
|
2b4a4ab72c | ||
|
|
426c88432d | ||
|
|
2a800b781f | ||
|
|
8d1d3677ed | ||
|
|
5b6f8c60cf | ||
|
|
3a733b1fd5 | ||
|
|
2d68b94a46 | ||
|
|
bc71823bd0 | ||
|
|
5481b93728 | ||
|
|
05e301182d | ||
|
|
47c89626e3 | ||
|
|
7a032a63b5 | ||
|
|
f195d5f496 | ||
|
|
56569f866f | ||
|
|
bf1f293043 | ||
|
|
28871c6f2d | ||
|
|
d7c1a6b75e | ||
|
|
c69c2a3af2 | ||
|
|
fb29d72906 | ||
|
|
30a06da6b1 | ||
|
|
139c8cc1e7 | ||
|
|
7034d4c686 | ||
|
|
10164495b9 | ||
|
|
87211b35e9 | ||
|
|
e9f9ddb4d6 | ||
|
|
8ea13bb4d6 | ||
|
|
b45829d2df | ||
|
|
6ac3a517cf | ||
|
|
2f2920a716 | ||
|
|
07fd89351b | ||
|
|
7c60b000b5 | ||
|
|
537eb017b5 | ||
|
|
9c514e8086 | ||
|
|
78efb6c650 | ||
|
|
3510d59250 | ||
|
|
41d9d156a6 | ||
|
|
e9d5e748e4 | ||
|
|
5a5bed56c2 | ||
|
|
22de1b1281 | ||
|
|
73e1485b47 | ||
|
|
22ee05ea6f | ||
|
|
31824f318d | ||
|
|
b0cb604e91 | ||
|
|
79102e283a | ||
|
|
db5e63d51b | ||
|
|
af42699133 | ||
|
|
4ba77d0a0a | ||
|
|
064d3af8e0 | ||
|
|
4ab5bac45f | ||
|
|
bbe5fb7821 | ||
|
|
edf1eec072 | ||
|
|
88ac41f721 | ||
|
|
c20e6fb320 | ||
|
|
05500c7047 | ||
|
|
86a39f4b5e | ||
|
|
2b25609255 | ||
|
|
7e0b95bcfd | ||
|
|
f0a52dcc8a | ||
|
|
3bea4b3c9f | ||
|
|
f2cc9f7225 | ||
|
|
e79f9f51b6 | ||
|
|
7fd7f94efe | ||
|
|
0acdf9d9f6 | ||
|
|
a3edb20142 | ||
|
|
33cc11b85c | ||
|
|
5d079ab261 | ||
|
|
a3b1157e38 | ||
|
|
70731b64d6 | ||
|
|
4ea0180caf | ||
|
|
eb2363a3d4 | ||
|
|
41b94cc888 | ||
|
|
1eeb6a0583 | ||
|
|
215c20e245 | ||
|
|
76e9146043 | ||
|
|
2a07eec966 | ||
|
|
cc994bf118 | ||
|
|
37e70e622c | ||
|
|
7d9a508955 | ||
|
|
185adabd77 | ||
|
|
8f9cf8ccc7 | ||
|
|
0c797a254c | ||
|
|
2cdeeabfa6 | ||
|
|
5e874798cb | ||
|
|
ff8f044064 | ||
|
|
d84ee4e76c | ||
|
|
521d27ffac | ||
|
|
35e759212e | ||
|
|
f6dede2b5f | ||
|
|
0d0019f627 | ||
|
|
06fe1c2f63 | ||
|
|
092316a9d7 | ||
|
|
48e3f96967 | ||
|
|
e9e8956caf | ||
|
|
0ae341c2a5 | ||
|
|
0c2f6372f8 | ||
|
|
97e80b4445 | ||
|
|
5e4c9b7d73 | ||
|
|
e96f821cce | ||
|
|
5f7e61e255 | ||
|
|
682b5c5691 | ||
|
|
11e5117505 | ||
|
|
50603420fc | ||
|
|
125264f265 | ||
|
|
b1067a6266 | ||
|
|
50d4ecd700 | ||
|
|
9f37e0371e | ||
|
|
9bd303db05 | ||
|
|
1bcb3ce25c | ||
|
|
e381138320 | ||
|
|
b450677709 | ||
|
|
54a3725e17 | ||
|
|
8889c2437a | ||
|
|
8bf8b2947b | ||
|
|
cb85b8fe2b | ||
|
|
18610fb7a9 | ||
|
|
bd6b278dd1 | ||
|
|
e143d25339 | ||
|
|
ffc7dbc241 | ||
|
|
b842898baf | ||
|
|
7ea9e3b341 | ||
|
|
fcf168b361 | ||
|
|
a7ec7e2ed6 | ||
|
|
00ee102b3a | ||
|
|
ce11524ad9 | ||
|
|
74be14562a | ||
|
|
16694d0a09 | ||
|
|
33c6038921 | ||
|
|
119c9eda90 | ||
|
|
b63e146bf4 | ||
|
|
09dba8a166 | ||
|
|
7f5043622b | ||
|
|
6ad4593f41 | ||
|
|
706661d801 | ||
|
|
a408d28911 | ||
|
|
b86fe96032 | ||
|
|
43926518ad | ||
|
|
128a6e816b | ||
|
|
44db951261 | ||
|
|
3c3d919b77 | ||
|
|
2079d2bc5b | ||
|
|
062e2076ed | ||
|
|
1dd1bad273 | ||
|
|
5b104af296 | ||
|
|
f170574abf | ||
|
|
a68e8ff8d2 | ||
|
|
d5a52d1b2b | ||
|
|
7ac6e058ec | ||
|
|
74ab3c1bcd | ||
|
|
1a2ff2d215 | ||
|
|
aaf0480e9c | ||
|
|
5e50ffbbf6 | ||
|
|
243b701391 | ||
|
|
bdbfe76aed | ||
|
|
541ec04444 | ||
|
|
bf1522b047 | ||
|
|
3f4188a0fd | ||
|
|
8b387ef722 | ||
|
|
cad9a0f18e | ||
|
|
ab84c77363 | ||
|
|
62fa9ab0b0 | ||
|
|
14591c7a11 | ||
|
|
587932290d | ||
|
|
82b148eb87 | ||
|
|
8393daf67d | ||
|
|
be61dfd094 | ||
|
|
77925b218e | ||
|
|
4621ac12bf | ||
|
|
09920c0af2 | ||
|
|
e6a3d9ce5b | ||
|
|
b9645702c8 | ||
|
|
9c2095b138 | ||
|
|
cb42115230 | ||
|
|
5909da4bbf | ||
|
|
2ba1e86b28 | ||
|
|
3358c5eeb5 | ||
|
|
13e4c29bc1 | ||
|
|
4becc9060c | ||
|
|
32d8b2a4d8 | ||
|
|
399eb9700f | ||
|
|
82f83e1462 | ||
|
|
171450fa54 | ||
|
|
9f9f4c78fc | ||
|
|
c469a8d9ba | ||
|
|
99b2a554dc | ||
|
|
57e98d7173 | ||
|
|
78b45a3958 | ||
|
|
64b6b486a9 | ||
|
|
65cb46f479 | ||
|
|
f94d06f124 | ||
|
|
e1f2c55942 | ||
|
|
d28c67143e | ||
|
|
6bb9ae8336 | ||
|
|
0dc7d853ef | ||
|
|
dec9388416 | ||
|
|
017b35fa33 | ||
|
|
cb0a410418 | ||
|
|
f250990a49 | ||
|
|
280443f17f | ||
|
|
6f62251cb4 | ||
|
|
5ad54879b1 | ||
|
|
825d37c05c | ||
|
|
3ac9f90914 | ||
|
|
dbfbf115ff | ||
|
|
ad2590962b | ||
|
|
a9d530c776 | ||
|
|
f255c31f1f | ||
|
|
80ec05f84c | ||
|
|
22541d65e4 | ||
|
|
26fcf0ff6e | ||
|
|
1c32e437a2 | ||
|
|
718007b3de | ||
|
|
4d6c06340f | ||
|
|
bad893bf86 | ||
|
|
75e7fca8e4 | ||
|
|
4e38ba98ab | ||
|
|
fdcdfca589 | ||
|
|
299ca10a47 | ||
|
|
c0b7bf714e | ||
|
|
7f7c568160 | ||
|
|
9bf6ed953a | ||
|
|
e68dc39ddd | ||
|
|
f8007b41d1 | ||
|
|
228125029e | ||
|
|
d185e0c241 | ||
|
|
357bbec257 | ||
|
|
d25e98c567 | ||
|
|
397411690e | ||
|
|
4ab6f8cb1b | ||
|
|
44aff147db | ||
|
|
a36b139065 | ||
|
|
141fc66d47 | ||
|
|
53f29957fd | ||
|
|
9f3995ee20 | ||
|
|
0cf45bd102 | ||
|
|
55932ee3e9 | ||
|
|
797a0856ec | ||
|
|
3fa53adc4d | ||
|
|
bcb5e6bb60 | ||
|
|
6380f8f37a | ||
|
|
93869d6cb5 | ||
|
|
ce51a4d160 | ||
|
|
601e228bb6 | ||
|
|
3f58cbd559 | ||
|
|
2e3274ac78 | ||
|
|
e33144f8cc | ||
|
|
fd1e3f0f61 | ||
|
|
80c41264cf | ||
|
|
a051a5723b | ||
|
|
72f300ab94 | ||
|
|
2c3b0d8c82 | ||
|
|
11dab614a9 | ||
|
|
11d88bf09a | ||
|
|
af3cc4736e | ||
|
|
50cb82ee18 | ||
|
|
c80aca6696 | ||
|
|
dfca35d4ae | ||
|
|
1fbdaef58a | ||
|
|
bd025f3af4 | ||
|
|
c3e546abe3 | ||
|
|
9427d0b139 | ||
|
|
89f5b12f7e | ||
|
|
9d2c10e267 | ||
|
|
305620e5dd | ||
|
|
c91c5d622f | ||
|
|
24e7f4a5a1 | ||
|
|
225cafa8b7 | ||
|
|
ad9cbb8a93 | ||
|
|
581b4a726f | ||
|
|
ce92d4e1b8 | ||
|
|
eb17b74ea4 | ||
|
|
051359ad77 | ||
|
|
912eb712c3 | ||
|
|
ce4ea9d6e3 | ||
|
|
39c894bb6a | ||
|
|
be95496f85 | ||
|
|
d38dabc824 | ||
|
|
5ad6336fda | ||
|
|
8ec9aca559 | ||
|
|
9abec6c9b7 | ||
|
|
e3b904fb06 | ||
|
|
5d13b9bfb6 | ||
|
|
0c26fd24b5 | ||
|
|
08c922a5e5 | ||
|
|
1b2eb9a5a8 | ||
|
|
219204e320 | ||
|
|
38fc1fdc6d | ||
|
|
e25e1fbe50 | ||
|
|
8a96ff563e | ||
|
|
27d4fb0811 | ||
|
|
b5a8ae3f06 | ||
|
|
e45a54c2b5 | ||
|
|
172697a2aa | ||
|
|
9762b6e610 | ||
|
|
4675a74e02 | ||
|
|
a268c219ed | ||
|
|
a47f069d97 | ||
|
|
8fcead4294 | ||
|
|
b6daa15356 | ||
|
|
469c0f5218 | ||
|
|
830ed22690 | ||
|
|
a386262bfd | ||
|
|
ede3c1a943 | ||
|
|
af767dd38a | ||
|
|
6dcc5a8524 | ||
|
|
7b5878e2f2 | ||
|
|
8c0eac1bdc | ||
|
|
d09938c1b8 | ||
|
|
dba4da0169 | ||
|
|
998249be61 | ||
|
|
ebdba47660 | ||
|
|
6072203afb | ||
|
|
b867c57bee | ||
|
|
4396a4efe9 | ||
|
|
afe686c666 | ||
|
|
e0faf6107d | ||
|
|
441f566964 | ||
|
|
2ca92f1aaa | ||
|
|
c4235fa61c | ||
|
|
41c53fbc5a | ||
|
|
44f8cdbf20 | ||
|
|
07ef8e4e10 | ||
|
|
bf0e435542 | ||
|
|
b688493e98 | ||
|
|
1ad01963c8 | ||
|
|
493de58e65 | ||
|
|
7e97547774 | ||
|
|
0f73a8f810 | ||
|
|
fa834338ab | ||
|
|
fc82f43b89 | ||
|
|
3d9d5d7a8d | ||
|
|
eef2cdc81c | ||
|
|
487ca8c2d6 | ||
|
|
ec66d628f0 | ||
|
|
924c56850d | ||
|
|
21385cbf03 | ||
|
|
87c617b602 | ||
|
|
4fce4ea7d8 | ||
|
|
2ddbd961ff | ||
|
|
05a044dc2c | ||
|
|
340840840f | ||
|
|
3ac08f59e2 | ||
|
|
3bcafc2345 | ||
|
|
b58c089945 | ||
|
|
a211e305c3 | ||
|
|
3a72ce84d0 | ||
|
|
de09b4f8ce | ||
|
|
be5519455f | ||
|
|
f98eb2c10c | ||
|
|
60b9256f22 | ||
|
|
94b9c16d67 | ||
|
|
eaccd63739 | ||
|
|
8fcb61f12c | ||
|
|
efd7468d42 | ||
|
|
8e62955bb0 | ||
|
|
561fd76a20 | ||
|
|
ccb6653f50 | ||
|
|
902cfa11a7 | ||
|
|
24c6acc027 | ||
|
|
3a31d458ee | ||
|
|
22d55ae881 | ||
|
|
3324645f78 | ||
|
|
3014a881f5 | ||
|
|
35877022ec | ||
|
|
9b985d1fc5 | ||
|
|
cd95c83bbf | ||
|
|
f9dbf7d132 | ||
|
|
b37248077c | ||
|
|
d2a8d8e887 | ||
|
|
35c4073292 | ||
|
|
b8e72511de | ||
|
|
120c326e77 | ||
|
|
01115f9852 | ||
|
|
b91ea1828f | ||
|
|
d2a294ac5a | ||
|
|
f41acf31f6 | ||
|
|
8cef09158f | ||
|
|
549e04e925 | ||
|
|
918c19b1bc | ||
|
|
6820a3fc36 | ||
|
|
7e8ed590eb | ||
|
|
4218b7ef44 | ||
|
|
87af343b38 | ||
|
|
26cd33b4dc | ||
|
|
861724ef4f | ||
|
|
86492cff60 | ||
|
|
27fd5cdad6 | ||
|
|
2fc444be4b | ||
|
|
d3490ae30c | ||
|
|
59c3895a51 | ||
|
|
11bc41b941 | ||
|
|
9a7f94a391 | ||
|
|
6487b98136 | ||
|
|
15df99510f | ||
|
|
3d5b1fcf64 | ||
|
|
928bc42cb9 | ||
|
|
643680ec47 | ||
|
|
a4a144a319 | ||
|
|
093085fba8 | ||
|
|
c56ea898a6 | ||
|
|
a5398a5c57 | ||
|
|
6dd40935b7 | ||
|
|
e6ee512001 | ||
|
|
e13d27c1f5 | ||
|
|
bb552fbdd6 | ||
|
|
ed8a3dd933 | ||
|
|
3204077a6c | ||
|
|
85d1bf4e1e | ||
|
|
42edb2e6b9 | ||
|
|
21174a4190 | ||
|
|
f6c2da24cd | ||
|
|
9f16aaac61 | ||
|
|
29fc9d7dac | ||
|
|
be3af5c2e5 | ||
|
|
e0e9ebde28 | ||
|
|
5dc16a39c5 | ||
|
|
416da5c60b | ||
|
|
f8047f9afe | ||
|
|
9e91933106 | ||
|
|
7407e6809b | ||
|
|
56f66779f9 | ||
|
|
2704c56e50 | ||
|
|
ba4cc1ceef | ||
|
|
8396cea652 | ||
|
|
2b1029f3b6 | ||
|
|
8e2709490f | ||
|
|
ebf8249154 | ||
|
|
aaddffcb2e | ||
|
|
29d1f8c666 | ||
|
|
0126645c4d | ||
|
|
1d657d6819 | ||
|
|
0b965d931c | ||
|
|
d3eaa4d7ba | ||
|
|
1dbbc6273b | ||
|
|
efa8b83249 | ||
|
|
30599bf63a | ||
|
|
7c14fe02ab | ||
|
|
ee92011b21 | ||
|
|
9861a22ef9 | ||
|
|
59f9f35817 | ||
|
|
1bb475671d | ||
|
|
566dedbdbb | ||
|
|
b44c4cec16 | ||
|
|
93d11ba408 | ||
|
|
637670fcfa | ||
|
|
7836297708 | ||
|
|
1f8b4ab9a2 | ||
|
|
05eb312f4a | ||
|
|
a98e244abd | ||
|
|
c945bc40fe | ||
|
|
749b9287a9 | ||
|
|
202c76bd6e | ||
|
|
eec0943ca2 | ||
|
|
cd0415e523 | ||
|
|
06d59a5834 | ||
|
|
33dcdde422 | ||
|
|
94949d955b | ||
|
|
b74d0a4919 | ||
|
|
c8fa7635e0 | ||
|
|
4c6cfbda5d | ||
|
|
80e9423590 | ||
|
|
78010aaaef | ||
|
|
3857ab1dbb | ||
|
|
dbb09e4108 | ||
|
|
94a8f3568a | ||
|
|
ae7c9321d0 | ||
|
|
648cc3a8e5 | ||
|
|
f9e0d18a9d | ||
|
|
2d57fd9f85 | ||
|
|
f053f32301 | ||
|
|
8e9d715e9f | ||
|
|
9fd55a5289 | ||
|
|
914d0dbecd | ||
|
|
c38fe72ff7 | ||
|
|
80f63d32ed | ||
|
|
9030f8f84f | ||
|
|
0d5f1c7d80 | ||
|
|
5bc42332cd | ||
|
|
093b85d4a3 | ||
|
|
0efa0d310d | ||
|
|
8eb5980ca9 | ||
|
|
754be7ca08 | ||
|
|
c5c5b693f2 | ||
|
|
7f816eb6e7 | ||
|
|
1009b44d2a | ||
|
|
3b61c6ca4c | ||
|
|
cc11bd186c | ||
|
|
0d1225824e | ||
|
|
a2ecfd924c | ||
|
|
95c3c9c488 | ||
|
|
11033a284f | ||
|
|
357e6cbf18 | ||
|
|
bfa6d29908 | ||
|
|
21e0589e7f | ||
|
|
4d836246ec | ||
|
|
566943a099 | ||
|
|
a4c1ea1f55 | ||
|
|
6b10ed15f8 | ||
|
|
c8daa5ed8c | ||
|
|
0b03725295 | ||
|
|
ee5e64408d | ||
|
|
b96ffe6c7b | ||
|
|
3b981853d4 | ||
|
|
6fa3ef8df1 | ||
|
|
1b2b048b47 | ||
|
|
94c5281260 | ||
|
|
7da4ec08d8 | ||
|
|
2b473d26d3 | ||
|
|
9e74e8b0a0 | ||
|
|
648039521e | ||
|
|
24bc023a07 | ||
|
|
19c2ae7f7a | ||
|
|
9f6894a176 | ||
|
|
a094568d6e | ||
|
|
f728d96d07 | ||
|
|
6b1fb7061f | ||
|
|
7ef505f259 | ||
|
|
c8d394348d | ||
|
|
0daa1c3e8c | ||
|
|
60bafd114d | ||
|
|
11509f5686 | ||
|
|
785c823fa2 | ||
|
|
9faf6430a5 | ||
|
|
01c566a325 | ||
|
|
baa9171315 | ||
|
|
2e50337f38 | ||
|
|
8daa298699 | ||
|
|
76cdd5dc71 | ||
|
|
07eb2dd13a | ||
|
|
04e764d024 | ||
|
|
05ccb14e5d | ||
|
|
f60d035e66 | ||
|
|
0823f8de46 | ||
|
|
a453c57996 | ||
|
|
2f84bb5286 | ||
|
|
7b8e68aea9 | ||
|
|
8d553a255f | ||
|
|
2766e37438 | ||
|
|
f56e64410b | ||
|
|
15ea7218e9 | ||
|
|
db28011c61 | ||
|
|
faccc23018 | ||
|
|
49514c0c70 | ||
|
|
0b1557fdf1 | ||
|
|
46f89aa770 | ||
|
|
3548ed74e2 | ||
|
|
145653df6e | ||
|
|
c7589e0bca | ||
|
|
531810cc85 | ||
|
|
63a6256b5e | ||
|
|
c3febb6db4 | ||
|
|
8b1d8b3479 | ||
|
|
3168603908 | ||
|
|
a2128227bd | ||
|
|
376826b3ae | ||
|
|
4b258cdf2e | ||
|
|
fbdd132a3d | ||
|
|
eebcebb33d | ||
|
|
20152036ff | ||
|
|
2a477071a0 | ||
|
|
f02d11e8bc | ||
|
|
0d542f22a7 | ||
|
|
5af195bd2b | ||
|
|
7ab93e7cd9 | ||
|
|
0aec47ddeb | ||
|
|
9a54dbab43 | ||
|
|
fc03be8bbe | ||
|
|
32f10a4507 | ||
|
|
04544d41f6 | ||
|
|
c87be89e07 | ||
|
|
efa05f0653 | ||
|
|
4cf4db9bc2 | ||
|
|
16434c5737 | ||
|
|
14ee9c9a91 | ||
|
|
7cfc4bd1ec | ||
|
|
9d55cde50d | ||
|
|
72183c24da | ||
|
|
4d1a628488 | ||
|
|
fdeaf75361 | ||
|
|
5695fafac6 | ||
|
|
0fe1d195a3 | ||
|
|
ed1aa0aa03 | ||
|
|
3fc024f5ba | ||
|
|
4f8177908f | ||
|
|
ad64595d75 | ||
|
|
80133e9521 | ||
|
|
de58d7d7c2 | ||
|
|
491a05c5a7 | ||
|
|
1d791aa295 | ||
|
|
58921bc346 | ||
|
|
ab6a91692b | ||
|
|
3b45968799 | ||
|
|
c7d69b9a99 | ||
|
|
1eeed78430 | ||
|
|
1cdafbae0f | ||
|
|
47b4f87bc5 | ||
|
|
e24b766cdc | ||
|
|
51fb6bd68e | ||
|
|
7e405a0514 | ||
|
|
194a13e607 | ||
|
|
856f07e707 | ||
|
|
4582aed895 | ||
|
|
734b6dfef4 | ||
|
|
da6e4f33a4 | ||
|
|
5a1e3f30b3 | ||
|
|
094af16792 | ||
|
|
9474ff17de | ||
|
|
c675f5bd38 | ||
|
|
2556658e68 | ||
|
|
4d5d10935a | ||
|
|
eb87e36781 | ||
|
|
14d8d793f3 | ||
|
|
bc4b6642a0 | ||
|
|
fe2b39ee3b | ||
|
|
d56c91ca7f | ||
|
|
25819fadf5 | ||
|
|
0cacb8851d | ||
|
|
14f98836ed | ||
|
|
82ce3384ba | ||
|
|
1f1877f7a9 | ||
|
|
db26ce07db | ||
|
|
e08ae9c959 | ||
|
|
2de1b5567a | ||
|
|
639b379a5b | ||
|
|
0465397b1d | ||
|
|
d3ec39d506 | ||
|
|
bfe68a5948 | ||
|
|
2ea3363613 | ||
|
|
89cce6e6a3 | ||
|
|
0f10ac706c | ||
|
|
66d26f0ffa | ||
|
|
3c96914482 | ||
|
|
61b1e73362 | ||
|
|
03435079cc | ||
|
|
6661907c1d | ||
|
|
fe811f725c | ||
|
|
80eced85ec | ||
|
|
2960d307fa | ||
|
|
c41cddfff5 | ||
|
|
8598e6591f | ||
|
|
5e2259062c | ||
|
|
d483802a86 | ||
|
|
9a0eece69c | ||
|
|
1657bfd05f | ||
|
|
49bf558916 | ||
|
|
99f44a597b | ||
|
|
a21f3fe6ee | ||
|
|
0ccbb2960c | ||
|
|
c577a75725 | ||
|
|
8827e0cf6f | ||
|
|
b0012fe399 | ||
|
|
31e634615b | ||
|
|
8300a55e39 | ||
|
|
5b939bc57a | ||
|
|
2f1ab9cc50 | ||
|
|
42ba3eb98d | ||
|
|
9eb87fc8e1 | ||
|
|
8fab9bb945 | ||
|
|
1ead232a78 | ||
|
|
b15c8c60ab | ||
|
|
66bdeb0e4d | ||
|
|
1a2e090104 | ||
|
|
a8e280e29b | ||
|
|
edb54b02ac | ||
|
|
83d3f32fe0 | ||
|
|
085a379592 | ||
|
|
37bd5d0404 | ||
|
|
f788b81d21 | ||
|
|
2ff1ce6b34 | ||
|
|
41a1e40d14 | ||
|
|
921e8d2d3c | ||
|
|
c009d28f7d | ||
|
|
898eada097 | ||
|
|
bdfc55e801 | ||
|
|
57f264bedb | ||
|
|
fbe4fa3cf0 | ||
|
|
b2ef345f35 | ||
|
|
471ea7dfba | ||
|
|
1b52f638ff | ||
|
|
84ab38a75f | ||
|
|
916e5377f8 | ||
|
|
534bfd881e | ||
|
|
7c4015324d | ||
|
|
8499ee52f4 | ||
|
|
cc1123863c | ||
|
|
ca382806f6 | ||
|
|
3559fc61c2 | ||
|
|
33581cdcc9 | ||
|
|
991eb02964 | ||
|
|
286e321a2d | ||
|
|
56f158113d | ||
|
|
024f6ff963 | ||
|
|
8118a0f4f4 | ||
|
|
eb89d8fd86 | ||
|
|
a938c1738b | ||
|
|
4f88882513 | ||
|
|
4e8d8b7ddd | ||
|
|
afb7d75749 | ||
|
|
488d0e1fe8 | ||
|
|
708442e4cd | ||
|
|
a2d905dfb1 | ||
|
|
d564fe3e2a | ||
|
|
ea21cce1c0 | ||
|
|
aa9b4aefbe | ||
|
|
8655030e59 | ||
|
|
8107ddeb79 | ||
|
|
76c8e55f06 | ||
|
|
a7b1ab47d8 | ||
|
|
879f587ab9 | ||
|
|
8af2d80219 | ||
|
|
315eea1f55 | ||
|
|
b61e541e15 | ||
|
|
81f88e78c7 | ||
|
|
87cc3dac00 | ||
|
|
89e28cc7be | ||
|
|
2ba29a78c5 | ||
|
|
f990a6c1be | ||
|
|
424e5a4786 | ||
|
|
6a7a04ebb1 | ||
|
|
0366fc2956 | ||
|
|
48b7d71f02 | ||
|
|
715baf2a1c | ||
|
|
e55cea776e | ||
|
|
b388d143fd | ||
|
|
c592c572d8 | ||
|
|
dfa0a26a28 | ||
|
|
609cd94798 | ||
|
|
022f743db1 | ||
|
|
1957beb1b6 | ||
|
|
9ca72d6105 | ||
|
|
e8e126a6ce | ||
|
|
7849782173 | ||
|
|
149a0da8c9 | ||
|
|
1e7c70a59b | ||
|
|
c9d8282e7f | ||
|
|
e7084a2c29 | ||
|
|
d79d2e0724 | ||
|
|
402155c225 | ||
|
|
e5ec669419 | ||
|
|
8f424e8c9d | ||
|
|
fea2b84bb9 | ||
|
|
0c918940c4 | ||
|
|
a63a6ac0ec | ||
|
|
9f58b914d2 | ||
|
|
029bac4b03 | ||
|
|
a27ad57220 | ||
|
|
8d31d924f2 | ||
|
|
8c3b514f90 | ||
|
|
3df27fe315 | ||
|
|
a6087ce354 | ||
|
|
aae0382523 | ||
|
|
b0c2acb1b5 | ||
|
|
a52c96ae2e | ||
|
|
bf28821b5b | ||
|
|
328bd6ea71 | ||
|
|
ec9eb8d054 | ||
|
|
f8c8526045 | ||
|
|
d8c236bb44 | ||
|
|
33ff0910b8 | ||
|
|
faa69917d9 | ||
|
|
d9f5ca9827 | ||
|
|
c817ef7335 | ||
|
|
07de489d6b | ||
|
|
acafc78456 | ||
|
|
325721545e | ||
|
|
dbe2bf560c | ||
|
|
7872cc2203 | ||
|
|
25b4d0e755 | ||
|
|
9af1c90664 | ||
|
|
6b4d44a3f1 | ||
|
|
2faf8d2cdd | ||
|
|
676c94ddf2 | ||
|
|
6f93b64f84 | ||
|
|
54bf426472 | ||
|
|
1862ce9104 | ||
|
|
3771c13d32 | ||
|
|
f1d0230dad | ||
|
|
182929cc96 | ||
|
|
81585c5a86 | ||
|
|
2f52c11589 | ||
|
|
0f4d8573cf | ||
|
|
660b8b3c6e | ||
|
|
71d6a1138c | ||
|
|
a6e741d8fe | ||
|
|
58bcf65cf6 | ||
|
|
27ce55de38 | ||
|
|
36ca22db9b | ||
|
|
33a8de9b39 | ||
|
|
22b76e36db | ||
|
|
528ff31590 | ||
|
|
4d6966cbd3 | ||
|
|
9c9e3be967 | ||
|
|
2dd4745ef7 | ||
|
|
4e786a32b5 | ||
|
|
6ecb2c85e2 | ||
|
|
cd234a909b | ||
|
|
c249f44ea1 | ||
|
|
ed1f51393a | ||
|
|
8bd43130ab | ||
|
|
6c975a53a1 | ||
|
|
8a1001cd40 | ||
|
|
beb2b576aa | ||
|
|
8f3923046b | ||
|
|
88c68d2065 | ||
|
|
8bcde72a10 | ||
|
|
4653dbcf4b | ||
|
|
cde08b32a4 | ||
|
|
2eed891f8d | ||
|
|
c0b84e84c8 | ||
|
|
2c20fd3f9f | ||
|
|
f4db56ca29 | ||
|
|
5b6d58ac7d | ||
|
|
ecb8bd9fbe | ||
|
|
2f9385451f | ||
|
|
1a1346461b | ||
|
|
27dcd29074 | ||
|
|
93986f36c3 | ||
|
|
a6ab8055b1 | ||
|
|
31ea479d7f | ||
|
|
89fb2e047b | ||
|
|
8f705e6173 | ||
|
|
8f735316f5 | ||
|
|
0d7a1871a1 | ||
|
|
33832b3d25 | ||
|
|
4da7f0cc38 | ||
|
|
e29f8485ea | ||
|
|
2da344a563 | ||
|
|
2a0cb8e14f | ||
|
|
e1dc3dc357 | ||
|
|
8259124f73 | ||
|
|
0422956ac6 | ||
|
|
ff82c5171b | ||
|
|
f9bd6310f1 | ||
|
|
471eab126e | ||
|
|
6ad011d12d | ||
|
|
561c8aff85 | ||
|
|
5cf5dd2234 | ||
|
|
fb9915d301 | ||
|
|
7ab67194d6 | ||
|
|
603ac9d8c5 | ||
|
|
a3c7811e9d | ||
|
|
a3778dfe8b | ||
|
|
2dff934612 | ||
|
|
89d666948e | ||
|
|
c3499142b0 | ||
|
|
d8feccc715 | ||
|
|
16173355f3 | ||
|
|
f46134fda5 | ||
|
|
bfecff0412 | ||
|
|
168f1891cf | ||
|
|
862845b4ac | ||
|
|
b7a5dbff49 | ||
|
|
5be30d89a7 | ||
|
|
d94dc51d88 | ||
|
|
22acd88d44 | ||
|
|
fd406c106b | ||
|
|
16134b5caf | ||
|
|
2c485efced | ||
|
|
279d08a0e8 | ||
|
|
1d4a8998e1 | ||
|
|
47a41e7980 | ||
|
|
ecfc4a8cb2 | ||
|
|
2d66b6266b | ||
|
|
b7afb5f9d2 | ||
|
|
58c16a59ac | ||
|
|
f09789f5ef | ||
|
|
b2e12cd3e0 | ||
|
|
71b157a8ba | ||
|
|
cb8affe9b2 | ||
|
|
3f7180c706 | ||
|
|
f0bc2dc62f | ||
|
|
9c95fd6b69 | ||
|
|
c0fda8c3a2 | ||
|
|
bac20af381 | ||
|
|
626211a320 | ||
|
|
783aaa8cb4 | ||
|
|
768bd8af19 | ||
|
|
3894f52194 | ||
|
|
dcfa9edb1c | ||
|
|
4ebdb5629c | ||
|
|
75b0668fc2 | ||
|
|
5fe94ed463 | ||
|
|
db21b97603 | ||
|
|
8074d0c548 | ||
|
|
2d611afbb0 | ||
|
|
bc42507724 | ||
|
|
ff82ab5718 | ||
|
|
62fe374e15 | ||
|
|
e519a3bc39 | ||
|
|
4f146d12ee | ||
|
|
46d6074ad5 | ||
|
|
cbb61f1240 | ||
|
|
0e9f3c3576 | ||
|
|
92f11dc075 | ||
|
|
3aa0a0999b | ||
|
|
e86fbcfa5b | ||
|
|
0b2ee6fdaf | ||
|
|
35f3866882 | ||
|
|
d86bea80d3 | ||
|
|
13b4b5072f | ||
|
|
efae43f122 | ||
|
|
45e8c8692b | ||
|
|
f8fc2a5050 | ||
|
|
3c20d57cc4 | ||
|
|
2cb3858330 | ||
|
|
925d36a561 | ||
|
|
0ffaca91cc | ||
|
|
d3a0f1d969 | ||
|
|
37704db583 | ||
|
|
aadd038bbe | ||
|
|
6d601b4267 | ||
|
|
194798d881 | ||
|
|
1a10495645 | ||
|
|
0e2316513e | ||
|
|
72ce4e2fad | ||
|
|
4ad7311e18 | ||
|
|
fa2b0e8fad | ||
|
|
78eb926693 | ||
|
|
3613efbaab | ||
|
|
2e732854b3 | ||
|
|
f9560d6b1d | ||
|
|
51b0826398 | ||
|
|
af0adb454d | ||
|
|
cdd4c571b0 | ||
|
|
9c440764c7 | ||
|
|
6e94834033 | ||
|
|
1720ed23c9 | ||
|
|
137fab1d92 | ||
|
|
0fee63fa81 | ||
|
|
d5f0d80eed | ||
|
|
b7d4d43f56 | ||
|
|
c0379a1981 | ||
|
|
e5db8e42d1 | ||
|
|
27cf9806f0 | ||
|
|
5dbb5cd112 | ||
|
|
af75569eb8 | ||
|
|
aebf2ff270 | ||
|
|
3bcdeda3e9 | ||
|
|
7433667243 | ||
|
|
d7c009167f | ||
|
|
79f198d6fe | ||
|
|
315a12b9df | ||
|
|
e14d145f2c | ||
|
|
f839da39f0 | ||
|
|
45ca7a63ed | ||
|
|
5d187255ae | ||
|
|
7adf6aed59 | ||
|
|
b22a7a0234 | ||
|
|
8805723114 | ||
|
|
88db4358f5 | ||
|
|
a5d9685caf | ||
|
|
94ff8e6beb | ||
|
|
f3400d9bc1 | ||
|
|
6a6591e41d | ||
|
|
a3a53f3b06 | ||
|
|
2f39abfdb8 | ||
|
|
92239d66fc | ||
|
|
178813806f | ||
|
|
265dbffc53 | ||
|
|
a67a08a4d0 | ||
|
|
6d15f55304 | ||
|
|
0dbcd1f265 | ||
|
|
a0f6380f90 | ||
|
|
ab69cf5bf4 | ||
|
|
3e55a5526a | ||
|
|
b6216bb701 | ||
|
|
fa3ea3aaa7 | ||
|
|
7b56e3a6c3 | ||
|
|
00ad542a11 | ||
|
|
c3e00eea2c | ||
|
|
5c8dd911e3 | ||
|
|
407fd62da5 | ||
|
|
c92f7ca0d8 | ||
|
|
676901e113 | ||
|
|
c099b53a03 | ||
|
|
fd065e4e7c | ||
|
|
fd97527561 | ||
|
|
7b9647a063 | ||
|
|
bf943f1347 | ||
|
|
dbff610d77 | ||
|
|
46aae9486e | ||
|
|
70066de390 | ||
|
|
106af9d444 | ||
|
|
f0be267f9f | ||
|
|
edbaec7265 | ||
|
|
f4537a538b | ||
|
|
d6eb6f33d2 | ||
|
|
7a139c261a | ||
|
|
2e7aa213ed | ||
|
|
d9344287e4 | ||
|
|
b9768a81e9 | ||
|
|
3418c07512 | ||
|
|
5f8621c224 | ||
|
|
c05f3555a3 | ||
|
|
f21827395b | ||
|
|
894c7bb17a | ||
|
|
2028cfae4d | ||
|
|
2064f65c04 | ||
|
|
1de4a4eaa2 | ||
|
|
06ff45d0c2 | ||
|
|
81474e252e | ||
|
|
0069265905 | ||
|
|
dec15f6797 | ||
|
|
f6041cd844 | ||
|
|
ec20d3981b | ||
|
|
08a867ef5a | ||
|
|
76c8296a5d | ||
|
|
f65059dd7f | ||
|
|
e23fef3f64 | ||
|
|
30234f913c | ||
|
|
2dd017bddc | ||
|
|
b25a298087 | ||
|
|
8635a7c182 | ||
|
|
46d25df241 | ||
|
|
0338ccb08f | ||
|
|
8899a575b8 | ||
|
|
b4407b1ff3 | ||
|
|
75f0aebe8f | ||
|
|
5a2dd53636 | ||
|
|
3555154c3e | ||
|
|
6c92c282e7 | ||
|
|
bd1847e5ba | ||
|
|
38727d6203 | ||
|
|
7e6d557d01 | ||
|
|
5d3ce91839 | ||
|
|
1f34e3005e | ||
|
|
8e27437086 | ||
|
|
b4cbe8029e | ||
|
|
92f3fd2063 | ||
|
|
1112b331ef | ||
|
|
ec34e84a3a | ||
|
|
bc9eee326a | ||
|
|
c9106c3a6f | ||
|
|
fa949f977a | ||
|
|
4c2d61bb9b | ||
|
|
ec7b14da8c | ||
|
|
771af4991c | ||
|
|
a08ce9ecb7 | ||
|
|
4d84a4f528 | ||
|
|
5d92baf35e | ||
|
|
ac5171e95e | ||
|
|
697ac311fe | ||
|
|
c22d1173af | ||
|
|
c0cc5fa9fd | ||
|
|
4bd9a9cdda | ||
|
|
63f8139dbc | ||
|
|
be731a5977 | ||
|
|
dd4ce4cea4 | ||
|
|
2548a2eee8 | ||
|
|
03948d6785 | ||
|
|
4c1c17eea6 | ||
|
|
b258d22d25 | ||
|
|
aef43e6bca | ||
|
|
3d7362743d | ||
|
|
96f3d5a805 | ||
|
|
2df500e027 | ||
|
|
346f24022a | ||
|
|
cb45c7ef16 | ||
|
|
9cfb57dc4b | ||
|
|
020d852758 | ||
|
|
8d97fcd735 | ||
|
|
097fe3114e | ||
|
|
5e0fd265ff | ||
|
|
6af137a085 | ||
|
|
3cdc8511a8 | ||
|
|
2d515eea4c | ||
|
|
61289119cb | ||
|
|
b6bc995e40 | ||
|
|
b0bb41bac6 | ||
|
|
0927a92652 | ||
|
|
f51061d650 | ||
|
|
74314f00ca | ||
|
|
81c5ef4a23 | ||
|
|
72e329b08e | ||
|
|
50f884663f | ||
|
|
0d81eb4b29 | ||
|
|
978a9407fa | ||
|
|
2c3b74cdc1 | ||
|
|
448e0f54be | ||
|
|
17f638e991 | ||
|
|
b78d3d8eda | ||
|
|
02a7e467e2 | ||
|
|
15304890f5 | ||
|
|
9ea96e431c | ||
|
|
7b3bfea614 | ||
|
|
d68637c2c8 | ||
|
|
f009306030 | ||
|
|
ca97cba18b | ||
|
|
a46c8c5398 | ||
|
|
88c2e2bd70 | ||
|
|
1bbcee8715 | ||
|
|
39a8fa3335 | ||
|
|
fe067e5367 | ||
|
|
5efbd17829 | ||
|
|
fa3e54a747 | ||
|
|
603beccb01 | ||
|
|
4b20afd599 | ||
|
|
adbe283c83 | ||
|
|
1908d7e29a | ||
|
|
7c6e16cfbc | ||
|
|
1480d23088 | ||
|
|
4be3522209 | ||
|
|
5381e0300f | ||
|
|
cde822ebf8 | ||
|
|
72d3525da1 | ||
|
|
dc867fa051 | ||
|
|
eaf3fcade8 | ||
|
|
3df270e4ac | ||
|
|
7937392dfc | ||
|
|
9c1c0f8d1f | ||
|
|
ad2ab0d164 | ||
|
|
c4bed94eb0 | ||
|
|
edc8eb55de | ||
|
|
f4f9868381 | ||
|
|
f103bebe05 | ||
|
|
c168af46bc | ||
|
|
7d82248903 | ||
|
|
e6cb269754 | ||
|
|
ac8a96398a | ||
|
|
86c79c7c60 | ||
|
|
0c47b3f3ea | ||
|
|
b2b500c5dc | ||
|
|
efc8468268 | ||
|
|
205baebd48 | ||
|
|
af9ba2750d | ||
|
|
e04afdbe4c | ||
|
|
e94fd9590e | ||
|
|
4f4f05abdf | ||
|
|
bcf93e1d9f | ||
|
|
48198bdd89 | ||
|
|
fbb4f3e5dd | ||
|
|
cefd1cf030 | ||
|
|
f8fa544e31 | ||
|
|
27885a4cbc | ||
|
|
185a62958f | ||
|
|
1ba748f2a4 | ||
|
|
90a75a9b3d | ||
|
|
215295efb1 | ||
|
|
2413bd9e0d | ||
|
|
356ae650fd | ||
|
|
2444c24545 | ||
|
|
7727708a3a | ||
|
|
0bfacd84f4 | ||
|
|
b271c1ca3c | ||
|
|
75660febc1 | ||
|
|
13aaa174e1 | ||
|
|
d112c728fc | ||
|
|
826af4a9fd | ||
|
|
c9693d355f | ||
|
|
9f37cb8ce6 | ||
|
|
d99e8ca565 | ||
|
|
44312125ab | ||
|
|
7558721642 | ||
|
|
fb49f7fb5d | ||
|
|
ee7f2c2f47 | ||
|
|
833fe006af | ||
|
|
9be0607b2e | ||
|
|
6dc3f2ffa6 | ||
|
|
df7cbf0b76 | ||
|
|
19b6378b1a | ||
|
|
29cb2b50a8 | ||
|
|
5932c014a0 | ||
|
|
a3f75e9af0 | ||
|
|
9ed31e2c4e | ||
|
|
8599f63fbf | ||
|
|
07de78cb05 | ||
|
|
f764bbe080 | ||
|
|
7aa343b767 | ||
|
|
69198779a7 | ||
|
|
3088032ad8 | ||
|
|
dfaa12598d | ||
|
|
1c724cdc6c | ||
|
|
b59423fb01 | ||
|
|
96bceed102 | ||
|
|
f8e146b9b9 | ||
|
|
c54ddb644a | ||
|
|
2be616411f | ||
|
|
7415744807 | ||
|
|
23905a90f4 | ||
|
|
83444b329e | ||
|
|
9898dc85a9 | ||
|
|
661287f600 | ||
|
|
353c6a77e9 | ||
|
|
8c006fec3f | ||
|
|
5896b7ce6a | ||
|
|
f831f6cb2c | ||
|
|
b505a1ae01 | ||
|
|
a0fac17c0e | ||
|
|
851f606fc0 | ||
|
|
8940430ee0 | ||
|
|
06d3927275 | ||
|
|
7cea13e90d | ||
|
|
de2a504078 | ||
|
|
df14b441a3 | ||
|
|
ab1391440f | ||
|
|
310d32dcea | ||
|
|
f8cd822c92 | ||
|
|
3ade885e41 | ||
|
|
008a88192c | ||
|
|
639e7f012c | ||
|
|
c8ecc16648 | ||
|
|
225fb1ec0c | ||
|
|
c943e0e9b4 | ||
|
|
3d8ac83fcc | ||
|
|
06399ca8af | ||
|
|
8f8fc13ded | ||
|
|
2b018cb9a5 | ||
|
|
9577f4c9a3 | ||
|
|
771d98cc10 | ||
|
|
91e875d54c | ||
|
|
da39f1489f | ||
|
|
2940576681 | ||
|
|
a49c137b78 | ||
|
|
87e748cd83 | ||
|
|
94c2e332bb | ||
|
|
1437b6010e | ||
|
|
5fc203482d | ||
|
|
ff6d81b749 | ||
|
|
167e644bd0 | ||
|
|
d1c7489768 | ||
|
|
a783e165dd | ||
|
|
45bdd82864 | ||
|
|
79c5cb6b78 | ||
|
|
63ade5fdef | ||
|
|
853b8c7aa3 | ||
|
|
0655fb60de | ||
|
|
69b28e3508 | ||
|
|
5c16d9539f | ||
|
|
e3acf02bde | ||
|
|
10268e82d4 | ||
|
|
bc44bf726a | ||
|
|
9839681bc0 | ||
|
|
beb292cb07 | ||
|
|
29c4134f60 | ||
|
|
a6157f328d | ||
|
|
c6432e2c28 | ||
|
|
4a756bf2a9 | ||
|
|
b77cc5cd40 | ||
|
|
9f94af6ff7 | ||
|
|
7aba40cd5b | ||
|
|
fb6c17c5ff | ||
|
|
4504d80c80 | ||
|
|
8a8c8989cb | ||
|
|
20731dbe4b | ||
|
|
55393ca9eb | ||
|
|
e9aa4d5601 | ||
|
|
6d49769df9 | ||
|
|
0333e9d094 | ||
|
|
53bedca50a | ||
|
|
b9518ca987 | ||
|
|
794e713d6d | ||
|
|
5e1fd7501e | ||
|
|
c86ea206d9 | ||
|
|
b810cf84c2 | ||
|
|
15bc5db2ed | ||
|
|
4845d9005e | ||
|
|
bed4e9f1e1 | ||
|
|
7b20db10cc | ||
|
|
d59b3e8c46 | ||
|
|
8fccbb0ac2 | ||
|
|
f36a610e52 | ||
|
|
479a2f358e | ||
|
|
8795c357ae | ||
|
|
d8cb7526bb | ||
|
|
6ead8e391b | ||
|
|
362f45083d | ||
|
|
36218037ec | ||
|
|
584b56bc83 | ||
|
|
d33602e131 | ||
|
|
4304b49bf0 | ||
|
|
4f5325acac | ||
|
|
f8a40bfaf0 | ||
|
|
52dfb20a2b | ||
|
|
34b20cdfe0 | ||
|
|
f462201499 | ||
|
|
5106bdf634 | ||
|
|
b93c6dbcbd | ||
|
|
2ca141baba | ||
|
|
01fe5d2147 | ||
|
|
74830cede4 | ||
|
|
2f21cc29f7 | ||
|
|
05f8d97d68 | ||
|
|
04c4795192 | ||
|
|
ff6e379b6f | ||
|
|
25cfc375bc | ||
|
|
627184ef2d | ||
|
|
180e1178ef | ||
|
|
1c33454ce3 | ||
|
|
c7abe11dd8 | ||
|
|
7a6feccc8b | ||
|
|
f05e578f51 | ||
|
|
277ebea2b5 | ||
|
|
4982c5e147 | ||
|
|
726e217205 | ||
|
|
695c538ee5 | ||
|
|
e9b287ceac | ||
|
|
ecdae68b62 | ||
|
|
e737564b32 | ||
|
|
75c4a8d96d | ||
|
|
28dc1b050f | ||
|
|
4a9a7e31ba | ||
|
|
92da31f905 | ||
|
|
afd264c816 | ||
|
|
d676e3e217 | ||
|
|
4af117aacf | ||
|
|
b27e567a5e | ||
|
|
8ec9a5bf99 | ||
|
|
f129f92cfd | ||
|
|
ef87373d4b | ||
|
|
ff938d4ced | ||
|
|
ae555e0ce1 | ||
|
|
44db6093f5 | ||
|
|
d4bf6ce201 | ||
|
|
0b1c7bfa30 | ||
|
|
80f8a345b5 | ||
|
|
c929ce0257 | ||
|
|
7d3ab357d0 | ||
|
|
84d87602b8 | ||
|
|
14938ea7dd | ||
|
|
be0c052e5e | ||
|
|
af90a6658e | ||
|
|
9720c979b3 | ||
|
|
7c86186416 | ||
|
|
404dbfe725 | ||
|
|
02eac208dd | ||
|
|
bc9a0432cd | ||
|
|
dba7846d6c | ||
|
|
238d7723bb | ||
|
|
d2724bb1a5 | ||
|
|
8e046a9b50 | ||
|
|
1b808afd5d | ||
|
|
8d6f69eb05 | ||
|
|
c4562df955 | ||
|
|
8e1e8a8be3 | ||
|
|
363e92e072 | ||
|
|
c5a52fdb6d | ||
|
|
2dd096cfab | ||
|
|
80e1ce12ce | ||
|
|
2777d957e4 |
9
.codecov.yml
Normal file
9
.codecov.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
comment: off
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
threshold: 5%
|
||||
patch:
|
||||
default:
|
||||
only_pulls: true
|
||||
3
.docker-entry.sh
Executable file
3
.docker-entry.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
cp -nr /oopt-gnpy/gnpy/example-data /shared
|
||||
exec "$@"
|
||||
29
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
29
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Environment:**
|
||||
- OS: [e.g. Windows]
|
||||
- Python Version [e.g, 3.7]
|
||||
- Anaconda Version [e.g. 3.7]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
7
.github/pull_request_template.md
vendored
Normal file
7
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Thanks for contributing to GNPy
|
||||
|
||||
If it isn't much trouble, please send your contribution as patches to our Gerrit.
|
||||
Here's [how to submit patches](https://review.gerrithub.io/Documentation/intro-gerrit-walkthrough-github.html), and here's a [list of stuff we are currently working on](https://review.gerrithub.io/q/project:Telecominfraproject/oopt-gnpy+status:open).
|
||||
Just sign in via your existing GitHub account.
|
||||
|
||||
However, if you feel more comfortable with filing GitHub PRs, we can work with that too.
|
||||
145
.github/workflows/main.yml
vendored
Normal file
145
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
name: CI
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Tox test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: fedora-python/tox-github-action@v37.0
|
||||
with:
|
||||
tox_env: ${{ matrix.tox_env }}
|
||||
dnf_install: ${{ matrix.dnf_install }}
|
||||
- uses: codecov/codecov-action@v3.1.1
|
||||
if: ${{ endswith(matrix.tox_env, '-cover') }}
|
||||
with:
|
||||
files: ${{ github.workspace }}/cover/coverage.xml
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
tox_env:
|
||||
- py38
|
||||
- py39
|
||||
- py310
|
||||
- py311
|
||||
- py312-cover
|
||||
include:
|
||||
- tox_env: docs
|
||||
dnf_install: graphviz
|
||||
|
||||
pypi:
|
||||
needs: build
|
||||
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'Telecominfraproject' }}
|
||||
name: PyPI packaging
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v4
|
||||
name: Install Python
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- uses: casperdcl/deploy-pypi@bb869aafd89f657ceaafe9561d3b5584766c0f95
|
||||
with:
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
pip: wheel -w dist/ --no-deps .
|
||||
upload: true
|
||||
|
||||
docker:
|
||||
needs: build
|
||||
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) && github.repository_owner == 'Telecominfraproject' }}
|
||||
name: Docker image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: jktjkt
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Extract tag name
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||
id: extract_pretty_git
|
||||
run: echo ::set-output name=GIT_DESC::$(git describe --tags)
|
||||
- name: Build and push a container
|
||||
uses: docker/build-push-action@v2
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
telecominfraproject/oopt-gnpy:${{ steps.extract_pretty_git.outputs.GIT_DESC }}
|
||||
telecominfraproject/oopt-gnpy:master
|
||||
- name: Extract tag name
|
||||
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
||||
id: extract_tag_name
|
||||
run: echo ::set-output name=GIT_DESC::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Build and push a container
|
||||
uses: docker/build-push-action@v2
|
||||
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
telecominfraproject/oopt-gnpy:${{ steps.extract_tag_name.outputs.GIT_DESC }}
|
||||
telecominfraproject/oopt-gnpy:latest
|
||||
|
||||
other-platforms:
|
||||
name: Tests on other platforms
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
- run: |
|
||||
pip install --editable .[tests]
|
||||
pytest -vv
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-2019
|
||||
python_version: "3.10"
|
||||
- os: windows-2022
|
||||
python_version: "3.11"
|
||||
- os: windows-2022
|
||||
python_version: "3.12"
|
||||
- os: macos-12
|
||||
python_version: "3.11"
|
||||
- os: macos-13
|
||||
python_version: "3.12"
|
||||
|
||||
paywalled-platforms:
|
||||
name: Tests on paywalled platforms
|
||||
if: github.repository_owner == 'Telecominfraproject'
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
- run: |
|
||||
pip install --editable .[tests]
|
||||
pytest -vv
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-13-xlarge # Apple M1 CPU
|
||||
python_version: "3.12"
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,6 +2,8 @@
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
.ipynb_checkpoints
|
||||
.idea
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
4
.gitreview
Normal file
4
.gitreview
Normal file
@@ -0,0 +1,4 @@
|
||||
[gerrit]
|
||||
host=review.gerrithub.io
|
||||
project=Telecominfraproject/oopt-gnpy
|
||||
defaultrebase=0
|
||||
3
.lgtm.yml
Normal file
3
.lgtm.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
queries:
|
||||
- exclude: py/clear-text-logging-sensitive-data
|
||||
- exclude: py/clear-text-storage-sensitive-data
|
||||
17
.readthedocs.yml
Normal file
17
.readthedocs.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
version: 2
|
||||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.12"
|
||||
apt_packages:
|
||||
- graphviz
|
||||
|
||||
python:
|
||||
install:
|
||||
- method: pip
|
||||
path: .
|
||||
extra_requirements:
|
||||
- docs
|
||||
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
@@ -1,9 +0,0 @@
|
||||
language: python
|
||||
python:
|
||||
- "3.6"
|
||||
# command to install dependencies
|
||||
install:
|
||||
- pip install -r requirements.txt
|
||||
# command to run tests
|
||||
script:
|
||||
- pytest
|
||||
54
.zuul.yaml
Normal file
54
.zuul.yaml
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
- project:
|
||||
check:
|
||||
jobs:
|
||||
- tox-py38:
|
||||
vars:
|
||||
ensure_tox_version: '<4'
|
||||
- tox-py39:
|
||||
vars:
|
||||
ensure_tox_version: '<4'
|
||||
- tox-py310-cover:
|
||||
vars:
|
||||
ensure_tox_version: '<4'
|
||||
- tox-docs-f36:
|
||||
vars:
|
||||
ensure_tox_version: '<4'
|
||||
- coverage-diff:
|
||||
voting: false
|
||||
dependencies:
|
||||
- tox-py310-cover-previous
|
||||
- tox-py310-cover
|
||||
vars:
|
||||
coverage_job_name_previous: tox-py310-cover-previous
|
||||
coverage_job_name_current: tox-py310-cover
|
||||
- tox-linters-diff-n-report:
|
||||
voting: false
|
||||
vars:
|
||||
ensure_tox_version: '<4'
|
||||
- tox-py310-cover-previous:
|
||||
vars:
|
||||
ensure_tox_version: '<4'
|
||||
tag:
|
||||
jobs:
|
||||
- oopt-release-python:
|
||||
secrets:
|
||||
- secret: pypi-oopt-gnpy
|
||||
name: pypi_info
|
||||
pass-to-parent: true
|
||||
|
||||
- secret:
|
||||
name: pypi-oopt-gnpy
|
||||
data:
|
||||
username: __token__
|
||||
password: !encrypted/pkcs1-oaep
|
||||
- Taod9JmSMtVAvC5ShSbB3UWuccktQvutdySrj0G7a1Nk4tKFQIdwDXEnBuLpHsZVvsU9Q
|
||||
6uk4wRVQABDSdNNI/+M/1FwmZfoxuOXa02U5S1deuxW/rBHTxzYcuB8xriwhArBvTiDMk
|
||||
zyWHVysgDsjlR+85h/DkEhvsaMRDLYWqFwYgXizMoGNKVkwDVIH+qkhBmbggQfDpcYPKT
|
||||
1gq0d6fw0eKVJtO8+vonMEcE0sWZvHmZvSSu0H++gxoe1W/JtzbCteH3Ak0zktwBHI8Qt
|
||||
WBqFvY3laad335tpkFJN5b949N+DP8svCWwRwXmkZlHplPYZWF6QpYbEEXL/6Q0H6VwL+
|
||||
om4f7ybYpKe9Gl939uv2INnXaKe5EU6CMsSw40r2XZCjnSTjWOTgh9pUn2PsoHnqUlALW
|
||||
VR4Z+ipnCrEbu8aTmX3ROcnwYNS7OXkq4uhwDU1u9QjzyMHet6NQQhwhGtimsTo9KhL4E
|
||||
TEUNiRlbAgow9WOwM5r3vRzddO8T2HZZSGaWj75qNRX46XPQWRWgB7ItAwyXgwLZ8UzWl
|
||||
HdztjS3D7Hlsqno3zxNOVlhA5/vl9uVnhFbJnMtUOJAB07YoTJOeR+LjQ0avx/VzopxXc
|
||||
RA/WvJXVZSBrlAHY0+ip4wPZvdi4Ph90gpmvHJvoH82KVfp2j5jxzUhsage94I=
|
||||
15
AUTHORS.rst
15
AUTHORS.rst
@@ -6,14 +6,27 @@ To learn how to contribute, please see CONTRIBUTING.md
|
||||
(*in alphabetical order*)
|
||||
|
||||
- Alessio Ferrari (Politecnico di Torino) <alessio.ferrari@polito.it>
|
||||
- Anders Lindgren (Telia Company) <Anders.X.Lindgren@teliacompany.com>
|
||||
- Andrea D'Amico (Politecnico di Torino) <andrea.damico@polito.it>
|
||||
- Brian Taylor (Facebook) <briantaylor@fb.com>
|
||||
- David Boertjes (Ciena) <dboertje@ciena.com>
|
||||
- Diego Landa (Facebook) <dlanda@fb.com>
|
||||
- Emmanuelle Delfour (Orange) <WEDE7391@orange.com>
|
||||
- Esther Le Rouzic (Orange) <esther.lerouzic@orange.com>
|
||||
- Gabriele Galimberti (Cisco) <ggalimbe@cisco.com>
|
||||
- Gert Grammel (Juniper Networks) <ggrammel@juniper.net>
|
||||
- Giacomo Borraccini (Politecnico di Torino) <giacomo.borraccini@polito.it>
|
||||
- Gilad Goldfarb (Facebook) <giladg@fb.com>
|
||||
- James Powell (Telecom Infra Project) <james.powell@telecominfraproject.com>
|
||||
- Jeanluc Auge (Orange) <jeanluc.auge@orange.com>
|
||||
- Jan Kundrát (Telecom Infra Project) <jkt@jankundrat.com>
|
||||
- Jeanluc Augé (Orange) <jeanluc.auge@orange.com>
|
||||
- Jonas Mårtensson (RISE) <jonas.martensson@ri.se>
|
||||
- Mattia Cantono (Politecnico di Torino) <mattia.cantono@polito.it>
|
||||
- Miguel Garrich (University Catalunya) <miquel.garrich@upct.es>
|
||||
- Raj Nagarajan (Lumentum) <raj.nagarajan@lumentum.com>
|
||||
- Roberts Miculens (Lattelecom) <roberts.miculens@lattelecom.lv>
|
||||
- Sami Alavi (NUST) <sami.mansooralavi1999@gmail.com>
|
||||
- Shengxiang Zhu (University of Arizona) <szhu@email.arizona.edu>
|
||||
- Stefan Melin (Telia Company) <Stefan.Melin@teliacompany.com>
|
||||
- Vittorio Curri (Politecnico di Torino) <vittorio.curri@polito.it>
|
||||
- Xufeng Liu (Jabil) <xufeng_liu@jabil.com>
|
||||
|
||||
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM python:3.9-slim
|
||||
COPY . /oopt-gnpy
|
||||
WORKDIR /oopt-gnpy
|
||||
RUN apt update; apt install -y git
|
||||
RUN pip install .
|
||||
WORKDIR /shared/example-data
|
||||
ENTRYPOINT ["/oopt-gnpy/.docker-entry.sh"]
|
||||
CMD ["/bin/bash"]
|
||||
31
README.md
Normal file
31
README.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# GNPy: Optical Route Planning and DWDM Network Optimization
|
||||
|
||||
[](https://pypi.org/project/gnpy/)
|
||||
[](https://pypi.org/project/gnpy/)
|
||||
[](http://gnpy.readthedocs.io/en/master/?badge=master)
|
||||
[](https://github.com/Telecominfraproject/oopt-gnpy/actions/workflows/main.yml)
|
||||
[](https://review.gerrithub.io/q/project:Telecominfraproject/oopt-gnpy+is:open)
|
||||
[](https://github.com/Telecominfraproject/oopt-gnpy/graphs/contributors)
|
||||
[](https://codecov.io/gh/Telecominfraproject/oopt-gnpy)
|
||||
[](https://doi.org/10.5281/zenodo.3458319)
|
||||
[](https://matrix.to/#/%23oopt-gnpy%3Amatrix.org?via=matrix.org)
|
||||
|
||||
GNPy is an open-source, community-developed library for building route planning and optimization tools in real-world mesh optical networks.
|
||||
We are a consortium of operators, vendors, and academic researchers sponsored via the [Telecom Infra Project](http://telecominfraproject.com)'s [OOPT/PSE](https://telecominfraproject.com/open-optical-packet-transport) working group.
|
||||
Together, we are building this tool for rapid development of production-grade route planning tools which is easily extensible to include custom network elements and performant to the scale of real-world mesh optical networks.
|
||||
|
||||

|
||||
|
||||
## Quick Start
|
||||
|
||||
Install either via [Docker](https://gnpy.readthedocs.io/en/master/install.html#using-prebuilt-docker-images), or as a [Python package](https://gnpy.readthedocs.io/en/master/install.html#using-python-on-your-computer).
|
||||
Read our [documentation](https://gnpy.readthedocs.io/), learn from the demos, and [get in touch with us](https://github.com/Telecominfraproject/oopt-gnpy/discussions).
|
||||
|
||||
This example demonstrates how GNPy can be used to check the expected SNR at the end of the line by varying the channel input power:
|
||||
|
||||

|
||||
|
||||
GNPy can do much more, including acting as a Path Computation Engine, tracking bandwidth requests, or advising the SDN controller about a best possible path through a large DWDM network.
|
||||
Learn more about this [in the documentation](https://gnpy.readthedocs.io/), or give it a [try online at `gnpy.app`](https://gnpy.app/):
|
||||
|
||||
[](https://gnpy.app/)
|
||||
191
README.rst
191
README.rst
@@ -1,191 +0,0 @@
|
||||
====
|
||||
`gnpy`: mesh optical network route planning and optimization library
|
||||
====
|
||||
|
||||
|docs| |build|
|
||||
|
||||
**gnpy is an open-source, community-developed library for building route planning
|
||||
and optimization tools in real-world mesh optical networks.**
|
||||
|
||||
`gnpy <http://github.com/telecominfraproject/gnpy>`_ is:
|
||||
|
||||
- a sponsored project of the `OOPT/PSE <http://telecominfraproject.com/project-groups-2/backhaul-projects/open-optical-packet-transport/>`_ working group of the `Telecom Infra Project <http://telecominfraproject.com>`_.
|
||||
- fully community-driven, fully open source library
|
||||
- driven by a consortium of operators, vendors, and academic researchers
|
||||
- intended for rapid development of production-grade route planning tools
|
||||
- easily extensible to include custom network elements
|
||||
- performant to the scale of real-world mesh optical networks
|
||||
|
||||
Documentation: https://gnpy.readthedocs.io
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
``gnpy`` is hosted in the `Python Package Index <http://pypi.org/>`_ (`gnpy <https://pypi.org/project/gnpy/>`_). It can be installed via:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ pip install gnpy
|
||||
|
||||
It can also be installed directly from the repo.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ git clone https://github.com/telecominfraproject/gnpy
|
||||
$ cd gnpy
|
||||
$ python setup.py install
|
||||
|
||||
Both approaches above will handle installing any additional software dependencies.
|
||||
|
||||
**Note**: *We recommend the use of the Anaconda Python distribution
|
||||
(https://www.anaconda.com/download) which comes with many scientific
|
||||
computing dependencies pre-installed.*
|
||||
|
||||
Instructions for Use
|
||||
--------------------
|
||||
|
||||
``gnpy`` is a library for building route planning and optimization tools.
|
||||
|
||||
It ships with a number of example programs. Release versions will ship with
|
||||
fully-functional programs.
|
||||
|
||||
|
||||
**Note**: *If you are a network operator or involved in route planning and
|
||||
optimization for your organization, please contact project maintainer James
|
||||
Powell <james.powell@telecominfraproject>. gnpy is looking for users with
|
||||
specific, delineated use cases to drive requirements for future
|
||||
development.*
|
||||
|
||||
|
||||
**To get started, run the transmission example:**
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ python examples/transmission_main_example.py
|
||||
|
||||
By default, this script operates on a single span network defined in `examples/edfa/edfa_example_network.json <examples/edfa/edfa_example_network.json>`_
|
||||
|
||||
You can specify a different network at the command line as follows. For
|
||||
example, to use the CORONET Continental US (CONUS) network defined in `examples/coronet_conus_example.json <examples/coronet_conus_example.json>`_:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ python examples/transmission_main_example.py examples/coronet_conus_example.json
|
||||
|
||||
This script will calculate the average signal osnr and snr across 93 network
|
||||
elements (transceiver, ROADMs, fibers, and amplifiers) between Abilene, Texas
|
||||
and Albany, New York.
|
||||
|
||||
This script calculates the average signal OSNR = |OSNR| and SNR = |SNR|.
|
||||
|
||||
.. |OSNR| replace:: P\ :sub:`ch`\ /P\ :sub:`ase`
|
||||
.. |SNR| replace:: P\ :sub:`ch`\ /(P\ :sub:`nli`\ +\ P\ :sub:`ase`)
|
||||
|
||||
|Pase| is the amplified spontaneous emission noise, and |Pnli| the non-linear
|
||||
interference noise.
|
||||
|
||||
.. |Pase| replace:: P\ :sub:`ase`
|
||||
.. |Pnli| replace:: P\ :sub:`nli`
|
||||
|
||||
The `transmission_main_example.py <examples/transmission_main_example.py>`_
|
||||
script propagates a specrum of 96 channels at 32 Gbaud, 50 GHz spacing and 0
|
||||
dBm/channel. These are not yet parametrized but can be modified directly in the
|
||||
script (via the SpectralInformation tuple) to accomodate any baud rate,
|
||||
spacing, power or channel count demand.
|
||||
|
||||
The amplifier's gain is set to exactly compsenate for the loss in each network
|
||||
element. The amplifier is currently defined with gain range of 15 dB to 25 dB
|
||||
and 21 dBm max output power. Ripple and NF models are defined in
|
||||
`examples/edfa_config.json <examples/edfa_config.json>`_
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
``gnpy`` is looking for additional contributors, especially those with experience
|
||||
planning and maintaining large-scale, real-world mesh optical networks.
|
||||
|
||||
To get involved, please contact James Powell
|
||||
<james.powell@telecominfraproject.com> or Gert Grammel <ggrammel@juniper.net>.
|
||||
|
||||
``gnpy`` contributions are currently limited to members of `TIP
|
||||
<http://telecominfraproject.com>`_. Membership is free and open to all.
|
||||
|
||||
See the `Onboarding Guide
|
||||
<https://github.com/Telecominfraproject/gnpy/wiki/Onboarding-Guide>`_ for
|
||||
specific details on code contribtions.
|
||||
|
||||
See `AUTHORS.rst <AUTHORS.rst>`_ for past and present contributors.
|
||||
|
||||
Project Background
|
||||
------------------
|
||||
|
||||
Data Centers are built upon interchangeable, highly standardized node and
|
||||
network architectures rather than a sum of isolated solutions. This also
|
||||
translates to optical networking. It leads to a push in enabling multi-vendor
|
||||
optical network by disaggregating HW and SW functions and focussing on
|
||||
interoperability. In this paradigm, the burden of responsibility for ensuring
|
||||
the performance of such disaggregated open optical systems falls on the
|
||||
operators. Consequently, operators and vendors are collaborating in defining
|
||||
control models that can be readily used by off-the-shelf controllers. However,
|
||||
node and network models are only part of the answer. To take reasonable
|
||||
decisions, controllers need to incorporate logic to simulate and assess optical
|
||||
performance. Hence, a vendor-independent optical quality estimator is required.
|
||||
Given its vendor-agnostic nature, such an estimator needs to be driven by a
|
||||
consortium of operators, system and component suppliers.
|
||||
|
||||
Founded in February 2016, the Telecom Infra Project (TIP) is an
|
||||
engineering-focused initiative which is operator driven, but features
|
||||
collaboration across operators, suppliers, developers, integrators, and
|
||||
startups with the goal of disaggregating the traditional network deployment
|
||||
approach. The group’s ultimate goal is to help provide better connectivity for
|
||||
communities all over the world as more people come on-line and demand more
|
||||
bandwidth- intensive experiences like video, virtual reality and augmented
|
||||
reality.
|
||||
|
||||
Within TIP, the Open Optical Packet Transport (OOPT) project group is chartered
|
||||
with unbundling monolithic packet-optical network technologies in order to
|
||||
unlock innovation and support new, more flexible connectivity paradigms.
|
||||
|
||||
The key to unbundling is the ability to accurately plan and predict the
|
||||
performance of optical line systems based on an accurate simulation of optical
|
||||
parameters. Under that OOPT umbrella, the Physical Simulation Environment (PSE)
|
||||
working group set out to disrupt the planning landscape by providing an open
|
||||
source simulation model which can be used freely across multiple vendor
|
||||
implementations.
|
||||
|
||||
.. |docs| image:: https://readthedocs.org/projects/gnpy/badge/?version=develop
|
||||
:target: http://gnpy.readthedocs.io/en/develop/?badge=develop
|
||||
:alt: Documentation Status
|
||||
:scale: 100%
|
||||
|
||||
.. |build| image:: https://travis-ci.org/mcantono/gnpy.svg?branch=develop
|
||||
:target: https://travis-ci.org/mcantono/gnpy
|
||||
:alt: Build Status
|
||||
:scale: 100%
|
||||
|
||||
TIP OOPT/PSE & PSE WG Charter
|
||||
-----------------------------
|
||||
|
||||
We believe that openly sharing ideas, specifications, and other intellectual
|
||||
property is the key to maximizing innovation and reducing complexity
|
||||
|
||||
TIP OOPT/PSE's goal is to build an end-to-end simulation environment which
|
||||
defines the network models of the optical device transfer functions and their
|
||||
parameters. This environment will provide validation of the optical
|
||||
performance requirements for the TIP OLS building blocks.
|
||||
|
||||
- The model may be approximate or complete depending on the network complexity.
|
||||
Each model shall be validated against the proposed network scenario.
|
||||
- The environment must be able to process network models from multiple vendors,
|
||||
and also allow users to pick any implementation in an open source framework.
|
||||
- The PSE will influence and benefit from the innovation of the DTC, API, and
|
||||
OLS working groups.
|
||||
- The PSE represents a step along the journey towards multi-layer optimization.
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
``gnpy`` is distributed under a standard BSD 3-Clause License.
|
||||
|
||||
See `LICENSE <LICENSE>`_ for more details.
|
||||
|
||||
1
bindep.txt
Normal file
1
bindep.txt
Normal file
@@ -0,0 +1 @@
|
||||
graphviz
|
||||
59
docs/about-project.md
Normal file
59
docs/about-project.md
Normal file
@@ -0,0 +1,59 @@
|
||||
(about-gnpy)=
|
||||
# About the project
|
||||
|
||||
GNPy is a sponsored project of the [OOPT/PSE](https://telecominfraproject.com/open-optical-packet-transport/) working group of the [Telecom Infra Project](http://telecominfraproject.com).
|
||||
|
||||
There are weekly calls about our progress.
|
||||
Newcomers, users and telecom operators are especially welcome there.
|
||||
We encourage all interested people outside the TIP to [join the project](https://telecominfraproject.com/apply-for-membership/) and especially to [get in touch with us](https://github.com/Telecominfraproject/oopt-gnpy/discussions).
|
||||
|
||||
(contributing)=
|
||||
## Contributing
|
||||
|
||||
`gnpy` is looking for additional contributors, especially those with experience planning and maintaining large-scale, real-world mesh optical networks.
|
||||
|
||||
To get involved, please contact [Jan Kundrát](mailto:jkt@jankundrat.com) or [Gert Grammel](mailto:ggrammel@juniper.net).
|
||||
|
||||
`gnpy` contributions are currently limited to members of [TIP](http://telecominfraproject.com).
|
||||
Membership is free and open to all.
|
||||
|
||||
See the [Onboarding Guide](https://github.com/Telecominfraproject/gnpy/wiki/Onboarding-Guide) for specific details on code contributions, or just [upload patches to our Gerrit](https://review.gerrithub.io/Documentation/intro-gerrit-walkthrough-github.html).
|
||||
Here is [what we are currently working on](https://review.gerrithub.io/q/project:Telecominfraproject/oopt-gnpy+status:open).
|
||||
|
||||
## Project Background
|
||||
|
||||
Data Centers are built upon interchangeable, highly standardized node and network architectures rather than a sum of isolated solutions.
|
||||
This also translates to optical networking.
|
||||
It leads to a push in enabling multi-vendor optical network by disaggregating HW and SW functions and focusing on interoperability.
|
||||
In this paradigm, the burden of responsibility for ensuring the performance of such disaggregated open optical systems falls on the operators.
|
||||
Consequently, operators and vendors are collaborating in defining control models that can be readily used by off-the-shelf controllers.
|
||||
However, node and network models are only part of the answer.
|
||||
To take reasonable decisions, controllers need to incorporate logic to simulate and assess optical performance.
|
||||
Hence, a vendor-independent optical quality estimator is required.
|
||||
Given its vendor-agnostic nature, such an estimator needs to be driven by a consortium of operators, system and component suppliers.
|
||||
|
||||
Founded in February 2016, the Telecom Infra Project (TIP) is an engineering-focused initiative which is operator driven, but features collaboration across operators, suppliers, developers, integrators, and startups with the goal of disaggregating the traditional network deployment approach.
|
||||
The group’s ultimate goal is to help provide better connectivity for communities all over the world as more people come on-line and demand more bandwidth-intensive experiences like video, virtual reality and augmented reality.
|
||||
|
||||
Within TIP, the Open Optical Packet Transport (OOPT) project group is chartered with unbundling monolithic packet-optical network technologies in order to unlock innovation and support new, more flexible connectivity paradigms.
|
||||
|
||||
The key to unbundling is the ability to accurately plan and predict the performance of optical line systems based on an accurate simulation of optical parameters.
|
||||
Under that OOPT umbrella, the Physical Simulation Environment (PSE) working group set out to disrupt the planning landscape by providing an open source simulation model which can be used freely across multiple vendor implementations.
|
||||
|
||||
## TIP OOPT/PSE & PSE WG Charter
|
||||
|
||||
We believe that openly sharing ideas, specifications, and other intellectual property is the key to maximizing innovation and reducing complexity
|
||||
|
||||
TIP OOPT/PSE's goal is to build an end-to-end simulation environment which defines the network models of the optical device transfer functions and their parameters.
|
||||
This environment will provide validation of the optical performance requirements for the TIP OLS building blocks.
|
||||
|
||||
- The model may be approximate or complete depending on the network complexity.
|
||||
Each model shall be validated against the proposed network scenario.
|
||||
- The environment must be able to process network models from multiple vendors, and also allow users to pick any implementation in an open source framework.
|
||||
- The PSE will influence and benefit from the innovation of the DTC, API, and OLS working groups.
|
||||
- The PSE represents a step along the journey towards multi-layer optimization.
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
GNPy is distributed under a standard BSD 3-Clause License.
|
||||
@@ -874,7 +874,7 @@ month={Sept},}
|
||||
number = {7},
|
||||
journal = {Optics Express},
|
||||
urlyear = {2017-11-14},
|
||||
year = {2012-03-26},
|
||||
date = {2012-03-26},
|
||||
year = {2012},
|
||||
pages = {7777},
|
||||
author = {Bononi, A. and Serena, P. and Rossi, N. and Grellier, E. and Vacondio, F.}
|
||||
@@ -1114,7 +1114,7 @@ month={Sept},}
|
||||
number = {26},
|
||||
journal = {Optics Express},
|
||||
urlyear = {2017-11-16},
|
||||
year = {2013-12-30},
|
||||
date = {2013-12-30},
|
||||
year = {2013},
|
||||
pages = {32254},
|
||||
author = {Bononi, Alberto and Beucher, Ottmar and Serena, Paolo}
|
||||
@@ -1848,3 +1848,15 @@ month={Sept},}
|
||||
title = {Telecom Infra Project},
|
||||
url = {https://www.telecominfraproject.com},
|
||||
}
|
||||
|
||||
@ARTICLE{DAmicoJLT2022,
|
||||
author={D’Amico, Andrea and Correia, Bruno and London, Elliot and Virgillito,
|
||||
Emanuele and Borraccini, Giacomo and Napoli, Antonio and Curri, Vittorio},
|
||||
journal={Journal of Lightwave Technology},
|
||||
title={Scalable and Disaggregated GGN Approximation Applied to a C+L+S Optical Network},
|
||||
year={2022},
|
||||
volume={40},
|
||||
number={11},
|
||||
pages={3499-3511},
|
||||
doi={10.1109/JLT.2022.3162134}
|
||||
}
|
||||
|
||||
270
docs/concepts.rst
Normal file
270
docs/concepts.rst
Normal file
@@ -0,0 +1,270 @@
|
||||
.. _concepts:
|
||||
|
||||
Simulating networks with GNPy
|
||||
=============================
|
||||
|
||||
Running simulations with GNPy requires three pieces of information:
|
||||
|
||||
- the :ref:`network topology<concepts-topology>`, which describes how the network looks like, what are the fiber lengths, what amplifiers are used, etc.,
|
||||
- the :ref:`equipment library<concepts-equipment>`, which holds machine-readable datasheets of the equipment used in the network,
|
||||
- the :ref:`simulation options<concepts-simulation>` holding instructions about what to simulate, and under which conditions.
|
||||
|
||||
.. _concepts-topology:
|
||||
|
||||
Network Topology
|
||||
----------------
|
||||
|
||||
The *topology* acts as a "digital self" of the simulated network.
|
||||
When given a network topology, GNPy can either run a specific simulation as-is, or it can *optimize* the topology before performing the simulation.
|
||||
|
||||
A network topology for GNPy is often a generic, mesh network.
|
||||
This enables GNPy to take into consideration the current spectrum allocation as well as availability and resiliency considerations.
|
||||
When the time comes to run a particular *propagation* of a signal and its impairments are computed, though, a linear path through the network is used.
|
||||
For this purpose, the *path* through the network refers to an ordered, acyclic sequence of *nodes* that are processed.
|
||||
This path is directional, and all "GNPy elements" along the path match the unidirectional part of a real-world network equipment.
|
||||
|
||||
.. note::
|
||||
In practical terms, an amplifier in GNPy refers to an entity with a single input port and a single output port.
|
||||
A real-world inline EDFA enclosed in a single chassis will be therefore represented as two GNPy-level amplifiers.
|
||||
|
||||
The network topology contains not just the physical topology of the network, but also references to the :ref:`equipment library<concepts-equipment>` and a set of *operating parameters* for each entity.
|
||||
These parameters include the **fiber length** of each fiber, the connector **attenutation losses**, or an amplifier's specific **gain setting**.
|
||||
The topology is specified via :ref:`XLS files<excel>` or via :ref:`JSON<legacy-json>`.
|
||||
|
||||
.. _complete-vs-incomplete:
|
||||
|
||||
Fully Specified vs. Partially Designed Networks
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Let's consider a simple triangle topology with three :abbr:`PoPs (Points of Presence)` covering three cities:
|
||||
|
||||
.. graphviz::
|
||||
:layout: neato
|
||||
:align: center
|
||||
|
||||
graph "High-level topology with three PoPs" {
|
||||
A -- B
|
||||
B -- C
|
||||
C -- A
|
||||
}
|
||||
|
||||
In the real world, each city would probably host a ROADM and some transponders:
|
||||
|
||||
.. graphviz::
|
||||
:layout: neato
|
||||
:align: center
|
||||
|
||||
graph "Simplified topology with transponders" {
|
||||
"ROADM A" [pos="2,2!"]
|
||||
"ROADM B" [pos="4,2!"]
|
||||
"ROADM C" [pos="3,1!"]
|
||||
"Transponder A" [shape=box, pos="0,2!"]
|
||||
"Transponder B" [shape=box, pos="6,2!"]
|
||||
"Transponder C" [shape=box, pos="3,0!"]
|
||||
|
||||
"ROADM A" -- "ROADM B"
|
||||
"ROADM B" -- "ROADM C"
|
||||
"ROADM C" -- "ROADM A"
|
||||
|
||||
"Transponder A" -- "ROADM A"
|
||||
"Transponder B" -- "ROADM B"
|
||||
"Transponder C" -- "ROADM C"
|
||||
}
|
||||
|
||||
GNPy simulation works by propagating the optical signal over a sequence of elements, which means that one has to add some preamplifiers and boosters.
|
||||
The amplifiers are, by definition, unidirectional, so the graph becomes quite complex:
|
||||
|
||||
.. _topo-roadm-preamp-booster:
|
||||
|
||||
.. graphviz::
|
||||
:layout: neato
|
||||
:align: center
|
||||
|
||||
digraph "Preamps and boosters are explicitly modeled in GNPy" {
|
||||
"ROADM A" [pos="2,4!"]
|
||||
"ROADM B" [pos="6,4!"]
|
||||
"ROADM C" [pos="4,0!"]
|
||||
"Transponder A" [shape=box, pos="1,5!"]
|
||||
"Transponder B" [shape=box, pos="7,5!"]
|
||||
"Transponder C" [shape=box, pos="4,-1!"]
|
||||
|
||||
"Transponder A" -> "ROADM A"
|
||||
"Transponder B" -> "ROADM B"
|
||||
"Transponder C" -> "ROADM C"
|
||||
"ROADM A" -> "Transponder A"
|
||||
"ROADM B" -> "Transponder B"
|
||||
"ROADM C" -> "Transponder C"
|
||||
|
||||
"Booster A C" [shape=triangle, orientation=-150, fixedsize=true, width=0.5, height=0.5, pos="2.2,3.2!", color=red, label=""]
|
||||
"Preamp A C" [shape=triangle, orientation=0, fixedsize=true, width=0.5, height=0.5, pos="1.5,3.0!", color=red, label=""]
|
||||
"ROADM A" -> "Booster A C"
|
||||
"Preamp A C" -> "ROADM A"
|
||||
|
||||
"Booster A B" [shape=triangle, orientation=-90, fixedsize=true, width=0.5, height=0.5, pos="3,4.3!", color=red, fontcolor=red, labelloc=b, label="\N\n\n"]
|
||||
"Preamp A B" [shape=triangle, orientation=90, fixedsize=true, width=0.5, height=0.5, pos="3,3.6!", color=red, fontcolor=red, labelloc=t, label="\n \N"]
|
||||
"ROADM A" -> "Booster A B"
|
||||
"Preamp A B" -> "ROADM A"
|
||||
|
||||
"Booster C B" [shape=triangle, orientation=-30, fixedsize=true, width=0.5, height=0.5, pos="4.7,0.9!", color=red, label=""]
|
||||
"Preamp C B" [shape=triangle, orientation=120, fixedsize=true, width=0.5, height=0.5, pos="5.4,0.7!", color=red, label=""]
|
||||
"ROADM C" -> "Booster C B"
|
||||
"Preamp C B" -> "ROADM C"
|
||||
|
||||
"Booster C A" [shape=triangle, orientation=30, fixedsize=true, width=0.5, height=0.5, pos="2.6,0.7!", color=red, label=""]
|
||||
"Preamp C A" [shape=triangle, orientation=-30, fixedsize=true, width=0.5, height=0.5, pos="3.3,0.9!", color=red, label=""]
|
||||
"ROADM C" -> "Booster C A"
|
||||
"Preamp C A" -> "ROADM C"
|
||||
|
||||
"Booster B A" [shape=triangle, orientation=90, fixedsize=true, width=0.5, height=0.5, pos="5,3.6!", labelloc=t, color=red, fontcolor=red, label="\n\N "]
|
||||
"Preamp B A" [shape=triangle, orientation=-90, fixedsize=true, width=0.5, height=0.5, pos="5,4.3!", labelloc=b, color=red, fontcolor=red, label="\N\n\n"]
|
||||
"ROADM B" -> "Booster B A"
|
||||
"Preamp B A" -> "ROADM B"
|
||||
|
||||
"Booster B C" [shape=triangle, orientation=-180, fixedsize=true, width=0.5, height=0.5, pos="6.5,3.0!", color=red, label=""]
|
||||
"Preamp B C" [shape=triangle, orientation=-20, fixedsize=true, width=0.5, height=0.5, pos="5.8,3.2!", color=red, label=""]
|
||||
"ROADM B" -> "Booster B C"
|
||||
"Preamp B C" -> "ROADM B"
|
||||
|
||||
"Booster A C" -> "Preamp C A"
|
||||
"Booster A B" -> "Preamp B A"
|
||||
"Booster C A" -> "Preamp A C"
|
||||
"Booster C B" -> "Preamp B C"
|
||||
"Booster B C" -> "Preamp C B"
|
||||
"Booster B A" -> "Preamp A B"
|
||||
}
|
||||
|
||||
In many regions, the ROADMs are not placed physically close to each other, so the long-haul fiber links (:abbr:`OMS (Optical Multiplex Section)`) are split into individual spans (:abbr:`OTS (Optical Transport Section)`) by in-line amplifiers, resulting in an even more complicated topology graphs:
|
||||
|
||||
.. graphviz::
|
||||
:layout: neato
|
||||
:align: center
|
||||
|
||||
digraph "A subset of a real topology with inline amplifiers" {
|
||||
"ROADM A" [pos="2,4!"]
|
||||
"ROADM B" [pos="6,4!"]
|
||||
"ROADM C" [pos="4,-3!"]
|
||||
"Transponder A" [shape=box, pos="1,5!"]
|
||||
"Transponder B" [shape=box, pos="7,5!"]
|
||||
"Transponder C" [shape=box, pos="4,-4!"]
|
||||
|
||||
"Transponder A" -> "ROADM A"
|
||||
"Transponder B" -> "ROADM B"
|
||||
"Transponder C" -> "ROADM C"
|
||||
"ROADM A" -> "Transponder A"
|
||||
"ROADM B" -> "Transponder B"
|
||||
"ROADM C" -> "Transponder C"
|
||||
|
||||
"Booster A C" [shape=triangle, orientation=-166, fixedsize=true, width=0.5, height=0.5, pos="2.2,3.2!", label=""]
|
||||
"Preamp A C" [shape=triangle, orientation=0, fixedsize=true, width=0.5, height=0.5, pos="1.5,3.0!", label=""]
|
||||
"ROADM A" -> "Booster A C"
|
||||
"Preamp A C" -> "ROADM A"
|
||||
|
||||
"Booster A B" [shape=triangle, orientation=-90, fixedsize=true, width=0.5, height=0.5, pos="3,4.3!", label=""]
|
||||
"Preamp A B" [shape=triangle, orientation=90, fixedsize=true, width=0.5, height=0.5, pos="3,3.6!", label=""]
|
||||
"ROADM A" -> "Booster A B"
|
||||
"Preamp A B" -> "ROADM A"
|
||||
|
||||
"Booster C B" [shape=triangle, orientation=-30, fixedsize=true, width=0.5, height=0.5, pos="4.7,-2.1!", label=""]
|
||||
"Preamp C B" [shape=triangle, orientation=10, fixedsize=true, width=0.5, height=0.5, pos="5.4,-2.3!", label=""]
|
||||
"ROADM C" -> "Booster C B"
|
||||
"Preamp C B" -> "ROADM C"
|
||||
|
||||
"Booster C A" [shape=triangle, orientation=20, fixedsize=true, width=0.5, height=0.5, pos="2.6,-2.3!", label=""]
|
||||
"Preamp C A" [shape=triangle, orientation=-30, fixedsize=true, width=0.5, height=0.5, pos="3.3,-2.1!", label=""]
|
||||
"ROADM C" -> "Booster C A"
|
||||
"Preamp C A" -> "ROADM C"
|
||||
|
||||
"Booster B A" [shape=triangle, orientation=90, fixedsize=true, width=0.5, height=0.5, pos="5,3.6!", label=""]
|
||||
"Preamp B A" [shape=triangle, orientation=-90, fixedsize=true, width=0.5, height=0.5, pos="5,4.3!", label=""]
|
||||
"ROADM B" -> "Booster B A"
|
||||
"Preamp B A" -> "ROADM B"
|
||||
|
||||
"Booster B C" [shape=triangle, orientation=-180, fixedsize=true, width=0.5, height=0.5, pos="6.5,3.0!", label=""]
|
||||
"Preamp B C" [shape=triangle, orientation=-20, fixedsize=true, width=0.5, height=0.5, pos="5.8,3.2!", label=""]
|
||||
"ROADM B" -> "Booster B C"
|
||||
"Preamp B C" -> "ROADM B"
|
||||
|
||||
"Inline A C 1" [shape=triangle, orientation=-166, fixedsize=true, width=0.5, pos="2.4,2.2!", label=" \N", color=red, fontcolor=red]
|
||||
"Inline A C 2" [shape=triangle, orientation=-166, fixedsize=true, width=0.5, pos="2.6,1.2!", label=" \N", color=red, fontcolor=red]
|
||||
"Inline A C 3" [shape=triangle, orientation=-166, fixedsize=true, width=0.5, pos="2.8,0.2!", label=" \N", color=red, fontcolor=red]
|
||||
"Inline A C n" [shape=triangle, orientation=-166, fixedsize=true, width=0.5, pos="3.0,-1.1!", label=" \N", color=red, fontcolor=red]
|
||||
|
||||
"Booster A C" -> "Inline A C 1"
|
||||
"Inline A C 1" -> "Inline A C 2"
|
||||
"Inline A C 2" -> "Inline A C 3"
|
||||
"Inline A C 3" -> "Inline A C n" [style=dotted]
|
||||
"Inline A C n" -> "Preamp C A"
|
||||
"Booster A B" -> "Preamp B A" [style=dotted]
|
||||
"Booster C A" -> "Preamp A C" [style=dotted]
|
||||
"Booster C B" -> "Preamp B C" [style=dotted]
|
||||
"Booster B C" -> "Preamp C B" [style=dotted]
|
||||
"Booster B A" -> "Preamp A B" [style=dotted]
|
||||
}
|
||||
|
||||
In such networks, GNPy's autodesign features becomes very useful.
|
||||
It is possible to connect ROADMs via "tentative links" which will be replaced by a sequence of actual fibers and specific amplifiers.
|
||||
In other cases where the location of amplifier huts is already known, but the specific EDFA models have not yet been decided, one can put in amplifier placeholders and let GNPy assign the best amplifier.
|
||||
|
||||
.. _concepts-equipment:
|
||||
|
||||
The Equipment Library
|
||||
---------------------
|
||||
|
||||
In order to produce an accurate simulation, GNPy needs to know the physical properties of each entity which affects the optical signal.
|
||||
Entries in the equipment library correspond to actual real-world, tangible entities.
|
||||
Unlike a typical :abbr:`NMS (Network Management System)`, GNPy considers not just the active :abbr:`NEs (Network Elements)` such as amplifiers and :abbr:`ROADMs (Reconfigurable Optical Add/Drop Multiplexers)`, but also the passive ones, such as the optical fiber.
|
||||
|
||||
As the signal propagates through the network, the largest source of optical impairments is the noise introduced from amplifiers.
|
||||
An accurate description of the :abbr:`EDFA (Erbium-Doped Fiber Amplifier)` and especially its noise characteristics is required.
|
||||
GNPy describes this property in terms of the **Noise Figure (NF)** of an amplifier model as a function of its operating point.
|
||||
|
||||
The amplifiers compensate power losses induced on the signal in the optical fiber.
|
||||
The linear losses, however, are just one phenomenon of a multitude of effects that affect the signals in a long fiber run.
|
||||
While a more detailed description is available :ref:`in the literature<physical-model>`, for the purpose of the equipment library, the description of the *optical fiber* comprises its **linear attenutation coefficient**, a set of parameters for the **Raman effect**, optical **dispersion**, etc.
|
||||
|
||||
Signals are introduced into the network via *transponders*.
|
||||
The set of parameters that are required describe the physical properties of each supported *mode* of the transponder, including its **symbol rate**, spectral **width**, etc.
|
||||
|
||||
In the junctions of the network, *ROADMs* are used for spectrum routing.
|
||||
GNPy currently does not take into consideration the spectrum filtering penalties of the :abbr:`WSSes (Wavelength Selective Switches)`, but the equipment library nonetheless contains a list of required parameters, such as the attenuation options, so that the network can be properly simulated.
|
||||
|
||||
.. _concepts-nf-model:
|
||||
|
||||
Amplifier Noise Figure Models
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
One of the key parameters of an amplifier is the method to use for computing the Noise Figure (NF).
|
||||
GNPy supports several different noise models with varying level of accuracy.
|
||||
When in doubt, contact your vendor's technical support and ask them to :ref:`contribute their equipment descriptions<extending-edfa>` to GNPy.
|
||||
|
||||
The most accurate noise models describe the resulting NF of an EDFA as a third-degree polynomial.
|
||||
GNPy understands polynomials as a NF-yielding function of the :ref:`gain difference from the optimal gain<ext-nf-model-polynomial-NF>`, or as a function of the input power resulting in an incremental OSNR as used in :ref:`OpenROADM inline amplifiers<ext-nf-model-polynomial-OSNR-OpenROADM>` and :ref:`OpenROADM booster/preamps in the ROADMs<ext-nf-model-noise-mask-OpenROADM>`.
|
||||
For scenarios where the vendor has not yet contributed an accurate EDFA NF description to GNPy, it is possible to approximate the characteristics via an operator-focused, min-max NF model.
|
||||
|
||||
.. _nf-model-min-max-NF:
|
||||
|
||||
Min-max NF
|
||||
**********
|
||||
|
||||
This is an operator-focused model where performance is defined by the *minimal* and *maximal NF*.
|
||||
These are especially suited to model a dual-coil EDFA with a VOA in between.
|
||||
In these amplifiers, the minimal NF is achieved when the EDFA operates at its maximal (and usually optimal, in terms of flatness) gain.
|
||||
The worst (maximal) NF applies when the EDFA operates at its minimal gain.
|
||||
|
||||
This model is suitable for use when the vendor has not provided a more accurate performance description of the EDFA.
|
||||
|
||||
Raman Approximation
|
||||
*******************
|
||||
|
||||
While GNPy is fully Raman-aware, under certain scenarios it is useful to be able to run a simulation without an accurate Raman description.
|
||||
For these purposes the :ref:`polynomial NF<ext-nf-model-polynomial-NF>` model with :math:`\text{a} = \text{b} = \text{c} = 0`, and :math:`\text{d} = NF` can be used.
|
||||
|
||||
.. _concepts-simulation:
|
||||
|
||||
Simulation
|
||||
----------
|
||||
|
||||
When the network model has been instantiated and the physical properties and operational settings of the actual physical devices are known, GNPy can start simulating how the signal propagate through the optical fiber.
|
||||
|
||||
This set of input parameters include options such as the *spectrum allocation*, i.e., the number of channels and their spacing.
|
||||
Various strategies for network optimization can be provided as well.
|
||||
52
docs/conf.py
52
docs/conf.py
@@ -31,8 +31,17 @@ sys.path.insert(0, os.path.abspath('../'))
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = ['sphinx.ext.autodoc',
|
||||
'sphinx.ext.mathjax',
|
||||
'sphinx.ext.githubpages','sphinxcontrib.bibtex']
|
||||
'sphinx.ext.mathjax',
|
||||
'sphinx.ext.githubpages',
|
||||
'sphinxcontrib.bibtex',
|
||||
'sphinx.ext.graphviz',
|
||||
'myst_parser',
|
||||
]
|
||||
|
||||
myst_enable_extensions = [
|
||||
"deflist",
|
||||
"dollarmath",
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
@@ -48,24 +57,15 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = 'gnpy'
|
||||
copyright = '2018, Telecom InfraProject - OOPT PSE Group'
|
||||
author = 'Telecom InfraProject - OOPT PSE Group'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '0.1'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.1'
|
||||
copyright = '2018 - 2021, Telecom Infra Project - OOPT PSE Group'
|
||||
author = 'Telecom Infra Project - OOPT PSE Group'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
language = 'en'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
@@ -84,11 +84,13 @@ todo_include_todos = False
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
on_rtd = os.environ.get('READTHEDOCS') == 'True'
|
||||
if on_rtd:
|
||||
html_theme = 'default'
|
||||
else:
|
||||
html_theme = 'alabaster'
|
||||
html_theme = 'alabaster'
|
||||
html_theme_options = {
|
||||
'logo': 'images/GNPy-logo.png',
|
||||
'logo_name': False,
|
||||
}
|
||||
|
||||
html_logo = 'images/GNPy-logo.png'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
@@ -99,7 +101,7 @@ else:
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
html_static_path = []
|
||||
|
||||
# Custom sidebar templates, must be a dictionary that maps document names
|
||||
# to template names.
|
||||
@@ -148,7 +150,7 @@ latex_elements = {
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, 'gnpy.tex', 'gnpy Documentation',
|
||||
'Telecom InfraProject - OOPT PSE Group', 'manual'),
|
||||
'Telecom Infra Project - OOPT PSE Group', 'manual'),
|
||||
]
|
||||
|
||||
|
||||
@@ -173,5 +175,13 @@ texinfo_documents = [
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
autodoc_default_options = {
|
||||
'members': True,
|
||||
'undoc-members': True,
|
||||
'private-members': True,
|
||||
'show-inheritance': True,
|
||||
}
|
||||
|
||||
graphviz_output_format = 'svg'
|
||||
|
||||
bibtex_bibfiles = ['biblio.bib']
|
||||
|
||||
233
docs/excel.rst
Normal file
233
docs/excel.rst
Normal file
@@ -0,0 +1,233 @@
|
||||
.. _excel:
|
||||
|
||||
Excel (XLS, XLSX) input files
|
||||
=============================
|
||||
|
||||
``gnpy-transmission-example`` gives the possibility to use an excel input file instead of a json file. The program then will generate the corresponding json file for you.
|
||||
|
||||
The file named 'meshTopologyExampleV2.xls' is an example.
|
||||
|
||||
In order to work the excel file MUST contain at least 2 sheets:
|
||||
|
||||
- Nodes
|
||||
- Links
|
||||
|
||||
(In progress) The File MAY contain an additional sheet:
|
||||
|
||||
- Eqt
|
||||
- Service
|
||||
|
||||
.. _excel-nodes-sheet:
|
||||
|
||||
Nodes sheet
|
||||
-----------
|
||||
|
||||
Nodes sheet contains nine columns.
|
||||
Each line represents a 'node' (ROADM site or an in line amplifier site ILA or a Fused)::
|
||||
|
||||
City (Mandatory) ; State ; Country ; Region ; Latitude ; Longitude ; Type
|
||||
|
||||
- **City** is used for the name of a node of the graph. It accepts letters, numbers,underscore,dash, blank... (not exhaustive). The user may want to avoid commas for future CSV exports.
|
||||
|
||||
**City name MUST be unique**
|
||||
|
||||
- **Type** is not mandatory.
|
||||
|
||||
- If not filled, it will be interpreted as an 'ILA' site if node degree is 2 and as a ROADM otherwise.
|
||||
- If filled, it can take "ROADM", "FUSED" or "ILA" values. If another string is used, it will be considered as not filled. FUSED means that ingress and egress spans will be fused together.
|
||||
|
||||
- *State*, *Country*, *Region* are not mandatory.
|
||||
"Region" is a holdover from the CORONET topology reference file `CORONET_Global_Topology.xlsx <gnpy/example-data/CORONET_Global_Topology.xlsx>`_. CORONET separates its network into geographical regions (Europe, Asia, Continental US.) This information is not used by gnpy.
|
||||
|
||||
- *Longitude*, *Latitude* are not mandatory. If filled they should contain numbers.
|
||||
|
||||
- **Booster_restriction** and **Preamp_restriction** are not mandatory.
|
||||
If used, they must contain one or several amplifier type_variety names separated by ' | '. This information is used to restrict types of amplifiers used in a ROADM node during autodesign. If a ROADM booster or preamp is already specified in the Eqpt sheet , the field is ignored. The field is also ignored if the node is not a ROADM node.
|
||||
|
||||
**There MUST NOT be empty line(s) between two nodes lines**
|
||||
|
||||
|
||||
.. _excel-links-sheet:
|
||||
|
||||
Links sheet
|
||||
-----------
|
||||
|
||||
Links sheet must contain sixteen columns::
|
||||
|
||||
<-- east cable from a to z --> <-- west from z to -->
|
||||
NodeA ; NodeZ ; Distance km ; Fiber type ; Lineic att ; Con_in ; Con_out ; PMD ; Cable Id ; Distance km ; Fiber type ; Lineic att ; Con_in ; Con_out ; PMD ; Cable Id
|
||||
|
||||
|
||||
Links sheets MUST contain all links between nodes defined in Nodes sheet.
|
||||
Each line represents a 'bidir link' between two nodes. The two directions are represented on a single line with "east cable from a to z" fields and "west from z to a" fields. Values for 'a to z' may be different from values from 'z to a'.
|
||||
Since both direction of a bidir 'a-z' link are described on the same line (east and west), 'z to a' direction MUST NOT be repeated in a different line. If repeated, it will generate another parrallel bidir link between the same end nodes.
|
||||
|
||||
|
||||
Parameters for "east cable from a to z" and "west from z to a" are detailed in 2x7 columns. If not filled, "west from z to a" is copied from "east cable from a to z".
|
||||
|
||||
For example, a line filled with::
|
||||
|
||||
node6 ; node3 ; 80 ; SSMF ; 0.2 ; 0.5 ; 0.5 ; 0.1 ; cableB ; ; ; 0.21 ; 0.2 ; ; ;
|
||||
|
||||
will generate a unidir fiber span from node6 to node3 with::
|
||||
|
||||
[node6 node3 80 SSMF 0.2 0.5 0.5 0.1 cableB]
|
||||
|
||||
and a fiber span from node3 to node6::
|
||||
|
||||
[node6 node3 80 SSMF 0.21 0.2 0.5 0.1 cableB] attributes.
|
||||
|
||||
- **NodeA** and **NodeZ** are Mandatory.
|
||||
They are the two endpoints of the link. They MUST contain a node name from the **City** names listed in Nodes sheet.
|
||||
|
||||
- **Distance km** is not mandatory.
|
||||
It is the link length.
|
||||
|
||||
- If filled it MUST contain numbers. If empty it is replaced by a default "80" km value.
|
||||
- If value is below 150 km, it is considered as a single (bidirectional) fiber span.
|
||||
- If value is over 150 km the `gnpy-transmission-example`` program will automatically suppose that intermediate span description are required and will generate fiber spans elements with "_1","_2", ... trailing strings which are not visible in the json output. The reason for the splitting is that current edfa usually do not support large span loss. The current assumption is that links larger than 150km will require intermediate amplification. This value will be revisited when Raman amplification is added”
|
||||
|
||||
- **Fiber type** is not mandatory.
|
||||
|
||||
If filled it must contain types listed in `eqpt_config.json <gnpy/example-data/eqpt_config.json>`_ in "Fiber" list "type_variety".
|
||||
If not filled it takes "SSMF" as default value.
|
||||
|
||||
- **Lineic att** is not mandatory.
|
||||
|
||||
It is the lineic attenuation expressed in dB/km.
|
||||
If filled it must contain positive numbers.
|
||||
If not filled it takes "0.2" dB/km value
|
||||
|
||||
- *Con_in*, *Con_out* are not mandatory.
|
||||
|
||||
They are the connector loss in dB at ingress and egress of the fiber spans.
|
||||
If filled they must contain positive numbers.
|
||||
If not filled they take "0.5" dB default value.
|
||||
|
||||
- *PMD* is not mandatory and and is not used yet.
|
||||
|
||||
It is the PMD value of the link in ps.
|
||||
If filled they must contain positive numbers.
|
||||
If not filled, it takes "0.1" ps value.
|
||||
|
||||
- *Cable Id* is not mandatory.
|
||||
If filled they must contain strings with the same constraint as "City" names. Its value is used to differenate links having the same end points. In this case different Id should be used. Cable Ids are not meant to be unique in general.
|
||||
|
||||
|
||||
|
||||
|
||||
(in progress)
|
||||
|
||||
.. _excel-equipment-sheet:
|
||||
|
||||
Eqpt sheet
|
||||
----------
|
||||
|
||||
The equipment sheet (named "Eqpt") is optional.
|
||||
If provided, it specifies types of boosters and preamplifiers for all ROADM degrees of all ROADM nodes, and for all ILA nodes.
|
||||
|
||||
This sheet contains twelve columns::
|
||||
|
||||
<-- east cable from a to z --> <-- west from z to a -->
|
||||
Node A ; Node Z ; amp type ; att_in ; amp gain ; tilt ; att_out ; delta_p ; amp type ; att_in ; amp gain ; tilt ; att_out ; delta_p
|
||||
|
||||
If the sheet is present, it MUST have as many lines as there are egress directions of ROADMs defined in Links Sheet, and all ILAs.
|
||||
|
||||
For example, consider the following list of links (A, B and C being a ROADM and amp# ILAs):
|
||||
|
||||
::
|
||||
|
||||
A - amp1
|
||||
amp1 - amp2
|
||||
Amp2 - B
|
||||
A - amp3
|
||||
amp3 - C
|
||||
|
||||
then Eqpt sheet should contain:
|
||||
- one line for each ILAs: amp1, amp2, amp3
|
||||
- one line for each one-degree ROADM (B and C in this example)
|
||||
- two lines for each two-degree ROADM (just the ROADM A)
|
||||
|
||||
::
|
||||
|
||||
A - amp1
|
||||
amp1 - amp2
|
||||
Amp2 - B
|
||||
A - amp3
|
||||
amp3 - C
|
||||
B - amp2
|
||||
C - amp3
|
||||
|
||||
|
||||
In case you already have filled Nodes and Links sheets `create_eqpt_sheet.py <gnpy/example-data/create_eqpt_sheet.py>`_ can be used to automatically create a template for the mandatory entries of the list.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ cd $(gnpy-example-data)
|
||||
$ python create_eqpt_sheet.py meshTopologyExampleV2.xls
|
||||
|
||||
This generates a text file meshTopologyExampleV2_eqt_sheet.txt whose content can be directly copied into the Eqt sheet of the excel file. The user then can fill the values in the rest of the columns.
|
||||
|
||||
|
||||
- **Node A** is mandatory. It is the name of the node (as listed in Nodes sheet).
|
||||
If Node A is a 'ROADM' (Type attribute in sheet Node), its number of occurence must be equal to its degree.
|
||||
If Node A is an 'ILA' it should appear only once.
|
||||
|
||||
- **Node Z** is mandatory. It is the egress direction from the *Node A* site. Multiple Links between the same Node A and NodeZ is not supported.
|
||||
|
||||
- **amp type** is not mandatory.
|
||||
If filled it must contain types listed in `eqpt_config.json <gnpy/example-data/eqpt_config.json>`_ in "Edfa" list "type_variety".
|
||||
If not filled it takes "std_medium_gain" as default value.
|
||||
If filled with fused, a fused element with 0.0 dB loss will be placed instead of an amplifier. This might be used to avoid booster amplifier on a ROADM direction.
|
||||
|
||||
- **amp_gain** is not mandatory. It is the value to be set on the amplifier (in dB).
|
||||
If not filled, it will be determined with design rules in the convert.py file.
|
||||
If filled, it must contain positive numbers.
|
||||
|
||||
- *att_in* and *att_out* are not mandatory and are not used yet. They are the value of the attenuator at input and output of amplifier (in dB).
|
||||
If filled they must contain positive numbers.
|
||||
|
||||
- **tilt**, in dB, is not mandatory. It is the target gain tilt over the full amplfifier bandwidth and is defined with regard to wavelength, i.e. negative tilt means lower gain
|
||||
for higher wavelengths (lower frequencies). If not filled, the default value is 0.
|
||||
|
||||
- **delta_p**, in dBm, is not mandatory. If filled it is used to set the output target power per channel at the output of the amplifier, if power_mode is True. The output power is then set to power_dbm + delta_power.
|
||||
|
||||
# to be completed #
|
||||
|
||||
(in progress)
|
||||
|
||||
.. _excel-service-sheet:
|
||||
|
||||
Service sheet
|
||||
-------------
|
||||
|
||||
Service sheet is optional. It lists the services for which path and feasibility must be computed with ``gnpy-path-request``.
|
||||
|
||||
Service sheet must contain 11 columns::
|
||||
|
||||
route id ; Source ; Destination ; TRX type ; Mode ; System: spacing ; System: input power (dBm) ; System: nb of channels ; routing: disjoint from ; routing: path ; routing: is loose?
|
||||
|
||||
- **route id** is mandatory. It must be unique. It is the identifier of the request. It can be an integer or a string (do not use blank or dash or coma)
|
||||
|
||||
- **Source** is mandatory. It is the name of the source node (as listed in Nodes sheet). Source MUST be a ROADM node. (TODO: relax this and accept trx entries)
|
||||
|
||||
- **Destination** is mandatory. It is the name of the destination node (as listed in Nodes sheet). Source MUST be a ROADM node. (TODO: relax this and accept trx entries)
|
||||
|
||||
- **TRX type** is mandatory. They are the variety type and selected mode of the transceiver to be used for the propagation simulation. These modes MUST be defined in the equipment library. The format of the mode is used as the name of the mode. (TODO: maybe add another mode id on Transceiver library ?). In particular the mode selection defines the channel baudrate to be used for the propagation simulation.
|
||||
|
||||
- **mode** is optional. If not specified, the program will search for the mode of the defined transponder with the highest baudrate fitting within the spacing value.
|
||||
|
||||
- **System: spacing** is mandatory. Spacing is the channel spacing defined in GHz difined for the feasibility propagation simulation, assuming system full load.
|
||||
|
||||
- **System: input power (dBm) ; System: nb of channels** are optional input defining the system parameters for the propagation simulation.
|
||||
|
||||
- input power is the channel optical input power in dBm
|
||||
- nb of channels is the number of channels to be used for the simulation.
|
||||
|
||||
- **routing: disjoint from ; routing: path ; routing: is loose?** are optional.
|
||||
|
||||
- disjoint from: identifies the requests from which this request must be disjoint. If filled it must contain request ids separated by ' | '
|
||||
- path: is the set of ROADM nodes that must be used by the path. It must contain the list of ROADM names that the path must cross. TODO : only ROADM nodes are accepted in this release. Relax this with any type of nodes. If filled it must contain ROADM ids separated by ' | '. Exact names are required.
|
||||
- is loose? 'no' value means that the list of nodes should be strictly followed, while any other value means that the constraint may be relaxed if the node is not reachable.
|
||||
|
||||
- **path bandwidth** is mandatory. It is the amount of capacity required between source and destination in Gbit/s. Value should be positive (non zero). It is used to compute the amount of required spectrum for the service.
|
||||
172
docs/extending.rst
Normal file
172
docs/extending.rst
Normal file
@@ -0,0 +1,172 @@
|
||||
.. _extending:
|
||||
|
||||
Extending GNPy with vendor-specific data
|
||||
========================================
|
||||
|
||||
GNPy ships with an :ref:`equipment library<concepts-equipment>` containing machine-readable datasheets of networking equipment.
|
||||
Vendors who are willing to contribute descriptions of their supported products are encouraged to `submit a patch <https://review.gerrithub.io/Documentation/intro-gerrit-walkthrough-github.html>`__ -- or just :ref:`get in touch with us directly<contributing>`.
|
||||
|
||||
This chapter discusses option for modeling performance of :ref:`EDFA amplifiers<extending-edfa>`, :ref:`Raman amplifiers<extending-raman>`, :ref:`transponders<extending-transponder>` and :ref:`ROADMs<extending-roadm>`.
|
||||
|
||||
.. _extending-edfa:
|
||||
|
||||
EDFAs
|
||||
-----
|
||||
|
||||
An accurate description of the :abbr:`EDFA (Erbium-Doped Fiber Amplifier)` and especially its noise characteristics is required.
|
||||
GNPy describes this property in terms of the **Noise Figure (NF)** of an amplifier model as a function of its operating point.
|
||||
GNPy supports several different :ref:`noise models<concepts-nf-model>`, and vendors are encouraged to pick one which describes performance of their equipment most accurately.
|
||||
|
||||
.. _ext-nf-model-polynomial-NF:
|
||||
|
||||
Polynomial NF
|
||||
*************
|
||||
|
||||
This model computes the NF as a function of the difference between the optimal gain and the current gain.
|
||||
The NF is expressed as a third-degree polynomial:
|
||||
|
||||
.. math::
|
||||
|
||||
f(x) &= \text{a}x^3 + \text{b}x^2 + \text{c}x + \text{d}
|
||||
|
||||
\text{NF} &= f(G - G_\text{max})
|
||||
|
||||
This model can be also used for fixed-gain fixed-NF amplifiers.
|
||||
In that case, use:
|
||||
|
||||
.. math::
|
||||
|
||||
a = b = c &= 0
|
||||
|
||||
d &= \text{NF}
|
||||
|
||||
.. _ext-nf-model-polynomial-OSNR-OpenROADM:
|
||||
|
||||
Polynomial OSNR (OpenROADM-style for inline amplifier)
|
||||
******************************************************
|
||||
|
||||
This model is useful for amplifiers compliant to the OpenROADM specification for ILA (an in-line amplifier).
|
||||
The amplifier performance is evaluated via its incremental OSNR, which is a function of the input power.
|
||||
|
||||
.. math::
|
||||
|
||||
\text{OSNR}_\text{inc}(P_\text{in}) = \text{a}P_\text{in}^3 + \text{b}P_\text{in}^2 + \text{c}P_\text{in} + \text{d}
|
||||
|
||||
.. _ext-nf-model-noise-mask-OpenROADM:
|
||||
|
||||
Noise mask (OpenROADM-style for combined preamp and booster)
|
||||
************************************************************
|
||||
|
||||
Unlike GNPy which simluates the preamplifier and the booster separately as two amplifiers for best accuracy, the OpenROADM specification mandates a certain performance level for a combination of these two amplifiers.
|
||||
For the express path, the effective noise mask comprises the preamplifier and the booster.
|
||||
When terminating a channel, the same effective noise mask is mandated for a combination of the preamplifier and the drop stage.
|
||||
|
||||
GNPy emulates this specification via two special NF models:
|
||||
|
||||
- The ``openroadm_preamp`` NF model for preamplifiers.
|
||||
This NF model provides all of the linear impairments to the signal, including those which are incured by the booster in a real network.
|
||||
- The ``openroadm_booster`` NF model is a special "zero noise" faux amplifier in place of the booster.
|
||||
|
||||
.. _ext-nf-model-min-max-NF:
|
||||
|
||||
Min-max NF
|
||||
**********
|
||||
|
||||
When the vendor prefers not to share the amplifier description in full detail, GNPy also supports describing the NF characteristics via the *minimal* and *maximal NF*.
|
||||
This approximates a more accurate polynomial description reasonably well for some models of a dual-coil EDFA with a VOA in between.
|
||||
In these amplifiers, the minimal NF is achieved when the EDFA operates at its maximal (and usually optimal, in terms of flatness) gain.
|
||||
The worst (maximal) NF applies when the EDFA operates at the minimal gain.
|
||||
|
||||
.. _ext-nf-model-dual-stage-amplifier:
|
||||
|
||||
Dual-stage
|
||||
**********
|
||||
|
||||
Dual-stage amplifier combines two distinct amplifiers.
|
||||
Vendors which provide an accurate description of their preamp and booster stages separately can use the dual-stage model for an aggregate description of the whole amplifier.
|
||||
|
||||
.. _ext-nf-model-advanced:
|
||||
|
||||
Advanced Specification
|
||||
**********************
|
||||
|
||||
The amplifier performance can be further described in terms of gain ripple, NF ripple, and the dynamic gain tilt.
|
||||
When provided, the amplifier characteristic is fine-tuned as a function of carrier frequency. Note that in this advanced
|
||||
specification tilt is defined vs frequency while tilt_target specified in EDFA instances is defined vs wavelength.
|
||||
|
||||
.. _extending-raman:
|
||||
|
||||
Raman Amplifiers
|
||||
----------------
|
||||
|
||||
An accurate simulation of Raman amplification requires knowledge of:
|
||||
|
||||
* the *power* and *wavelength* of all Raman pumping lasers,
|
||||
* the *direction*, whether it is co-propagating or counter-propagating,
|
||||
* the Raman efficiency of the fiber,
|
||||
* the fiber temperature.
|
||||
|
||||
Under certain scenarios it is useful to be able to run a simulation without an accurate Raman description.
|
||||
For these purposes, it is possible to approximate a Raman amplifier via a fixed-gain EDFA with the :ref:`polynomial NF<ext-nf-model-polynomial-NF>` model using :math:`\text{a} = \text{b} = \text{c} = 0`, and a desired effective :math:`\text{d} = NF`.
|
||||
This is also useful to quickly approximate a hybrid EDFA+Raman amplifier.
|
||||
|
||||
.. _extending-transponder:
|
||||
|
||||
Transponders
|
||||
------------
|
||||
|
||||
Since transponders are usually capable of operating in a variety of modes, these are described separately.
|
||||
A *mode* usually refers to a particular performance point that is defined by a combination of the symbol rate, modulation format, and :abbr:`FEC (Forward Error Correction)`.
|
||||
|
||||
The following data are required for each mode:
|
||||
|
||||
``bit_rate``
|
||||
Data bit rate, in :math:`\text{bits}\times s^{-1}`.
|
||||
``baud_rate``
|
||||
Symbol modulation rate, in :math:`\text{baud}`.
|
||||
``OSNR``
|
||||
Minimal required OSNR for the receiver. In :math:`\text{dB}`
|
||||
``tx-osnr``
|
||||
Initial OSNR at the transmitter's output. In :math:`\text{dB}`
|
||||
``min-spacing``
|
||||
Minimal grid spacing, i.e., an effective channel spectral bandwidth.
|
||||
In :math:`\text{Hz}`.
|
||||
``roll-off``
|
||||
Roll-off parameter (:math:`\beta`) of the TX pulse shaping filter.
|
||||
This assumes a raised-cosine filter.
|
||||
``rx-power-min`` and ``rx-power-max``
|
||||
(work in progress) The allowed range of power at the receiver.
|
||||
In :math:`\text{dBm}`.
|
||||
``penalties``
|
||||
Impairments such as Chromatic Dispersion (CD), Polarization Mode Dispersion (PMD), and Polarization Dispersion Loss (PDL)
|
||||
result in penalties at the receiver. The receiver's ability to handle these impairments can be defined for each mode as
|
||||
a list of {impairment: in defined units, 'penalty_value' in dB} (see `transceiver section here <json.rst#_transceiver>`).
|
||||
Maximum allowed CD, maximum allowed PMD, and maximum allowed PDL should be listed there with corresponding penalties.
|
||||
Impairments experienced during propagation are linearly interpolated between given points to obtain the corresponding penalty.
|
||||
The accumulated penalties are subtracted from the path GSNR before comparing with the minimum required OSNR.
|
||||
Impairments: PMD in :math:`\text{ps}`, CD in :math:`\text{ps/nm}`, PDL in :math:`\text{dB}`, penalty_value in :math:`\text{dB}`
|
||||
|
||||
|
||||
GNPy does not directly track the FEC performance, so the type of chosen FEC is likely indicated in the *name* of the selected transponder mode alone.
|
||||
|
||||
.. _extending-roadm:
|
||||
|
||||
ROADMs
|
||||
------
|
||||
|
||||
In a :abbr:`ROADM (Reconfigurable Add/Drop Multiplexer)`, GNPy simulates the impairments of the preamplifiers and boosters of line degrees :ref:`separately<topo-roadm-preamp-booster>`.
|
||||
The set of parameters for each ROADM model therefore includes:
|
||||
|
||||
``add-drop-osnr``
|
||||
OSNR penalty introduced by the Add and Drop stages of this ROADM type.
|
||||
``target-channel-out-power``
|
||||
Per-channel target TX power towards the egress amplifier.
|
||||
Within GNPy, a ROADM is expected to attenuate any signal that enters the ROADM node to this level.
|
||||
This can be overridden on a per-link in the network topology.
|
||||
Targets can be set using power or power spectral density (see `roadm section here <json.rst#__roadm>`)
|
||||
``pmd``
|
||||
Polarization mode dispersion (PMD) penalty of the express path.
|
||||
In :math:`\text{ps}`.
|
||||
|
||||
Provisions are in place to define the list of all allowed booster and preamplifier types.
|
||||
This is useful for specifying constraints on what amplifier modules fit into ROADM chassis, and when using fully disaggregated ROADM topologies as well.
|
||||
13
docs/gnpy-api-core.rst
Normal file
13
docs/gnpy-api-core.rst
Normal file
@@ -0,0 +1,13 @@
|
||||
``gnpy.core``
|
||||
-------------
|
||||
|
||||
.. automodule:: gnpy.core
|
||||
.. automodule:: gnpy.core.ansi_escapes
|
||||
.. automodule:: gnpy.core.elements
|
||||
.. automodule:: gnpy.core.equipment
|
||||
.. automodule:: gnpy.core.exceptions
|
||||
.. automodule:: gnpy.core.info
|
||||
.. automodule:: gnpy.core.network
|
||||
.. automodule:: gnpy.core.parameters
|
||||
.. automodule:: gnpy.core.science_utils
|
||||
.. automodule:: gnpy.core.utils
|
||||
9
docs/gnpy-api-tools.rst
Normal file
9
docs/gnpy-api-tools.rst
Normal file
@@ -0,0 +1,9 @@
|
||||
``gnpy.tools``
|
||||
--------------
|
||||
|
||||
.. automodule:: gnpy.tools
|
||||
.. automodule:: gnpy.tools.cli_examples
|
||||
.. automodule:: gnpy.tools.convert
|
||||
.. automodule:: gnpy.tools.json_io
|
||||
.. automodule:: gnpy.tools.plots
|
||||
.. automodule:: gnpy.tools.service_sheet
|
||||
6
docs/gnpy-api-topology.rst
Normal file
6
docs/gnpy-api-topology.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
``gnpy.topology``
|
||||
-----------------
|
||||
|
||||
.. automodule:: gnpy.topology
|
||||
.. automodule:: gnpy.topology.request
|
||||
.. automodule:: gnpy.topology.spectrum_assignment
|
||||
14
docs/gnpy-api.rst
Normal file
14
docs/gnpy-api.rst
Normal file
@@ -0,0 +1,14 @@
|
||||
***************************
|
||||
API Reference Documentation
|
||||
***************************
|
||||
|
||||
``gnpy`` package
|
||||
================
|
||||
|
||||
.. automodule:: gnpy
|
||||
|
||||
.. toctree::
|
||||
|
||||
gnpy-api-core
|
||||
gnpy-api-topology
|
||||
gnpy-api-tools
|
||||
BIN
docs/images/2022-04-12-gnpy-app.png
Normal file
BIN
docs/images/2022-04-12-gnpy-app.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 288 KiB |
BIN
docs/images/GNPy-banner.png
Normal file
BIN
docs/images/GNPy-banner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 518 KiB |
BIN
docs/images/GNPy-logo.png
Normal file
BIN
docs/images/GNPy-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
1
docs/images/gnpy-transmission-example.svg
Normal file
1
docs/images/gnpy-transmission-example.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 478 KiB |
@@ -1,33 +1,23 @@
|
||||
.. gnpy documentation master file, created by
|
||||
sphinx-quickstart on Mon Dec 18 14:41:01 2017.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
GNPy: Optical Route Planning Library
|
||||
=====================================================================
|
||||
|
||||
Welcome to gnpy's documentation!
|
||||
================================
|
||||
|
||||
**gnpy is an open-source, community-developed library for building route planning
|
||||
and optimization tools in real-world mesh optical networks.**
|
||||
|
||||
`gnpy <http://github.com/telecominfraproject/gnpy>`_ is:
|
||||
|
||||
- a sponsored project of the `OOPT/PSE <http://telecominfraproject.com/project-groups-2/backhaul-projects/open-optical-packet-transport/>`_ working group of the `Telecom Infra Project <http://telecominfraproject.com>`_.
|
||||
- fully community-driven, fully open source library
|
||||
- driven by a consortium of operators, vendors, and academic researchers
|
||||
- intended for rapid development of production-grade route planning tools
|
||||
- easily extensible to include custom network elements
|
||||
- performant to the scale of real-world mesh optical networks
|
||||
|
||||
Documentation
|
||||
=============
|
||||
|
||||
The following pages are meant to describe specific implementation details and
|
||||
modeling assumptions behind gnpy.
|
||||
`GNPy <http://github.com/telecominfraproject/gnpy>`_ is an open-source,
|
||||
community-developed library for building route planning and optimization tools
|
||||
in real-world mesh optical networks. It is based on the Gaussian Noise Model.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:maxdepth: 4
|
||||
|
||||
intro
|
||||
concepts
|
||||
install
|
||||
json
|
||||
excel
|
||||
extending
|
||||
about-project
|
||||
model
|
||||
gnpy-api
|
||||
release-notes
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
@@ -36,46 +26,3 @@ Indices and tables
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
Contributors in alphabetical order
|
||||
==================================
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| Name | Surname | Affiliation | Contact |
|
||||
+==========+============+=======================+======================================+
|
||||
| Alessio | Ferrari | Politecnico di Torino | alessio.ferrari@polito.it |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| Brian | Taylor | Facebook | briantaylor@fb.com |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| David | Boertjes | Ciena | dboertje@ciena.com |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| Esther | Le Rouzic | Orange | esther.lerouzic@orange.com |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| Gabriele | Galimberti | Cisco | ggalimbe@cisco.com |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| Gert | Grammel | Juniper Networks | ggrammel@juniper.net |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| Gilad | Goldfarb | Facebook | giladg@fb.com |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| James | Powell | Telecom Infra Project | james.powell@telecominfraproject.com |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| Jeanluc | Auge | Orange | jeanluc.auge@orange.com |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| Mattia | Cantono | Politecnico di Torino | mattia.cantono@polito.it |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
| Vittorio | Curri | Politecnico di Torino | vittorio.curri@polito.it |
|
||||
+----------+------------+-----------------------+--------------------------------------+
|
||||
|
||||
PSE WG Charter
|
||||
--------------
|
||||
|
||||
- Goal is to build an end-to-end simulation environment which defines the
|
||||
network models of the optical device transfer functions and their parameters.
|
||||
This environment will provide validation of the optical performance
|
||||
requirements for the TIP OLS building blocks.
|
||||
- The model may be approximate or complete depending on the network complexity.
|
||||
Each model shall be validated against the proposed network scenario.
|
||||
- The environment must be able to process network models from multiple vendors,
|
||||
and also allow users to pick any implementation in an open source framework.
|
||||
- The PSE will influence and benefit from the innovation of the DTC, API, and
|
||||
OLS working groups.
|
||||
- The PSE represents a step along the journey towards multi-layer optimization.
|
||||
|
||||
|
||||
111
docs/install.rst
Normal file
111
docs/install.rst
Normal file
@@ -0,0 +1,111 @@
|
||||
Installing GNPy
|
||||
---------------
|
||||
|
||||
There are several methods on how to obtain GNPy.
|
||||
The easiest option for a non-developer is probably going via our :ref:`Docker images<install-docker>`.
|
||||
Developers are encouraged to install the :ref:`Python package in the same way as any other Python package<install-pip>`.
|
||||
Note that this needs a :ref:`working installation of Python<install-python>`, for example :ref:`via Anaconda<install-anaconda>`.
|
||||
|
||||
.. _install-docker:
|
||||
|
||||
Using prebuilt Docker images
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Our `Docker images <https://hub.docker.com/r/telecominfraproject/oopt-gnpy>`_ contain everything needed to run all examples from this guide.
|
||||
Docker transparently fetches the image over the network upon first use.
|
||||
On Linux and Mac, run:
|
||||
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ docker run -it --rm --volume $(pwd):/shared telecominfraproject/oopt-gnpy
|
||||
root@bea050f186f7:/shared/example-data#
|
||||
|
||||
On Windows, launch from Powershell as:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
PS C:\> docker run -it --rm --volume ${PWD}:/shared telecominfraproject/oopt-gnpy
|
||||
root@89784e577d44:/shared/example-data#
|
||||
|
||||
In both cases, a directory named ``example-data/`` will appear in your current working directory.
|
||||
GNPy automaticallly populates it with example files from the current release.
|
||||
Remove that directory if you want to start from scratch.
|
||||
|
||||
.. _install-python:
|
||||
|
||||
Using Python on your computer
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
**Note**: `gnpy` supports Python 3 only. Python 2 is not supported.
|
||||
`gnpy` requires Python ≥3.8
|
||||
|
||||
**Note**: the `gnpy` maintainers strongly recommend the use of Anaconda for
|
||||
managing dependencies.
|
||||
|
||||
It is recommended that you use a "virtual environment" when installing `gnpy`.
|
||||
Do not install `gnpy` on your system Python.
|
||||
|
||||
.. _install-anaconda:
|
||||
|
||||
We recommend the use of the `Anaconda Python distribution <https://www.anaconda.com/download>`_ which comes with many scientific computing
|
||||
dependencies pre-installed. Anaconda creates a base "virtual environment" for
|
||||
you automatically. You can also create and manage your ``conda`` "virtual
|
||||
environments" yourself (see:
|
||||
https://conda.io/docs/user-guide/tasks/manage-environments.html)
|
||||
|
||||
To activate your Anaconda virtual environment, you may need to do the
|
||||
following:
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ source /path/to/anaconda/bin/activate # activate Anaconda base environment
|
||||
(base) $ # note the change to the prompt
|
||||
|
||||
You can check which Anaconda environment you are using with:
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
(base) $ conda env list # list all environments
|
||||
# conda environments:
|
||||
#
|
||||
base * /src/install/anaconda3
|
||||
|
||||
(base) $ echo $CONDA_DEFAULT_ENV # show default environment
|
||||
base
|
||||
|
||||
You can check your version of Python with the following. If you are using
|
||||
Anaconda's Python 3, you should see similar output as below. Your results may
|
||||
be slightly different depending on your Anaconda installation path and the
|
||||
exact version of Python you are using.
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ which python # check which Python executable is used
|
||||
/path/to/anaconda/bin/python
|
||||
$ python -V # check your Python version
|
||||
Python 3.8.0 :: Anaconda, Inc.
|
||||
|
||||
.. _install-pip:
|
||||
|
||||
Installing the Python package
|
||||
*****************************
|
||||
|
||||
From within your Anaconda Python 3 environment, you can clone the master branch
|
||||
of the `gnpy` repo and install it with:
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ git clone https://github.com/Telecominfraproject/oopt-gnpy # clone the repo
|
||||
$ cd oopt-gnpy
|
||||
$ pip install --editable . # note the trailing dot
|
||||
|
||||
To test that `gnpy` was successfully installed, you can run this command. If it
|
||||
executes without a ``ModuleNotFoundError``, you have successfully installed
|
||||
`gnpy`.
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ python -c 'import gnpy' # attempt to import gnpy
|
||||
|
||||
$ pytest # run tests
|
||||
95
docs/intro.rst
Normal file
95
docs/intro.rst
Normal file
@@ -0,0 +1,95 @@
|
||||
.. _intro:
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
``gnpy`` is a library for building route planning and optimization tools.
|
||||
|
||||
It ships with a number of example programs. Release versions will ship with
|
||||
fully-functional programs.
|
||||
|
||||
**Note**: *If you are a network operator or involved in route planning and
|
||||
optimization for your organization, please contact project maintainer Jan
|
||||
Kundrát <jkt@jankundrat.com>. gnpy is looking for users with
|
||||
specific, delineated use cases to drive requirements for future
|
||||
development.*
|
||||
|
||||
This example demonstrates how GNPy can be used to check the expected SNR at the end of the line by varying the channel input power,
|
||||
or to run a planning script to check SNR of several services:
|
||||
|
||||
.. image:: images/gnpy-transmission-example.svg
|
||||
:width: 100%
|
||||
:align: left
|
||||
:alt: Running a simple simulation example
|
||||
|
||||
By default, the gnpy-transmission-example script operates on a single span network defined in
|
||||
`gnpy/example-data/edfa_example_network.json <../gnpy/example-data/edfa_example_network.json>`_
|
||||
|
||||
You can specify a different network at the command line as follows. For
|
||||
example, to use the CORONET Global network defined in
|
||||
`gnpy/example-data/CORONET_Global_Topology.json <../gnpy/example-data/CORONET_Global_Topology.json>`_:
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ gnpy-transmission-example $(gnpy-example-data)/CORONET_Global_Topology.json
|
||||
|
||||
It is also possible to use an Excel file input (for example
|
||||
`gnpy/example-data/CORONET_Global_Topology.xls <../gnpy/example-data/CORONET_Global_Topology.xls>`_).
|
||||
The Excel file will be processed into a JSON file with the same prefix.
|
||||
Further details about the Excel data structure are available `in the documentation <excel.rst>`__.
|
||||
|
||||
The main transmission example will calculate the average signal OSNR and SNR
|
||||
across network elements (transceiver, ROADMs, fibers, and amplifiers)
|
||||
between two transceivers selected by the user. Additional details are provided by doing ``gnpy-transmission-example -h``. (By default, for the CORONET Global
|
||||
network, it will show the transmission of spectral information between Abilene and Albany)
|
||||
|
||||
This script calculates the average signal OSNR = |OSNR| and SNR = |SNR|.
|
||||
|
||||
.. |OSNR| replace:: P\ :sub:`ch`\ /P\ :sub:`ase`
|
||||
.. |SNR| replace:: P\ :sub:`ch`\ /(P\ :sub:`nli`\ +\ P\ :sub:`ase`)
|
||||
|
||||
|Pase| is the amplified spontaneous emission noise, and |Pnli| the non-linear
|
||||
interference noise.
|
||||
|
||||
.. |Pase| replace:: P\ :sub:`ase`
|
||||
.. |Pnli| replace:: P\ :sub:`nli`
|
||||
|
||||
Further Instructions for Use
|
||||
----------------------------
|
||||
|
||||
Simulations are driven by a set of `JSON <json.rst>`__ or `XLS <excel.rst>`__ files.
|
||||
|
||||
The ``gnpy-transmission-example`` script propagates a spectrum of channels at 32 Gbaud, 50 GHz spacing and 0 dBm/channel.
|
||||
Launch power in fiber spans can be overridden by using the ``--power`` argument.
|
||||
Spectrum information is not yet parametrized but can be modified directly in the ``eqpt_config.json`` (via the ``SpectralInformation`` -SI- structure) to accommodate any baud rate or spacing.
|
||||
The number of channel is computed based on ``spacing`` and ``f_min``, ``f_max`` values.
|
||||
|
||||
An experimental support for Raman amplification is available:
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ gnpy-transmission-example \
|
||||
$(gnpy-example-data)/raman_edfa_example_network.json \
|
||||
--sim $(gnpy-example-data)/sim_params.json --show-channels
|
||||
|
||||
Configuration of Raman pumps (their frequencies, power and pumping direction) is done via the `RamanFiber element in the network topology <../gnpy/example-data/raman_edfa_example_network.json>`_.
|
||||
General numeric parameters for simulation control are provided in the `gnpy/example-data/sim_params.json <../gnpy/example-data/sim_params.json>`_.
|
||||
|
||||
Use ``gnpy-path-request`` to request several paths at once:
|
||||
|
||||
.. code-block:: shell-session
|
||||
|
||||
$ cd $(gnpy-example-data)
|
||||
$ gnpy-path-request -o output_file.json \
|
||||
meshTopologyExampleV2.xls meshTopologyExampleV2_services.json
|
||||
|
||||
This program operates on a network topology (`JSON <json.rst>`__ or `Excel <excel.rst>`__ format), processing the list of service requests (JSON or XLS again).
|
||||
The service requests and reply formats are based on the `draft-ietf-teas-yang-path-computation-01 <https://tools.ietf.org/html/draft-ietf-teas-yang-path-computation-01>`__ with custom extensions (e.g., for transponder modes).
|
||||
An example of the JSON input is provided in file `service-template.json`, while results are shown in `path_result_template.json`.
|
||||
|
||||
Important note: ``gnpy-path-request`` is not a network dimensionning tool: each service does not reserve spectrum, or occupy ressources such as transponders. It only computes path feasibility assuming the spectrum (between defined frequencies) is loaded with "nb of channels" spaced by "spacing" values as specified in the system parameters input in the service file, each cannel having the same characteristics in terms of baudrate, format,... as the service transponder. The transceiver element acts as a "logical starting/stopping point" for the spectral information propagation. At that point it is not meant to represent the capacity of add drop ports.
|
||||
As a result transponder type is not part of the network info. it is related to the list of services requests.
|
||||
|
||||
The current version includes a spectrum assigment features that enables to compute a candidate spectrum assignment for each service based on a first fit policy. Spectrum is assigned based on service specified spacing value, path_bandwidth value and selected mode for the transceiver. This spectrum assignment includes a basic capacity planning capability so that the spectrum resource is limited by the frequency min and max values defined for the links. If the requested services reach the link spectrum capacity, additional services feasibility are computed but marked as blocked due to spectrum reason.
|
||||
|
||||
OpenROADM networks can be simulated via ``gnpy/example-data/eqpt_config_openroadm_*.json`` -- see ``gnpy/example-data/Sweden_OpenROADM*_example_network.json`` as an example.
|
||||
1400
docs/json.rst
Normal file
1400
docs/json.rst
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,7 @@
|
||||
The QoT estimation in the PSE framework of TIP-OOPT
|
||||
=======================================================
|
||||
.. _physical-model:
|
||||
|
||||
Physical Model used in GNPy
|
||||
===========================
|
||||
|
||||
QoT-E including ASE noise and NLI accumulation
|
||||
----------------------------------------------
|
||||
@@ -124,9 +126,9 @@ that can be easily evaluated extending the FWM theory from a set of discrete
|
||||
tones - the standard FWM theory introduced back in the 90s by Inoue
|
||||
:cite:`Innoue-FWM`- to a continuity of tones, possibly spectrally shaped.
|
||||
Signals propagating in the fiber are not equivalent to Gaussian noise, but
|
||||
thanks to the absence of in-line compensation for choromatic dispersion, the
|
||||
thanks to the absence of in-line compensation for chromatic dispersion, the
|
||||
become so, over short distances. So, the Gaussian noise model with incoherent
|
||||
accumulation of NLI has estensively proved to be a quick yet accurate and
|
||||
accumulation of NLI has extensively proved to be a quick yet accurate and
|
||||
conservative tool to estimate propagation impairments of fiber propagation.
|
||||
Note that the GN-model has not been derived with the aim of an *exact*
|
||||
performance estimation, but to pursue a conservative performance prediction.
|
||||
@@ -143,4 +145,4 @@ Raman Scattering in order to give a proper estimation for all channels
|
||||
:cite:`cantono2018modeling`. This will be the main upgrade required within the
|
||||
PSE framework.
|
||||
|
||||
.. bibliography:: biblio.bib
|
||||
.. bibliography::
|
||||
|
||||
269
docs/release-notes.rst
Normal file
269
docs/release-notes.rst
Normal file
@@ -0,0 +1,269 @@
|
||||
.. _release-notes:
|
||||
|
||||
Release change log
|
||||
==================
|
||||
|
||||
Each release introduces some changes and new features.
|
||||
|
||||
(prepare text for next release)
|
||||
ROADM impairments can be defined per degree and roadm-path type (add, drop or express).
|
||||
Minimum loss when crossing a ROADM is no more 0 dB. It can be set per ROADM degree with roadm-path-impairments.
|
||||
|
||||
The transceiver output power, which was previously set using the same parameter as the input span power (power_dbm),
|
||||
can now be set using a different parameter. It can be set as:
|
||||
|
||||
- for all channels, with tx_power_dbm using SI similarly to tx_osnr (gnpy-transmission-example script)
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
"SI": [{
|
||||
"f_min": 191.35e12,
|
||||
"baud_rate": 32e9,
|
||||
"f_max": 196.1e12,
|
||||
"spacing": 50e9,
|
||||
"power_dbm": 3,
|
||||
"power_range_db": [0, 0, 1],
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"tx_power_dbm": -10,
|
||||
"sys_margins": 2
|
||||
}
|
||||
]
|
||||
|
||||
- for certain channels, using -spectrum option and tx_channel_power_dbm option (gnpy-transmission-example script).
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"spectrum": [
|
||||
{
|
||||
"f_min": 191.35e12,
|
||||
"f_max":193.1e12,
|
||||
"baud_rate": 32e9,
|
||||
"slot_width": 50e9,
|
||||
"power_dbm": 0,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40
|
||||
},
|
||||
{
|
||||
"f_min": 193.15e12,
|
||||
"f_max":193.15e12,
|
||||
"baud_rate": 32e9,
|
||||
"slot_width": 50e9,
|
||||
"power_dbm": 0,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"tx_power_dbm": -10
|
||||
},
|
||||
{
|
||||
"f_min": 193.2e12,
|
||||
"f_max":195.1e12,
|
||||
"baud_rate": 32e9,
|
||||
"slot_width": 50e9,
|
||||
"power_dbm": 0,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
- per service using the additional parameter ``tx_power`` which similarly to ``power`` should be defined in Watt (gnpy-path-request script)
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"path-request": [
|
||||
{
|
||||
"request-id": "0",
|
||||
"source": "trx SITE1",
|
||||
"destination": "trx SITE2",
|
||||
"src-tp-id": "trx SITE1",
|
||||
"dst-tp-id": "trx SITE2",
|
||||
"bidirectional": false,
|
||||
"path-constraints": {
|
||||
"te-bandwidth": {
|
||||
"technology": "flexi-grid",
|
||||
"trx_type": "Voyager",
|
||||
"trx_mode": "mode 1",
|
||||
"spacing": 50000000000.0,
|
||||
"path_bandwidth": 100000000000.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"request-id": "0 with tx_power",
|
||||
"source": "trx SITE1",
|
||||
"destination": "trx SITE2",
|
||||
"src-tp-id": "trx SITE1",
|
||||
"dst-tp-id": "trx SITE2",
|
||||
"bidirectional": false,
|
||||
"path-constraints": {
|
||||
"te-bandwidth": {
|
||||
"technology": "flexi-grid",
|
||||
"trx_type": "Voyager",
|
||||
"trx_mode": "mode 1",
|
||||
"tx_power": 0.0001,
|
||||
"spacing": 50000000000.0,
|
||||
"path_bandwidth": 100000000000.0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
v2.9
|
||||
----
|
||||
|
||||
The revision introduces a major refactor that separates design and propagation. Most of these changes have no impact
|
||||
on the user experience, except the following ones:
|
||||
|
||||
**Network design - amplifiers**: amplifier saturation is checked during design in all cases, even if type_variety is
|
||||
set; amplifier gain is no more computed on the fly but only at design phase.
|
||||
|
||||
Before, the design did not consider amplifier power saturation during design if amplifier type_variety was stated.
|
||||
With this revision, the saturation is always applied:
|
||||
If design is made for a per channel power that leads to saturation, the target are properly reduced and the design
|
||||
is freezed. So that when a new simulation is performed on the same network for lower levels of power per channel
|
||||
the same gain target is applied. Before these were recomputed, changing the gain targets, so the simulation was
|
||||
not considering the exact same working points for amplifiers in case of saturation.
|
||||
|
||||
Note that this case (working with saturation settings) is not recommended.
|
||||
|
||||
The gain of amplifiers was estimated on the fly also in case of RamanFiber preceding elements. The refactor now
|
||||
requires that an estimation of Raman gain of the RamanFiber is done during design to properly compute a gain target.
|
||||
The Raman gain is estimated at design for every RamanFiber span and also during propagation instead of being only
|
||||
estimated at propagation stage for those Raman Fiber spans concerned with the transmission. The auto-design is more
|
||||
accurate for unpropagated spans, but this results in an increase overall computation time.
|
||||
This will be improved in the future.
|
||||
|
||||
**Network design - ROADMs**: ROADM target power settings are verified during design.
|
||||
|
||||
Design checks that expected power coming from every directions ingress from a ROADM are consistent with output power
|
||||
targets. The checks only considers the adjacent previous hop. If the expected power at the input of this ROADM is
|
||||
lower than the target power on the out-degree of the ROADM, a warning is displayed, and user is asked to review the
|
||||
input network to avoid this situation. This does not change the design or propagation behaviour.
|
||||
|
||||
**Propagation**: amplifier gain target is no more recomputed during propagation. It is now possible to freeze
|
||||
the design and propagate without automatic changes.
|
||||
|
||||
In previous release, gain was recomputed during propagation based on an hypothetical reference noiseless channel
|
||||
propagation. It was not possible to «freeze» the autodesign, and propagate without recomputing the gain target
|
||||
of amplifiers.
|
||||
With this new release, the design is freezed, so that it is possible to compare performances on same basis.
|
||||
|
||||
**Display**: "effective pch (dbm)" is removed. Display contains the target pch which is the target power per channel
|
||||
in dBm, computed based on reference channel used for design and the amplifier delta_p in dB (and before out VOA
|
||||
contribution). Note that "actual pch out (dBm)" is the actual propagated total power per channel averaged per spectrum
|
||||
band definition at the output of the amplifier element, including noises and out VOA contribution.
|
||||
|
||||
v2.8
|
||||
----
|
||||
|
||||
**Spectrum assignment**: requests can now support multiple slots.
|
||||
The definition in service file supports multiple assignments (unchanged syntax):
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
"effective-freq-slot": [
|
||||
{
|
||||
"N": 0,
|
||||
"M": 4
|
||||
}, {
|
||||
"N": 50,
|
||||
"M": 4
|
||||
}
|
||||
],
|
||||
|
||||
But in results, label-hop is now a list of slots and center frequency index:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"path-route-object": {
|
||||
"index": 4,
|
||||
"label-hop": [
|
||||
{
|
||||
"N": 0,
|
||||
"M": 4
|
||||
}, {
|
||||
"N": 50,
|
||||
"M": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
instead of
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"path-route-object": {
|
||||
"index": 4,
|
||||
"label-hop": {
|
||||
"N": 0,
|
||||
"M": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
**change in display**: only warnings are displayed ; information are disabled and needs the -v (verbose)
|
||||
option to be displayed on standard output.
|
||||
|
||||
**frequency scaling**: A more accurate description of fiber parameters is implemented, including frequency scaling of
|
||||
chromatic dispersion, effective area, Raman gain coefficient, and nonlinear coefficient.
|
||||
|
||||
In particular:
|
||||
|
||||
1. Chromatic dispersion can be defined with ``'dispersion'`` and ``'dispersion_slope'``, as in previous versions, or
|
||||
with ``'dispersion_per_frequency'``; the latter must be defined as a dictionary with two keys, ``'value'`` and
|
||||
``'frequency'`` and it has higher priority than the entries ``'dispersion'`` and ``'dispersion_slope'``.
|
||||
Essential change: In previous versions, when it was not provided the ``'dispersion_slope'`` was calculated in an
|
||||
involute manner to get a vanishing beta3 , and this was a mere artifact for NLI evaluation purposes (namely to evaluate
|
||||
beta2 and beta3, not for total dispersion accumulation). Now, the evaluation of beta2 and beta3 is performed explicitly
|
||||
in the element.py module.
|
||||
|
||||
2. The effective area is provided as a scalar value evaluated at the Fiber reference frequency and properly scaled
|
||||
considering the Fiber refractive indices n1 and n2, and the core radius. These quantities are assumed to be fixed and
|
||||
are hard coded in the parameters.py module. Essential change: The effective area is always scaled along the frequency.
|
||||
|
||||
3. The Raman gain coefficient is properly scaled considering the overlapping of fiber effective area values scaled at
|
||||
the interacting frequencies. Essential change: In previous version the Raman gain coefficient depends only on
|
||||
the frequency offset.
|
||||
|
||||
4. The nonlinear coefficient ``'gamma'`` is properly scaled considering the refractive index n2 and the scaling
|
||||
effective area. Essential change: As the effective area, the nonlinear coefficient is always scaled along the
|
||||
frequency.
|
||||
|
||||
**power offset**: Power equalization now enables defining a power offset in transceiver library to represent
|
||||
the deviation from the general equalisation strategy defined in ROADMs.
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
"mode": [{
|
||||
"format": "100G",
|
||||
"baud_rate": 32.0e9,
|
||||
"tx_osnr": 35.0,
|
||||
"min_spacing": 50.0e9,
|
||||
"cost": 1,
|
||||
"OSNR": 10.0,
|
||||
"bit_rate": 100.0e9,
|
||||
"roll_off": 0.2,
|
||||
"equalization_offset_db": 0.0
|
||||
}, {
|
||||
"format": "200G",
|
||||
"baud_rate": 64.0e9,
|
||||
"tx_osnr": 35.0,
|
||||
"min_spacing": 75.0e9,
|
||||
"cost": 1,
|
||||
"OSNR": 13.0,
|
||||
"bit_rate": 200.0e9,
|
||||
"roll_off": 0.2,
|
||||
"equalization_offset_db": 1.76
|
||||
}
|
||||
]
|
||||
|
||||
v2.7
|
||||
----
|
||||
@@ -1,70 +0,0 @@
|
||||
gnpy\.core package
|
||||
==================
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
gnpy\.core\.elements module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: gnpy.core.elements
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.execute module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: gnpy.core.execute
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.info module
|
||||
-----------------------
|
||||
|
||||
.. automodule:: gnpy.core.info
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.network module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: gnpy.core.network
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.node module
|
||||
-----------------------
|
||||
|
||||
.. automodule:: gnpy.core.node
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.units module
|
||||
------------------------
|
||||
|
||||
.. automodule:: gnpy.core.units
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.utils module
|
||||
------------------------
|
||||
|
||||
.. automodule:: gnpy.core.utils
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: gnpy.core
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
@@ -1,17 +0,0 @@
|
||||
gnpy package
|
||||
============
|
||||
|
||||
Subpackages
|
||||
-----------
|
||||
|
||||
.. toctree::
|
||||
|
||||
gnpy.core
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: gnpy
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
@@ -1,7 +0,0 @@
|
||||
gnpy
|
||||
====
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
|
||||
gnpy
|
||||
@@ -1,8 +0,0 @@
|
||||
-1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01
|
||||
-2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02
|
||||
-1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01
|
||||
-2.0500000000000000e+01 -2.0489473680000000e+01 -2.0478947370000000e+01 -2.0468421050000000e+01 -2.0457894740000000e+01 -2.0447368420000000e+01 -2.0436842110000001e+01 -2.0426315790000000e+01 -2.0415789470000000e+01 -2.0405263160000001e+01 -2.0394736840000000e+01 -2.0384210530000001e+01 -2.0373684210000000e+01 -2.0363157890000000e+01 -2.0352631580000001e+01 -2.0342105260000000e+01 -2.0331578950000001e+01 -2.0321052630000001e+01 -2.0310526320000001e+01 -2.0300000000000001e+01 -2.0289473680000000e+01 -2.0278947370000001e+01 -2.0268421050000001e+01 -2.0257894740000001e+01 -2.0247368420000001e+01 -2.0236842110000001e+01 -2.0226315790000001e+01 -2.0215789470000001e+01 -2.0205263160000001e+01 -2.0194736840000001e+01 -2.0184210530000001e+01 -2.0173684210000001e+01 -2.0163157890000001e+01 -2.0152631580000001e+01 -2.0142105260000001e+01 -2.0131578950000002e+01 -2.0121052630000001e+01 -2.0110526320000002e+01 -2.0100000000000001e+01 -2.0089473680000001e+01 -2.0078947370000002e+01 -2.0068421050000001e+01 -2.0057894739999998e+01 -2.0047368420000002e+01 -2.0036842109999998e+01 -2.0026315790000002e+01 -2.0015789470000001e+01 -2.0005263159999998e+01 -1.9994736840000002e+01 -1.9984210529999999e+01 -1.9973684209999998e+01 -1.9963157890000002e+01 -1.9952631579999998e+01 -1.9942105260000002e+01 -1.9931578949999999e+01 -1.9921052629999998e+01 -1.9910526319999999e+01 -1.9899999999999999e+01 -1.9889473679999998e+01 -1.9878947369999999e+01 -1.9868421049999998e+01 -1.9857894739999999e+01 -1.9847368419999999e+01 -1.9836842109999999e+01 -1.9826315789999999e+01 -1.9815789469999999e+01 -1.9805263159999999e+01 -1.9794736839999999e+01 -1.9784210529999999e+01 -1.9773684209999999e+01 -1.9763157889999999e+01 -1.9752631579999999e+01 -1.9742105259999999e+01 -1.9731578949999999e+01 -1.9721052629999999e+01 -1.9710526320000000e+01 -1.9699999999999999e+01 -1.9689473679999999e+01 -1.9678947369999999e+01 -1.9668421049999999e+01 -1.9657894740000000e+01 -1.9647368419999999e+01 -1.9636842110000000e+01 -1.9626315790000000e+01 -1.9615789469999999e+01 -1.9605263160000000e+01 -1.9594736839999999e+01 -1.9584210530000000e+01 -1.9573684210000000e+01 -1.9563157889999999e+01 -1.9552631580000000e+01 -1.9542105260000000e+01 -1.9531578950000000e+01 -1.9521052630000000e+01 -1.9510526320000000e+01 -1.9500000000000000e+01
|
||||
-2.0500000000000000e+01 -2.0489473680000000e+01 -2.0478947370000000e+01 -2.0468421050000000e+01 -2.0457894740000000e+01 -2.0447368420000000e+01 -2.0436842110000001e+01 -2.0426315790000000e+01 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.9573684210000000e+01 -1.9563157889999999e+01 -1.9552631580000000e+01 -1.9542105260000000e+01 -1.9531578950000000e+01 -1.9521052630000000e+01 -1.9510526320000000e+01 -1.9500000000000000e+01
|
||||
-1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.4460000000000001e+01
|
||||
-1.4460000000000001e+01 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01
|
||||
-1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.4460000000000001e+01 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02
|
||||
@@ -1,8 +0,0 @@
|
||||
7.0000000000000000e+01 1.1700000000000000e+02 1.0800000000000000e+02 1.0800000000000000e+02 3.2000000000000000e+01 7.0000000000000000e+01 1.0800000000000000e+02 9.7000000000000000e+01 1.1600000000000000e+02 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
7.9000000000000000e+01 1.1000000000000000e+02 1.0100000000000000e+02 3.2000000000000000e+01 7.1000000000000000e+01 1.1400000000000000e+02 1.1100000000000000e+02 1.1700000000000000e+02 1.1200000000000000e+02 3.2000000000000000e+01 6.6000000000000000e+01 1.0800000000000000e+02 1.1700000000000000e+02 1.0100000000000000e+02 3.2000000000000000e+01
|
||||
7.9000000000000000e+01 1.1000000000000000e+02 1.0100000000000000e+02 3.2000000000000000e+01 7.1000000000000000e+01 1.1400000000000000e+02 1.1100000000000000e+02 1.1700000000000000e+02 1.1200000000000000e+02 3.2000000000000000e+01 8.2000000000000000e+01 1.0100000000000000e+02 1.0000000000000000e+02 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
7.0000000000000000e+01 1.1700000000000000e+02 1.0800000000000000e+02 1.0800000000000000e+02 3.2000000000000000e+01 1.1900000000000000e+02 3.2000000000000000e+01 8.3000000000000000e+01 8.2000000000000000e+01 8.3000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
6.6000000000000000e+01 1.1100000000000000e+02 1.1600000000000000e+02 1.0400000000000000e+02 3.2000000000000000e+01 6.9000000000000000e+01 1.1000000000000000e+02 1.0000000000000000e+02 1.1500000000000000e+02 3.2000000000000000e+01 1.1900000000000000e+02 3.2000000000000000e+01 8.3000000000000000e+01 8.2000000000000000e+01 8.3000000000000000e+01
|
||||
1.0400000000000000e+02 1.0100000000000000e+02 9.7000000000000000e+01 1.1800000000000000e+02 1.2100000000000000e+02 3.2000000000000000e+01 9.8000000000000000e+01 1.0800000000000000e+02 1.1700000000000000e+02 1.0100000000000000e+02 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
1.0400000000000000e+02 1.0100000000000000e+02 9.7000000000000000e+01 1.1800000000000000e+02 1.2100000000000000e+02 3.2000000000000000e+01 1.1400000000000000e+02 1.0100000000000000e+02 1.0000000000000000e+02 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
1.1900000000000000e+02 1.1100000000000000e+02 1.1400000000000000e+02 1.1500000000000000e+02 1.1600000000000000e+02 3.2000000000000000e+01 9.9000000000000000e+01 9.7000000000000000e+01 1.1500000000000000e+02 1.0100000000000000e+02 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"params": {
|
||||
"dfg": [25.13596985, 25.11822814, 25.09542133, 25.06245771, 25.02602765, 24.99637953, 24.98167255, 24.97530668, 24.98320726, 24.99718565, 25.01757247, 25.03832781, 25.05495585, 25.0670719, 25.07091411, 25.07094365, 25.07114324, 25.07533627, 25.08731018, 25.10313936, 25.12276204, 25.14239479, 25.15945633, 25.17392704, 25.17673767, 25.17037141, 25.15216254, 25.1311431, 25.10802335, 25.08548777, 25.06916675, 25.05848176, 25.05447313, 25.05154441, 25.04946059, 25.04717849, 25.04551656, 25.04467649, 25.0407292, 25.03285408, 25.0234883, 25.01659234, 25.01332136, 25.01123434, 25.01030015, 25.00936548, 25.00873964, 25.00842535, 25.00696466, 25.0040431, 25.00070998, 24.9984232, 24.99306332, 24.98352421, 24.97125103, 24.96038108, 24.94888721, 24.93531489, 24.92131927, 24.90898697, 24.89896514, 24.88958463, 24.8808387, 24.87210092, 24.86462026, 24.85839773, 24.85445838, 24.85155443, 24.85176601, 24.85408014, 24.85909624, 24.86474458, 24.87203486, 24.8803652, 24.88910669, 24.89721313, 24.90282604, 24.9065669, 24.9086508, 24.91093944, 24.91343079, 24.91592344, 24.92155351, 24.93031861, 24.94052812, 24.94904669, 24.95757123, 24.96781845, 24.98180093, 24.99782686, 25.01393183, 25.02809846, 25.04032575, 25.05256981, 25.06479701, 25.07704697],
|
||||
"dgt": [2.714526681131686, 2.705443819238505, 2.6947834587664494, 2.6841217449620203, 2.6681935771243177, 2.6521732021128046, 2.630396440815385, 2.602860350286428, 2.5696460593920065, 2.5364027376452056, 2.499446286796604, 2.4587748041127506, 2.414398437185221, 2.3699990328716107, 2.322373696229342, 2.271520771371253, 2.2174389328192197, 2.16337565384239, 2.1183028432496016, 2.082225099873648, 2.055100772005235, 2.0279625371819305, 2.0008103857988204, 1.9736443063300082, 1.9482128147680253, 1.9245345552113182, 1.9026104247588487, 1.8806927939516411, 1.862235672444246, 1.847275503201129, 1.835814081380705, 1.824381436842932, 1.8139629377087627, 1.8045606557581335, 1.7961751115773796, 1.7877868031023945, 1.7793941781790852, 1.7709972329654864, 1.7625959636196327, 1.7541903672600494, 1.7459181197626403, 1.737780757913635, 1.7297783508684146, 1.7217732861435076, 1.7137640932265894, 1.7057507692361864, 1.6918150918099673, 1.6719047669939942, 1.6460167077689267, 1.6201194134191075, 1.5986915141218316, 1.5817353179379183, 1.569199764184379, 1.5566577309558969, 1.545374152761467, 1.5353620432989845, 1.5266220576235803, 1.5178910621476225, 1.5097346239790443, 1.502153039909686, 1.495145456062699, 1.488134243479226, 1.48111939735681, 1.474100442252211, 1.4670307626366115, 1.4599103316162523, 1.45273959485914, 1.445565137158368, 1.4340878115214444, 1.418273806730323, 1.3981208704326855, 1.3779439775587023, 1.3598972673004606, 1.3439818461440451, 1.3301807335621048, 1.316383926863083, 1.3040618749785347, 1.2932153453410835, 1.2838336236692311, 1.2744470198196236, 1.2650555289898042, 1.2556591482982988, 1.2428104897182262, 1.2264996957264114, 1.2067249615595257, 1.1869318618366975, 1.1672278304018044, 1.1476135933863398, 1.1280891949729075, 1.108555289615659, 1.0895983485572227, 1.0712204022764056, 1.0534217504465226, 1.0356155337864215, 1.017807767853702, 1.0],
|
||||
"nf_fit_coeff": [0.000168241, 0.0469961, 0.0359549, 5.82851],
|
||||
"nf_ripple": [-0.315374332, -0.315374332, -0.3154009157100272, -0.3184914611751095, -0.32158358425400546, -0.3246772861549999, -0.32762368641496226, -0.3205413846123276, -0.31345546385118733, -0.3063659213569748, -0.29920267890990127, -0.27061972852631744, -0.24202215770774693, -0.21340995523361256, -0.18478227130158695, -0.14809761118389625, -0.11139416731807622, -0.07467192527357988, -0.038026748965679924, -0.019958469399422092, -0.0018809287980157928, 0.01620587996057356, 0.03430196400570967, 0.05240733047405406, 0.07052198650959736, 0.079578036683472, 0.08854664736190952, 0.0975198632319653, 0.10649768784154924, 0.0977413804499074, 0.08880343717266004, 0.07986089973284587, 0.0709137645874038, 0.06333589274056531, 0.055756212252058776, 0.04817263174786321, 0.04058514821716236, 0.03338159167571013, 0.026178308595650738, 0.018971315351761126, 0.011760609076833628, 0.01695029492275999, 0.02227499135770144, 0.02760243318910433, 0.03293262254079026, 0.038265561538776145, 0.04360125231127117, 0.03485699074348155, 0.025991055149117932, 0.017120541224980364, 0.008275758735920322, 0.0019423214065246042, -0.004394389017104359, -0.010734375072893196, -0.017077639301414434, -0.02467970289957285, -0.03229797040382168, -0.03992018009047725, -0.04753456632753024, -0.049234003141433724, -0.05093432003654719, -0.05263551769669225, -0.05433759680640246, -0.0560405580509193, -0.057718452237076875, -0.056840590379175944, -0.055962273198734966, -0.05508350034141658, -0.054204271452516814, -0.05839608872695511, -0.06262733016971533, -0.0668607690892037, -0.07090173625606945, -0.05209609730905224, -0.03328068412141294, -0.014455489070928059, 0.004315038757905716, 0.014839202394482527, 0.025368841662503576, 0.03590396083646565, 0.0464445641953214, 0.05699065602246746, 0.06754224060577406, 0.10002709623672751, 0.13258013095133617, 0.1651501336277331, 0.1977371175359939, 0.23194802687829724, 0.26618779883837107, 0.3004454365808535, 0.33472095409250663, 0.35929034770587287, 0.38384389188855605, 0.40841026111391787, 0.43298946543290784, 0.43298946543290784],
|
||||
"frequencies": []
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
{
|
||||
"network_name": "EDFA Example Network - P2P",
|
||||
"elements": [{
|
||||
"uid": "Site A",
|
||||
"type": "Transceiver",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"city": "Site A",
|
||||
"region": "",
|
||||
"latitude": 0,
|
||||
"longitude": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "Span1",
|
||||
"type": "Fiber",
|
||||
"params": {
|
||||
"length": 80,
|
||||
"loss_coef": 0.2,
|
||||
"length_units": "km",
|
||||
"dispersion": 16.7E-6,
|
||||
"gamma": 1.27E-3
|
||||
},
|
||||
"metadata": {
|
||||
"location": {
|
||||
"region": "",
|
||||
"latitude": 1,
|
||||
"longitude": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "Edfa1",
|
||||
"type": "Edfa",
|
||||
"operational": {
|
||||
"gain_target": 16,
|
||||
"tilt_target": 0
|
||||
},
|
||||
"config_from_json": "edfa_config.json",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"region": "",
|
||||
"latitude": 2,
|
||||
"longitude": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "Site B",
|
||||
"type": "Transceiver",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"city": "Site B",
|
||||
"region": "",
|
||||
"latitude": 3,
|
||||
"longitude": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
"connections": [{
|
||||
"from_node": "Site A",
|
||||
"to_node": "Span1"
|
||||
},
|
||||
{
|
||||
"from_node": "Span1",
|
||||
"to_node": "Edfa1"
|
||||
},
|
||||
{
|
||||
"from_node": "Edfa1",
|
||||
"to_node": "Site B"
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
from gnpy.core.utils import (load_json,
|
||||
itufs,
|
||||
freq2wavelength,
|
||||
lin2db,
|
||||
db2lin)
|
||||
from gnpy.core import network
|
||||
|
||||
topology = load_json('edfa_example_network.json')
|
||||
nw = network.network_from_json(topology)
|
||||
pch2d_legend_data = np.loadtxt('Pchan2DLegend.txt')
|
||||
pch2d = np.loadtxt('Pchan2D.txt')
|
||||
|
||||
ch_spacing = 0.05
|
||||
fc = itufs(ch_spacing)
|
||||
lc = freq2wavelength(fc) / 1000
|
||||
nchan = np.arange(len(lc))
|
||||
df = np.ones(len(lc)) * ch_spacing
|
||||
|
||||
edfa1 = [n for n in nw.nodes() if n.uid == 'Edfa1'][0]
|
||||
edfa1.gain_target = 20.0
|
||||
edfa1.tilt_target = -0.7
|
||||
edfa1.calc_nf()
|
||||
|
||||
results = []
|
||||
for Pin in pch2d:
|
||||
chgain = edfa1.gain_profile(Pin)
|
||||
pase = edfa1.noise_profile(chgain, fc, df)
|
||||
pout = lin2db(db2lin(Pin + chgain) + db2lin(pase))
|
||||
results.append(pout)
|
||||
|
||||
# Generate legend text
|
||||
|
||||
pch2d_legend = []
|
||||
for ea in pch2d_legend_data:
|
||||
s = ''.join([chr(xx) for xx in ea.astype(dtype=int)]).strip()
|
||||
pch2d_legend.append(s)
|
||||
|
||||
# Plot
|
||||
axis_font = {'fontname': 'Arial', 'size': '16', 'fontweight': 'bold'}
|
||||
title_font = {'fontname': 'Arial', 'size': '17', 'fontweight': 'bold'}
|
||||
tic_font = {'fontname': 'Arial', 'size': '12'}
|
||||
plt.rcParams["font.family"] = "Arial"
|
||||
plt.figure()
|
||||
plt.plot(nchan, pch2d.T, '.-', lw=2)
|
||||
plt.xlabel('Channel Number', **axis_font)
|
||||
plt.ylabel('Channel Power [dBm]', **axis_font)
|
||||
plt.title('Input Power Profiles for Different Channel Loading', **title_font)
|
||||
plt.legend(pch2d_legend, loc=5)
|
||||
plt.grid()
|
||||
plt.ylim((-100, -10))
|
||||
plt.xlim((0, 110))
|
||||
plt.xticks(np.arange(0, 100, 10), **tic_font)
|
||||
plt.yticks(np.arange(-110, -10, 10), **tic_font)
|
||||
plt.figure()
|
||||
for result in results:
|
||||
plt.plot(nchan, result, '.-', lw=2)
|
||||
plt.title('Output Power w/ ASE for Different Channel Loading', **title_font)
|
||||
plt.xlabel('Channel Number', **axis_font)
|
||||
plt.ylabel('Channel Power [dBm]', **axis_font)
|
||||
plt.grid()
|
||||
plt.ylim((-50, 10))
|
||||
plt.xlim((0, 100))
|
||||
plt.xticks(np.arange(0, 100, 10), **tic_font)
|
||||
plt.yticks(np.arange(-50, 10, 10), **tic_font)
|
||||
plt.legend(pch2d_legend, loc=5)
|
||||
plt.show()
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"gain_flatmax": 25,
|
||||
"gain_min": 15,
|
||||
"p_max": 21,
|
||||
"nf_fit_coeff": "pNFfit3.txt",
|
||||
"nf_ripple": "NFR_96.txt",
|
||||
"dfg": "DFG_96.txt",
|
||||
"dgt": "DGT_96.txt",
|
||||
"nf_model":
|
||||
{
|
||||
"enabled": true,
|
||||
"nf_min": 5.8,
|
||||
"nf_max": 10
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
-1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01
|
||||
-2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02
|
||||
-1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01 -2.0000000000000000e+01
|
||||
-2.0500000000000000e+01 -2.0489473680000000e+01 -2.0478947370000000e+01 -2.0468421050000000e+01 -2.0457894740000000e+01 -2.0447368420000000e+01 -2.0436842110000001e+01 -2.0426315790000000e+01 -2.0415789470000000e+01 -2.0405263160000001e+01 -2.0394736840000000e+01 -2.0384210530000001e+01 -2.0373684210000000e+01 -2.0363157890000000e+01 -2.0352631580000001e+01 -2.0342105260000000e+01 -2.0331578950000001e+01 -2.0321052630000001e+01 -2.0310526320000001e+01 -2.0300000000000001e+01 -2.0289473680000000e+01 -2.0278947370000001e+01 -2.0268421050000001e+01 -2.0257894740000001e+01 -2.0247368420000001e+01 -2.0236842110000001e+01 -2.0226315790000001e+01 -2.0215789470000001e+01 -2.0205263160000001e+01 -2.0194736840000001e+01 -2.0184210530000001e+01 -2.0173684210000001e+01 -2.0163157890000001e+01 -2.0152631580000001e+01 -2.0142105260000001e+01 -2.0131578950000002e+01 -2.0121052630000001e+01 -2.0110526320000002e+01 -2.0100000000000001e+01 -2.0089473680000001e+01 -2.0078947370000002e+01 -2.0068421050000001e+01 -2.0057894739999998e+01 -2.0047368420000002e+01 -2.0036842109999998e+01 -2.0026315790000002e+01 -2.0015789470000001e+01 -2.0005263159999998e+01 -1.9994736840000002e+01 -1.9984210529999999e+01 -1.9973684209999998e+01 -1.9963157890000002e+01 -1.9952631579999998e+01 -1.9942105260000002e+01 -1.9931578949999999e+01 -1.9921052629999998e+01 -1.9910526319999999e+01 -1.9899999999999999e+01 -1.9889473679999998e+01 -1.9878947369999999e+01 -1.9868421049999998e+01 -1.9857894739999999e+01 -1.9847368419999999e+01 -1.9836842109999999e+01 -1.9826315789999999e+01 -1.9815789469999999e+01 -1.9805263159999999e+01 -1.9794736839999999e+01 -1.9784210529999999e+01 -1.9773684209999999e+01 -1.9763157889999999e+01 -1.9752631579999999e+01 -1.9742105259999999e+01 -1.9731578949999999e+01 -1.9721052629999999e+01 -1.9710526320000000e+01 -1.9699999999999999e+01 -1.9689473679999999e+01 -1.9678947369999999e+01 -1.9668421049999999e+01 -1.9657894740000000e+01 -1.9647368419999999e+01 -1.9636842110000000e+01 -1.9626315790000000e+01 -1.9615789469999999e+01 -1.9605263160000000e+01 -1.9594736839999999e+01 -1.9584210530000000e+01 -1.9573684210000000e+01 -1.9563157889999999e+01 -1.9552631580000000e+01 -1.9542105260000000e+01 -1.9531578950000000e+01 -1.9521052630000000e+01 -1.9510526320000000e+01 -1.9500000000000000e+01
|
||||
-2.0500000000000000e+01 -2.0489473680000000e+01 -2.0478947370000000e+01 -2.0468421050000000e+01 -2.0457894740000000e+01 -2.0447368420000000e+01 -2.0436842110000001e+01 -2.0426315790000000e+01 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.9573684210000000e+01 -1.9563157889999999e+01 -1.9552631580000000e+01 -1.9542105260000000e+01 -1.9531578950000000e+01 -1.9521052630000000e+01 -1.9510526320000000e+01 -1.9500000000000000e+01
|
||||
-1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.4460000000000001e+01
|
||||
-1.4460000000000001e+01 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01 -1.4460000000000001e+01
|
||||
-1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.4460000000000001e+01 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02 -1.0000000000000000e+02
|
||||
@@ -1,8 +0,0 @@
|
||||
7.0000000000000000e+01 1.1700000000000000e+02 1.0800000000000000e+02 1.0800000000000000e+02 3.2000000000000000e+01 7.0000000000000000e+01 1.0800000000000000e+02 9.7000000000000000e+01 1.1600000000000000e+02 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
7.9000000000000000e+01 1.1000000000000000e+02 1.0100000000000000e+02 3.2000000000000000e+01 7.1000000000000000e+01 1.1400000000000000e+02 1.1100000000000000e+02 1.1700000000000000e+02 1.1200000000000000e+02 3.2000000000000000e+01 6.6000000000000000e+01 1.0800000000000000e+02 1.1700000000000000e+02 1.0100000000000000e+02 3.2000000000000000e+01
|
||||
7.9000000000000000e+01 1.1000000000000000e+02 1.0100000000000000e+02 3.2000000000000000e+01 7.1000000000000000e+01 1.1400000000000000e+02 1.1100000000000000e+02 1.1700000000000000e+02 1.1200000000000000e+02 3.2000000000000000e+01 8.2000000000000000e+01 1.0100000000000000e+02 1.0000000000000000e+02 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
7.0000000000000000e+01 1.1700000000000000e+02 1.0800000000000000e+02 1.0800000000000000e+02 3.2000000000000000e+01 1.1900000000000000e+02 3.2000000000000000e+01 8.3000000000000000e+01 8.2000000000000000e+01 8.3000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
6.6000000000000000e+01 1.1100000000000000e+02 1.1600000000000000e+02 1.0400000000000000e+02 3.2000000000000000e+01 6.9000000000000000e+01 1.1000000000000000e+02 1.0000000000000000e+02 1.1500000000000000e+02 3.2000000000000000e+01 1.1900000000000000e+02 3.2000000000000000e+01 8.3000000000000000e+01 8.2000000000000000e+01 8.3000000000000000e+01
|
||||
1.0400000000000000e+02 1.0100000000000000e+02 9.7000000000000000e+01 1.1800000000000000e+02 1.2100000000000000e+02 3.2000000000000000e+01 9.8000000000000000e+01 1.0800000000000000e+02 1.1700000000000000e+02 1.0100000000000000e+02 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
1.0400000000000000e+02 1.0100000000000000e+02 9.7000000000000000e+01 1.1800000000000000e+02 1.2100000000000000e+02 3.2000000000000000e+01 1.1400000000000000e+02 1.0100000000000000e+02 1.0000000000000000e+02 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
1.1900000000000000e+02 1.1100000000000000e+02 1.1400000000000000e+02 1.1500000000000000e+02 1.1600000000000000e+02 3.2000000000000000e+01 9.9000000000000000e+01 9.7000000000000000e+01 1.1500000000000000e+02 1.0100000000000000e+02 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01 3.2000000000000000e+01
|
||||
@@ -1,301 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Mon Nov 27 12:32:04 2017
|
||||
|
||||
@author: briantaylor
|
||||
"""
|
||||
import numpy as np
|
||||
from numpy import polyfit, polyval, mean
|
||||
from utilities import lin2db, db2lin, itufs, freq2wavelength
|
||||
import matplotlib.pyplot as plt
|
||||
from scipy.constants import h
|
||||
|
||||
|
||||
def noise_profile(nf, gain, ffs, df):
|
||||
""" noise_profile(nf, gain, ffs, df) computes amplifier ase
|
||||
|
||||
:param nf: Noise figure in dB
|
||||
:param gain: Actual gain calculated for the EDFA in dB units
|
||||
:param ffs: A numpy array of frequencies
|
||||
:param df: the reference bw in THz
|
||||
:type nf: numpy.ndarray
|
||||
:type gain: numpy.ndarray
|
||||
:type ffs: numpy.ndarray
|
||||
:type df: float
|
||||
:return: the asepower in dBm
|
||||
:rtype: numpy.ndarray
|
||||
|
||||
ASE POWER USING PER CHANNEL GAIN PROFILE
|
||||
INPUTS:
|
||||
NF_dB - Noise figure in dB, vector of length number of channels or
|
||||
spectral slices
|
||||
G_dB - Actual gain calculated for the EDFA, vector of length number of
|
||||
channels or spectral slices
|
||||
ffs - Center frequency grid of the channels or spectral slices in THz,
|
||||
vector of length number of channels or spectral slices
|
||||
dF - width of each channel or spectral slice in THz,
|
||||
vector of length number of channels or spectral slices
|
||||
OUTPUT:
|
||||
ase_dBm - ase in dBm per channel or spectral slice
|
||||
NOTE: the output is the total ASE in the channel or spectral slice. For
|
||||
50GHz channels the ASE BW is effectively 0.4nm. To get to noise power in
|
||||
0.1nm, subtract 6dB.
|
||||
|
||||
ONSR is usually quoted as channel power divided by
|
||||
the ASE power in 0.1nm RBW, regardless of the width of the actual
|
||||
channel. This is a historical convention from the days when optical
|
||||
signals were much smaller (155Mbps, 2.5Gbps, ... 10Gbps) than the
|
||||
resolution of the OSAs that were used to measure spectral power which
|
||||
were set to 0.1nm resolution for convenience. Moving forward into
|
||||
flexible grid and high baud rate signals, it may be convenient to begin
|
||||
quoting power spectral density in the same BW for both signal and ASE,
|
||||
e.g. 12.5GHz."""
|
||||
|
||||
h_mWThz = 1e-3 * h * (1e14)**2
|
||||
nf_lin = db2lin(nf)
|
||||
g_lin = db2lin(gain)
|
||||
ase = h_mWThz * df * ffs * (nf_lin * g_lin - 1)
|
||||
asedb = lin2db(ase)
|
||||
|
||||
return asedb
|
||||
|
||||
|
||||
def gain_profile(dfg, dgt, Pin, gp, gtp):
|
||||
"""
|
||||
:param dfg: design flat gain
|
||||
:param dgt: design gain tilt
|
||||
:param Pin: channing input power profile
|
||||
:param gp: Average gain setpoint in dB units
|
||||
:param gtp: gain tilt setting
|
||||
:type dfg: numpy.ndarray
|
||||
:type dgt: numpy.ndarray
|
||||
:type Pin: numpy.ndarray
|
||||
:type gp: float
|
||||
:type gtp: float
|
||||
:return: gain profile in dBm
|
||||
:rtype: numpy.ndarray
|
||||
|
||||
AMPLIFICATION USING INPUT PROFILE
|
||||
INPUTS:
|
||||
DFG - vector of length number of channels or spectral slices
|
||||
DGT - vector of length number of channels or spectral slices
|
||||
Pin - input powers vector of length number of channels or
|
||||
spectral slices
|
||||
Gp - provisioned gain length 1
|
||||
GTp - provisioned tilt length 1
|
||||
|
||||
OUTPUT:
|
||||
amp gain per channel or spectral slice
|
||||
NOTE: there is no checking done for violations of the total output power
|
||||
capability of the amp.
|
||||
Ported from Matlab version written by David Boerges at Ciena.
|
||||
Based on:
|
||||
R. di Muro, "The Er3+ fiber gain coefficient derived from a dynamic
|
||||
gain
|
||||
tilt technique", Journal of Lightwave Technology, Vol. 18, Iss. 3,
|
||||
Pp. 343-347, 2000.
|
||||
"""
|
||||
err_tolerance = 1.0e-11
|
||||
simple_opt = True
|
||||
|
||||
# TODO make all values linear unit and convert to dB units as needed within
|
||||
# this function.
|
||||
nchan = list(range(len(Pin)))
|
||||
|
||||
# TODO find a way to use these or lose them. Primarily we should have a
|
||||
# way to determine if exceeding the gain or output power of the amp
|
||||
tot_in_power_db = lin2db(np.sum(db2lin(Pin)))
|
||||
avg_gain_db = lin2db(mean(db2lin(dfg)))
|
||||
|
||||
# Linear fit to get the
|
||||
p = polyfit(nchan, dgt, 1)
|
||||
dgt_slope = p[0]
|
||||
|
||||
# Calculate the target slope- Currently assumes equal spaced channels
|
||||
# TODO make it so that supports arbitrary channel spacing.
|
||||
targ_slope = gtp / (len(nchan) - 1)
|
||||
|
||||
# 1st estimate of DGT scaling
|
||||
dgts1 = targ_slope / dgt_slope
|
||||
|
||||
# when simple_opt is true code makes 2 attempts to compute gain and
|
||||
# the internal voa value. This is currently here to provide direct
|
||||
# comparison with original Matlab code. Will be removed.
|
||||
# TODO replace with loop
|
||||
|
||||
if simple_opt:
|
||||
|
||||
# 1st estimate of Er gain & voa loss
|
||||
g1st = dfg + dgt * dgts1
|
||||
voa = lin2db(mean(db2lin(g1st))) - gp
|
||||
|
||||
# 2nd estimate of Amp ch gain using the channel input profile
|
||||
g2nd = g1st - voa
|
||||
pout_db = lin2db(np.sum(db2lin(Pin + g2nd)))
|
||||
dgts2 = gp - (pout_db - tot_in_power_db)
|
||||
|
||||
# Center estimate of amp ch gain
|
||||
xcent = dgts2
|
||||
gcent = g1st - voa + dgt * xcent
|
||||
pout_db = lin2db(np.sum(db2lin(Pin + gcent)))
|
||||
gavg_cent = pout_db - tot_in_power_db
|
||||
|
||||
# Lower estimate of Amp ch gain
|
||||
deltax = np.max(g1st) - np.min(g1st)
|
||||
xlow = dgts2 - deltax
|
||||
glow = g1st - voa + xlow * dgt
|
||||
pout_db = lin2db(np.sum(db2lin(Pin + glow)))
|
||||
gavg_low = pout_db - tot_in_power_db
|
||||
|
||||
# Upper gain estimate
|
||||
xhigh = dgts2 + deltax
|
||||
ghigh = g1st - voa + xhigh * dgt
|
||||
pout_db = lin2db(np.sum(db2lin(Pin + ghigh)))
|
||||
gavg_high = pout_db - tot_in_power_db
|
||||
|
||||
# compute slope
|
||||
slope1 = (gavg_low - gavg_cent) / (xlow - xcent)
|
||||
slope2 = (gavg_cent - gavg_high) / (xcent - xhigh)
|
||||
|
||||
if np.abs(gp - gavg_cent) <= err_tolerance:
|
||||
dgts3 = xcent
|
||||
elif gp < gavg_cent:
|
||||
dgts3 = xcent - (gavg_cent - gp) / slope1
|
||||
else:
|
||||
dgts3 = xcent + (-gavg_cent + gp) / slope2
|
||||
|
||||
gprofile = g1st - voa + dgt * dgts3
|
||||
else:
|
||||
gprofile = None
|
||||
|
||||
return gprofile
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
plt.close('all')
|
||||
fc = itufs(0.05)
|
||||
lc = freq2wavelength(fc) / 1000
|
||||
nchan = list(range(len(lc)))
|
||||
df = np.array([0.05] * (nchan[-1] + 1))
|
||||
# TODO remove path dependence
|
||||
path = ''
|
||||
|
||||
"""
|
||||
DFG_96: Design flat gain at each wavelength in the 96 channel 50GHz ITU
|
||||
grid in dB. This can be experimentally determined by measuring the gain
|
||||
at each wavelength using a full, flat channel (or ASE) load at the input.
|
||||
The amplifier should be set to its maximum flat gain (tilt = 0dB). This
|
||||
measurement captures the ripple of the amplifier. If the amplifier was
|
||||
designed to be mimimum ripple at some other tilt value, then the ripple
|
||||
reflected in this measurement will not be that minimum. However, when
|
||||
the DGT gets applied through the provisioning of tilt, the model should
|
||||
accurately reproduce the expected ripple at that tilt value. One could
|
||||
also do the measurement at some expected tilt value and back-calculate
|
||||
this vector using the DGT method. Alternatively, one could re-write the
|
||||
algorithm to accept a nominal tilt and a tiled version of this vector.
|
||||
"""
|
||||
|
||||
dfg_96 = np.loadtxt(path + 'DFG_96.txt')
|
||||
|
||||
"""maximum gain for flat operation - the amp in the data file was designed
|
||||
for 25dB gain and has an internal VOA for setting the external gain
|
||||
"""
|
||||
|
||||
avg_dfg = dfg_96.mean()
|
||||
|
||||
"""
|
||||
DGT_96: This is the so-called Dynamic Gain Tilt of the EDFA in dB/dB. It
|
||||
is the change in gain at each wavelength corresponding to a 1dB change at
|
||||
the longest wavelength supported. The value can be obtained
|
||||
experimentally or through analysis of the cross sections or Giles
|
||||
parameters of the Er fibre. This is experimentally measured by changing
|
||||
the gain of the amplifier above the maximum flat gain while not changing
|
||||
the internal VOA (i.e. the mid-stage VOA is set to minimum and does not
|
||||
change during the measurement). Note that the measurement can change the
|
||||
gain by an arbitrary amount and divide by the gain change (in dB) which
|
||||
is measured at the reference wavelength (the red end of the band).
|
||||
"""
|
||||
|
||||
dgt_96 = np.loadtxt(path + 'DGT_96.txt')
|
||||
|
||||
"""
|
||||
pNFfit3: Cubic polynomial fit coefficients to noise figure in dB
|
||||
averaged across wavelength as a function of gain change from design flat:
|
||||
|
||||
NFavg = pNFfit3(1)*dG^3 + pNFfit3(2)*dG^2 pNFfit3(3)*dG + pNFfit3(4)
|
||||
where
|
||||
dG = GainTarget - average(DFG_96)
|
||||
note that dG will normally be a negative value.
|
||||
"""
|
||||
|
||||
nf_fitco = np.loadtxt(path + 'pNFfit3.txt')
|
||||
|
||||
"""NFR_96: Noise figure ripple in dB away from the average noise figure
|
||||
across the band. This captures the wavelength dependence of the NF. To
|
||||
calculate the NF across channels, one uses the cubic fit coefficients
|
||||
with the external gain target to get the average nosie figure, NFavg and
|
||||
then adds this to NFR_96:
|
||||
NF_96 = NFR_96 + NFavg
|
||||
"""
|
||||
|
||||
nf_ripple = np.loadtxt(path + 'NFR_96.txt')
|
||||
|
||||
# This is an example to set the provisionable gain and gain-tilt values
|
||||
# Tilt is in units of dB/THz
|
||||
gain_target = 20.0
|
||||
tilt_target = -0.7
|
||||
|
||||
# calculate the NF for the EDFA at this gain setting
|
||||
dg = gain_target - avg_dfg
|
||||
nf_avg = polyval(nf_fitco, dg)
|
||||
nf_96 = nf_ripple + nf_avg
|
||||
|
||||
# get the input power profiles to show
|
||||
pch2d = np.loadtxt(path + 'Pchan2D.txt')
|
||||
|
||||
# Load legend and assemble legend text
|
||||
pch2d_legend_data = np.loadtxt(path + 'Pchan2DLegend.txt')
|
||||
pch2d_legend = []
|
||||
for ea in pch2d_legend_data:
|
||||
s = ''.join([chr(xx) for xx in ea.astype(dtype=int)]).strip()
|
||||
pch2d_legend.append(s)
|
||||
|
||||
# assemble plot
|
||||
axis_font = {'fontname': 'Arial', 'size': '16', 'fontweight': 'bold'}
|
||||
title_font = {'fontname': 'Arial', 'size': '17', 'fontweight': 'bold'}
|
||||
tic_font = {'fontname': 'Arial', 'size': '12'}
|
||||
|
||||
plt.rcParams["font.family"] = "Arial"
|
||||
plt.figure()
|
||||
plt.plot(nchan, pch2d.T, '.-', lw=2)
|
||||
plt.xlabel('Channel Number', **axis_font)
|
||||
plt.ylabel('Channel Power [dBm]', **axis_font)
|
||||
plt.title('Input Power Profiles for Different Channel Loading',
|
||||
**title_font)
|
||||
plt.legend(pch2d_legend, loc=5)
|
||||
plt.grid()
|
||||
plt.ylim((-100, -10))
|
||||
plt.xlim((0, 110))
|
||||
plt.xticks(np.arange(0, 100, 10), **tic_font)
|
||||
plt.yticks(np.arange(-110, -10, 10), **tic_font)
|
||||
|
||||
plt.figure()
|
||||
ea = pch2d[1, :]
|
||||
for ea in pch2d:
|
||||
chgain = gain_profile(dfg_96, dgt_96, ea, gain_target, tilt_target)
|
||||
pase = noise_profile(nf_96, chgain, fc, df)
|
||||
pout = lin2db(db2lin(ea + chgain) + db2lin(pase))
|
||||
plt.plot(nchan, pout, '.-', lw=2)
|
||||
plt.title('Output Power with ASE for Different Channel Loading',
|
||||
**title_font)
|
||||
plt.xlabel('Channel Number', **axis_font)
|
||||
plt.ylabel('Channel Power [dBm]', **axis_font)
|
||||
plt.grid()
|
||||
plt.ylim((-50, 10))
|
||||
plt.xlim((0, 100))
|
||||
plt.xticks(np.arange(0, 100, 10), **tic_font)
|
||||
plt.yticks(np.arange(-50, 10, 10), **tic_font)
|
||||
plt.legend(pch2d_legend, loc=5)
|
||||
plt.show()
|
||||
@@ -1,164 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Tue Jan 30 12:32:00 2018
|
||||
|
||||
@author: jeanluc-auge
|
||||
@comments about amplifier input files from Brian Taylor & Dave Boertjes
|
||||
|
||||
update an existing json file with all the 96ch txt files for a given amplifier type
|
||||
amplifier type 'OA_type1' is hard coded but can be modified and other types added
|
||||
returns an updated amplifier json file: output_json_file_name = 'edfa_config.json'
|
||||
"""
|
||||
import re
|
||||
import sys
|
||||
import json
|
||||
import numpy as np
|
||||
from gnpy.core.utils import lin2db, db2lin
|
||||
|
||||
"""amplifier file names
|
||||
convert a set of amplifier files + input json definiton file into a valid edfa_json_file:
|
||||
nf_fit_coeff: NF polynomial coefficients txt file (optional)
|
||||
nf_ripple: NF ripple excursion txt file
|
||||
dfg: gain txt file
|
||||
dgt: dynamic gain txt file
|
||||
input json file in argument (defult = 'OA.json')
|
||||
the json input file should have the following fields:
|
||||
{
|
||||
"gain_flatmax": 25,
|
||||
"gain_min": 15,
|
||||
"p_max": 21,
|
||||
"nf_fit_coeff": "pNFfit3.txt",
|
||||
"nf_ripple": "NFR_96.txt",
|
||||
"dfg": "DFG_96.txt",
|
||||
"dgt": "DGT_96.txt",
|
||||
"nf_model":
|
||||
{
|
||||
"enabled": true,
|
||||
"nf_min": 5.8,
|
||||
"nf_max": 10
|
||||
}
|
||||
}
|
||||
gain_flat = max flat gain (dB)
|
||||
gain_min = min gain (dB) : will consider an input VOA if below (TBD vs throwing an exception)
|
||||
p_max = max power (dBm)
|
||||
nf_fit = boolean (True, False) :
|
||||
if False nf_fit_coeff are ignored and nf_model fields are used
|
||||
"""
|
||||
|
||||
input_json_file_name = "OA.json" #default path
|
||||
output_json_file_name = "edfa_config.json"
|
||||
param_field ="params"
|
||||
gain_min_field = "gain_min"
|
||||
gain_max_field = "gain_flatmax"
|
||||
gain_ripple_field = "dfg"
|
||||
nf_ripple_field = "nf_ripple"
|
||||
nf_fit_coeff = "nf_fit_coeff"
|
||||
nf_model_field = "nf_model"
|
||||
nf_model_enabled_field = "enabled"
|
||||
nf_min_field ="nf_min"
|
||||
nf_max_field = "nf_max"
|
||||
|
||||
def read_file(field, file_name):
|
||||
"""read and format the 96 channels txt files describing the amplifier NF and ripple
|
||||
convert dfg into gain ripple by removing the mean component
|
||||
"""
|
||||
|
||||
#with open(path + file_name,'r') as this_file:
|
||||
# data = this_file.read()
|
||||
#data.strip()
|
||||
#data = re.sub(r"([0-9])([ ]{1,3})([0-9-+])",r"\1,\3",data)
|
||||
#data = list(data.split(","))
|
||||
#data = [float(x) for x in data]
|
||||
data = np.loadtxt(file_name)
|
||||
if field == gain_ripple_field or field == nf_ripple_field:
|
||||
#consider ripple excursion only to avoid redundant information
|
||||
#because the max flat_gain is already given by the 'gain_flat' field in json
|
||||
#remove the mean component
|
||||
data = data - data.mean()
|
||||
data = data.tolist()
|
||||
return data
|
||||
|
||||
def nf_model(amp_dict):
|
||||
if amp_dict[nf_model_field][nf_model_enabled_field] == True:
|
||||
gain_min = amp_dict[gain_min_field]
|
||||
gain_max = amp_dict[gain_max_field]
|
||||
nf_min = amp_dict[nf_model_field][nf_min_field]
|
||||
nf_max = amp_dict[nf_model_field][nf_max_field]
|
||||
#use NF estimation model based on NFmin and NFmax in json OA file
|
||||
delta_p = 5 #max power dB difference between 1st and 2nd stage coils
|
||||
#dB g1a = (1st stage gain) - (internal voa attenuation)
|
||||
g1a_min = gain_min - (gain_max-gain_min) - delta_p
|
||||
g1a_max = gain_max - delta_p
|
||||
#nf1 and nf2 are the nf of the 1st and 2nd stage coils
|
||||
#calculate nf1 and nf2 values that solve nf_[min/max] = nf1 + nf2 / g1a[min/max]
|
||||
nf2 = lin2db((db2lin(nf_min) - db2lin(nf_max)) / (1/db2lin(g1a_max)-1/db2lin(g1a_min)))
|
||||
nf1 = lin2db(db2lin(nf_min)- db2lin(nf2)/db2lin(g1a_max)) #expression (1)
|
||||
|
||||
""" now checking and recalculating the results:
|
||||
recalculate delta_p to check it is within [1-6] boundaries
|
||||
This is to check that the nf_min and nf_max values from the json file
|
||||
make sense. If not a warning is printed """
|
||||
if nf1 < 4:
|
||||
print('1st coil nf calculated value {} is too low: revise inputs'.format(nf1))
|
||||
if nf2 < nf1 + 0.3 or nf2 > nf1 + 2:
|
||||
"""nf2 should be with [nf1+0.5 - nf1 +2] boundaries
|
||||
there shouldn't be very high nf differences between 2 coils
|
||||
=> recalculate delta_p
|
||||
"""
|
||||
nf2 = max(nf2, nf1+0.3)
|
||||
nf2 = min(nf2, nf1+2)
|
||||
g1a_max = lin2db(db2lin(nf2) / (db2lin(nf_min) - db2lin(nf1))) #use expression (1)
|
||||
delta_p = gain_max - g1a_max
|
||||
g1a_min = gain_min - (gain_max-gain_min) - delta_p
|
||||
if delta_p < 1 or delta_p > 6:
|
||||
#delta_p should be > 1dB and < 6dB => consider user warning if not
|
||||
print('1st coil vs 2nd coil calculated DeltaP {} is not valid: revise inputs'
|
||||
.format(delta_p))
|
||||
#check the calculated values for nf1 & nf2:
|
||||
nf_min_calc = lin2db(db2lin(nf1) + db2lin(nf2)/db2lin(g1a_max))
|
||||
nf_max_calc = lin2db(db2lin(nf1) + db2lin(nf2)/db2lin(g1a_min))
|
||||
if (abs(nf_min_calc-nf_min) > 0.01) or (abs(nf_max_calc-nf_max) > 0.01):
|
||||
print('nf model calculation failed with nf_min {} and nf_max {} calculated'
|
||||
.format(nf_min_calc, nf_max_calc))
|
||||
print('do not use the generated edfa_config.json file')
|
||||
else :
|
||||
(nf1, nf2, delta_p) = (0, 0, 0)
|
||||
|
||||
return (nf1, nf2, delta_p)
|
||||
|
||||
def input_json(path):
|
||||
"""read the json input file and add all the 96 channels txt files
|
||||
create the output json file with output_json_file_name"""
|
||||
with open(path,'r') as edfa_json_file:
|
||||
amp_text = edfa_json_file.read()
|
||||
amp_dict = json.loads(amp_text)
|
||||
|
||||
for k, v in amp_dict.items():
|
||||
if re.search(r'.txt$',str(v)) :
|
||||
amp_dict[k] = read_file(k, v)
|
||||
|
||||
#calculate nf of 1st and 2nd coil for the nf_model if 'enabled'==true
|
||||
(nf1, nf2, delta_p) = nf_model(amp_dict)
|
||||
#rename nf_min and nf_max in nf1 and nf2 after the nf model calculation:
|
||||
del amp_dict[nf_model_field][nf_min_field]
|
||||
del amp_dict[nf_model_field][nf_max_field]
|
||||
amp_dict[nf_model_field]['nf1'] = nf1
|
||||
amp_dict[nf_model_field]['nf2'] = nf2
|
||||
amp_dict[nf_model_field]['delta_p'] = delta_p
|
||||
#rename dfg into gain_ripple after removing the average part:
|
||||
amp_dict['gain_ripple'] = amp_dict.pop(gain_ripple_field)
|
||||
|
||||
new_amp_dict = {}
|
||||
new_amp_dict[param_field] = amp_dict
|
||||
amp_text = json.dumps(new_amp_dict, indent=4)
|
||||
#print(amp_text)
|
||||
with open(output_json_file_name,'w') as edfa_json_file:
|
||||
edfa_json_file.write(amp_text)
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) == 2:
|
||||
path = sys.argv[1]
|
||||
else:
|
||||
path = input_json_file_name
|
||||
input_json(path)
|
||||
@@ -1,313 +0,0 @@
|
||||
{
|
||||
"params": {
|
||||
"gain_flatmax": 25,
|
||||
"gain_min": 15,
|
||||
"p_max": 21,
|
||||
"nf_fit_coeff": [
|
||||
0.000168241,
|
||||
0.0469961,
|
||||
0.0359549,
|
||||
5.82851
|
||||
],
|
||||
"nf_ripple": [
|
||||
-0.3110761646066259,
|
||||
-0.3110761646066259,
|
||||
-0.31110274831665313,
|
||||
-0.31419329378173544,
|
||||
-0.3172854168606314,
|
||||
-0.32037911876162584,
|
||||
-0.3233255190215882,
|
||||
-0.31624321721895354,
|
||||
-0.30915729645781326,
|
||||
-0.30206775396360075,
|
||||
-0.2949045115165272,
|
||||
-0.26632156113294336,
|
||||
-0.23772399031437283,
|
||||
-0.20911178784023846,
|
||||
-0.18048410390821285,
|
||||
-0.14379944379052215,
|
||||
-0.10709599992470213,
|
||||
-0.07037375788020579,
|
||||
-0.03372858157230583,
|
||||
-0.015660302006048,
|
||||
0.0024172385953583004,
|
||||
0.020504047353947653,
|
||||
0.03860013139908377,
|
||||
0.05670549786742816,
|
||||
0.07482015390297145,
|
||||
0.0838762040768461,
|
||||
0.09284481475528361,
|
||||
0.1018180306253394,
|
||||
0.11079585523492333,
|
||||
0.1020395478432815,
|
||||
0.09310160456603413,
|
||||
0.08415906712621996,
|
||||
0.07521193198077789,
|
||||
0.0676340601339394,
|
||||
0.06005437964543287,
|
||||
0.052470799141237305,
|
||||
0.044883315610536455,
|
||||
0.037679759069084225,
|
||||
0.03047647598902483,
|
||||
0.02326948274513522,
|
||||
0.01605877647020772,
|
||||
0.021248462316134083,
|
||||
0.02657315875107553,
|
||||
0.03190060058247842,
|
||||
0.03723078993416436,
|
||||
0.04256372893215024,
|
||||
0.047899419704645264,
|
||||
0.03915515813685565,
|
||||
0.030289222542492025,
|
||||
0.021418708618354456,
|
||||
0.012573926129294415,
|
||||
0.006240488799898697,
|
||||
-9.622162373026585e-05,
|
||||
-0.006436207679519103,
|
||||
-0.012779471908040341,
|
||||
-0.02038153550619876,
|
||||
-0.027999803010447587,
|
||||
-0.035622012697103154,
|
||||
-0.043236398934156144,
|
||||
-0.04493583574805963,
|
||||
-0.04663615264317309,
|
||||
-0.048337350303318156,
|
||||
-0.050039429413028365,
|
||||
-0.051742390657545205,
|
||||
-0.05342028484370278,
|
||||
-0.05254242298580185,
|
||||
-0.05166410580536087,
|
||||
-0.05078533294804249,
|
||||
-0.04990610405914272,
|
||||
-0.05409792133358102,
|
||||
-0.05832916277634124,
|
||||
-0.06256260169582961,
|
||||
-0.06660356886269536,
|
||||
-0.04779792991567815,
|
||||
-0.028982516728038848,
|
||||
-0.010157321677553965,
|
||||
0.00861320615127981,
|
||||
0.01913736978785662,
|
||||
0.029667009055877668,
|
||||
0.04020212822983975,
|
||||
0.050742731588695494,
|
||||
0.061288823415841555,
|
||||
0.07184040799914815,
|
||||
0.1043252636301016,
|
||||
0.13687829834471027,
|
||||
0.1694483010211072,
|
||||
0.202035284929368,
|
||||
0.23624619427167134,
|
||||
0.27048596623174515,
|
||||
0.30474360397422756,
|
||||
0.3390191214858807,
|
||||
0.36358851509924695,
|
||||
0.38814205928193013,
|
||||
0.41270842850729195,
|
||||
0.4372876328262819,
|
||||
0.4372876328262819
|
||||
],
|
||||
"dgt": [
|
||||
2.714526681131686,
|
||||
2.705443819238505,
|
||||
2.6947834587664494,
|
||||
2.6841217449620203,
|
||||
2.6681935771243177,
|
||||
2.6521732021128046,
|
||||
2.630396440815385,
|
||||
2.602860350286428,
|
||||
2.5696460593920065,
|
||||
2.5364027376452056,
|
||||
2.499446286796604,
|
||||
2.4587748041127506,
|
||||
2.414398437185221,
|
||||
2.3699990328716107,
|
||||
2.322373696229342,
|
||||
2.271520771371253,
|
||||
2.2174389328192197,
|
||||
2.16337565384239,
|
||||
2.1183028432496016,
|
||||
2.082225099873648,
|
||||
2.055100772005235,
|
||||
2.0279625371819305,
|
||||
2.0008103857988204,
|
||||
1.9736443063300082,
|
||||
1.9482128147680253,
|
||||
1.9245345552113182,
|
||||
1.9026104247588487,
|
||||
1.8806927939516411,
|
||||
1.862235672444246,
|
||||
1.847275503201129,
|
||||
1.835814081380705,
|
||||
1.824381436842932,
|
||||
1.8139629377087627,
|
||||
1.8045606557581335,
|
||||
1.7961751115773796,
|
||||
1.7877868031023945,
|
||||
1.7793941781790852,
|
||||
1.7709972329654864,
|
||||
1.7625959636196327,
|
||||
1.7541903672600494,
|
||||
1.7459181197626403,
|
||||
1.737780757913635,
|
||||
1.7297783508684146,
|
||||
1.7217732861435076,
|
||||
1.7137640932265894,
|
||||
1.7057507692361864,
|
||||
1.6918150918099673,
|
||||
1.6719047669939942,
|
||||
1.6460167077689267,
|
||||
1.6201194134191075,
|
||||
1.5986915141218316,
|
||||
1.5817353179379183,
|
||||
1.569199764184379,
|
||||
1.5566577309558969,
|
||||
1.545374152761467,
|
||||
1.5353620432989845,
|
||||
1.5266220576235803,
|
||||
1.5178910621476225,
|
||||
1.5097346239790443,
|
||||
1.502153039909686,
|
||||
1.495145456062699,
|
||||
1.488134243479226,
|
||||
1.48111939735681,
|
||||
1.474100442252211,
|
||||
1.4670307626366115,
|
||||
1.4599103316162523,
|
||||
1.45273959485914,
|
||||
1.445565137158368,
|
||||
1.4340878115214444,
|
||||
1.418273806730323,
|
||||
1.3981208704326855,
|
||||
1.3779439775587023,
|
||||
1.3598972673004606,
|
||||
1.3439818461440451,
|
||||
1.3301807335621048,
|
||||
1.316383926863083,
|
||||
1.3040618749785347,
|
||||
1.2932153453410835,
|
||||
1.2838336236692311,
|
||||
1.2744470198196236,
|
||||
1.2650555289898042,
|
||||
1.2556591482982988,
|
||||
1.2428104897182262,
|
||||
1.2264996957264114,
|
||||
1.2067249615595257,
|
||||
1.1869318618366975,
|
||||
1.1672278304018044,
|
||||
1.1476135933863398,
|
||||
1.1280891949729075,
|
||||
1.108555289615659,
|
||||
1.0895983485572227,
|
||||
1.0712204022764056,
|
||||
1.0534217504465226,
|
||||
1.0356155337864215,
|
||||
1.017807767853702,
|
||||
1.0
|
||||
],
|
||||
"nf_model": {
|
||||
"enabled": true,
|
||||
"nf1": 5.727887800964238,
|
||||
"nf2": 7.727887800964238,
|
||||
"delta_p": 5.238350271545567
|
||||
},
|
||||
"gain_ripple": [
|
||||
0.1359703369791596,
|
||||
0.11822862697916037,
|
||||
0.09542181697916163,
|
||||
0.06245819697916133,
|
||||
0.02602813697916062,
|
||||
-0.0036199830208403228,
|
||||
-0.018326963020840026,
|
||||
-0.0246928330208398,
|
||||
-0.016792253020838643,
|
||||
-0.0028138630208403015,
|
||||
0.017572956979162058,
|
||||
0.038328296979159404,
|
||||
0.054956336979159914,
|
||||
0.0670723869791594,
|
||||
0.07091459697916136,
|
||||
0.07094413697916124,
|
||||
0.07114372697916238,
|
||||
0.07533675697916209,
|
||||
0.08731066697916035,
|
||||
0.10313984697916112,
|
||||
0.12276252697916235,
|
||||
0.14239527697916188,
|
||||
0.15945681697916214,
|
||||
0.1739275269791598,
|
||||
0.1767381569791624,
|
||||
0.17037189697916233,
|
||||
0.15216302697916007,
|
||||
0.13114358697916018,
|
||||
0.10802383697916085,
|
||||
0.08548825697916129,
|
||||
0.06916723697916183,
|
||||
0.05848224697916038,
|
||||
0.05447361697916264,
|
||||
0.05154489697916276,
|
||||
0.04946107697915991,
|
||||
0.04717897697916129,
|
||||
0.04551704697916037,
|
||||
0.04467697697916151,
|
||||
0.04072968697916224,
|
||||
0.03285456697916089,
|
||||
0.023488786979161347,
|
||||
0.01659282697915998,
|
||||
0.013321846979160057,
|
||||
0.011234826979162449,
|
||||
0.01030063697916006,
|
||||
0.00936596697916059,
|
||||
0.00874012697916271,
|
||||
0.00842583697916055,
|
||||
0.006965146979162284,
|
||||
0.0040435869791615175,
|
||||
0.0007104669791608842,
|
||||
-0.0015763130208377163,
|
||||
-0.006936193020838033,
|
||||
-0.016475303020840215,
|
||||
-0.028748483020837767,
|
||||
-0.039618433020837784,
|
||||
-0.051112303020840244,
|
||||
-0.06468462302083822,
|
||||
-0.07868024302083754,
|
||||
-0.09101254302083817,
|
||||
-0.10103437302083762,
|
||||
-0.11041488302083735,
|
||||
-0.11916081302083725,
|
||||
-0.12789859302083784,
|
||||
-0.1353792530208402,
|
||||
-0.14160178302083892,
|
||||
-0.1455411330208385,
|
||||
-0.1484450830208388,
|
||||
-0.14823350302084037,
|
||||
-0.14591937302083835,
|
||||
-0.1409032730208395,
|
||||
-0.13525493302083902,
|
||||
-0.1279646530208396,
|
||||
-0.11963431302083904,
|
||||
-0.11089282302084058,
|
||||
-0.1027863830208382,
|
||||
-0.09717347302083823,
|
||||
-0.09343261302083761,
|
||||
-0.0913487130208388,
|
||||
-0.08906007302083907,
|
||||
-0.0865687230208394,
|
||||
-0.08407607302083875,
|
||||
-0.07844600302084004,
|
||||
-0.06968090302083851,
|
||||
-0.05947139302083926,
|
||||
-0.05095282302083959,
|
||||
-0.042428283020839785,
|
||||
-0.03218106302083967,
|
||||
-0.01819858302084043,
|
||||
-0.0021726530208390216,
|
||||
0.01393231697916164,
|
||||
0.028098946979159933,
|
||||
0.040326236979161934,
|
||||
0.05257029697916238,
|
||||
0.06479749697916048,
|
||||
0.07704745697916238
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
#!/usr/bin/env
|
||||
"""
|
||||
@author: briantaylor
|
||||
@author: giladgoldfarb
|
||||
@author: jeanluc-auge
|
||||
|
||||
Transmission setup example:
|
||||
reads from network json (default = examples/edfa/edfa_example_network.json)
|
||||
propagates a 96 channels comb
|
||||
"""
|
||||
from argparse import ArgumentParser
|
||||
from json import load
|
||||
from sys import exit
|
||||
from pathlib import Path
|
||||
from logging import getLogger, basicConfig, INFO, ERROR, DEBUG
|
||||
|
||||
from matplotlib.pyplot import show, axis, figure, title
|
||||
from networkx import (draw_networkx_nodes, draw_networkx_edges,
|
||||
draw_networkx_labels, dijkstra_path)
|
||||
|
||||
from gnpy.core import network_from_json, build_network
|
||||
from gnpy.core.elements import Transceiver, Fiber, Edfa
|
||||
from gnpy.core.info import SpectralInformation, Channel, Power
|
||||
#from gnpy.core.algorithms import closed_paths
|
||||
|
||||
logger = getLogger(__package__ or __file__)
|
||||
|
||||
def format_si(spectral_infos):
|
||||
return '\n'.join([
|
||||
f'#{idx} Carrier(frequency={c.frequency},\n power=Power(signal={c.power.signal}, nli={c.power.nli}, ase={c.power.ase}))'
|
||||
for idx, si in sorted(set(spectral_infos))
|
||||
for c in set(si.carriers)
|
||||
])
|
||||
|
||||
logger = getLogger('gnpy.core')
|
||||
|
||||
def main(args):
|
||||
with open(args.filename) as f:
|
||||
json_data = load(f)
|
||||
|
||||
network = network_from_json(json_data)
|
||||
build_network(network)
|
||||
|
||||
spacing = 0.05 #THz
|
||||
si = SpectralInformation() # !! SI units W, Hz
|
||||
si = si.update(carriers=tuple(Channel(f, (191.3+spacing*f)*1e12,
|
||||
32e9, 0.15, Power(1e-3, 0, 0)) for f in range(1,97)))
|
||||
|
||||
trx = [n for n in network.nodes() if isinstance(n, Transceiver)]
|
||||
source, sink = trx[0], trx[1]
|
||||
|
||||
path = dijkstra_path(network, source, sink)
|
||||
print(f'There are {len(path)} network elements between {source} and {sink}')
|
||||
|
||||
for el in path:
|
||||
si = el(si)
|
||||
print(el)
|
||||
|
||||
nodelist = [n for n in network.nodes() if isinstance(n, (Transceiver, Fiber))]
|
||||
pathnodes = [n for n in path if isinstance(n, (Transceiver, Fiber))]
|
||||
edgelist = [(u, v) for u, v in zip(pathnodes, pathnodes[1:])]
|
||||
node_color = ['#ff0000' if n is source or n is sink else
|
||||
'#900000' if n in path else '#ffdfdf'
|
||||
for n in nodelist]
|
||||
edge_color = ['#ff9090' if u in path and v in path else '#ababab'
|
||||
for u, v in edgelist]
|
||||
labels = {n: n.location.city if isinstance(n, Transceiver) else ''
|
||||
for n in pathnodes}
|
||||
|
||||
fig = figure()
|
||||
pos = {n: (n.lng, n.lat) for n in nodelist}
|
||||
kwargs = {'figure': fig, 'pos': pos}
|
||||
plot = draw_networkx_nodes(network, nodelist=nodelist, node_color=node_color, **kwargs)
|
||||
draw_networkx_edges(network, edgelist=edgelist, edge_color=edge_color, **kwargs)
|
||||
draw_networkx_labels(network, labels=labels, font_size=14, **kwargs)
|
||||
title(f'Propagating from {source.loc.city} to {sink.loc.city}')
|
||||
axis('off')
|
||||
show()
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('filename', nargs='?', type=Path,
|
||||
default= Path(__file__).parent / 'edfa/edfa_example_network.json')
|
||||
parser.add_argument('-v', '--verbose', action='count')
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = parser.parse_args()
|
||||
level = {1: INFO, 2: DEBUG}.get(args.verbose, ERROR)
|
||||
logger.setLevel(level)
|
||||
basicConfig()
|
||||
exit(main(args))
|
||||
@@ -0,0 +1,8 @@
|
||||
"""
|
||||
GNPy is an open-source, community-developed library for building route planning and optimization tools in real-world mesh optical networks. It is based on the Gaussian Noise Model.
|
||||
|
||||
Signal propagation is implemented in :py:mod:`.core`.
|
||||
Path finding and spectrum assignment is in :py:mod:`.topology`.
|
||||
Various tools and auxiliary code, including the JSON I/O handling, is in
|
||||
:py:mod:`.tools`.
|
||||
"""
|
||||
|
||||
@@ -1,30 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
########################################################################
|
||||
# _____ ___ ____ ____ ____ _____ #
|
||||
# |_ _|_ _| _ \ | _ \/ ___|| ____| #
|
||||
# | | | || |_) | | |_) \___ \| _| #
|
||||
# | | | || __/ | __/ ___) | |___ #
|
||||
# |_| |___|_| |_| |____/|_____| #
|
||||
# #
|
||||
# == Physical Simulation Environment == #
|
||||
# #
|
||||
########################################################################
|
||||
"""
|
||||
Simulation of signal propagation in the DWDM network
|
||||
|
||||
|
||||
'''
|
||||
gnpy route planning and optimization library
|
||||
============================================
|
||||
|
||||
gnpy is a route planning and optimization library, written in Python, for
|
||||
operators of large-scale mesh optical networks.
|
||||
|
||||
:copyright: © 2018, Telecom Infra Project
|
||||
:license: BSD 3-Clause, see LICENSE for more details.
|
||||
'''
|
||||
|
||||
|
||||
from . import elements
|
||||
from .execute import *
|
||||
from .network import *
|
||||
from .utils import *
|
||||
Optical signals, as defined via :class:`.info.SpectralInformation`, enter
|
||||
:py:mod:`.elements` which compute how these signals are affected as they travel
|
||||
through the :py:mod:`.network`.
|
||||
The simulation is controlled via :py:mod:`.parameters` and implemented mainly
|
||||
via :py:mod:`.science_utils`.
|
||||
"""
|
||||
|
||||
15
gnpy/core/ansi_escapes.py
Normal file
15
gnpy/core/ansi_escapes.py
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
gnpy.core.ansi_escapes
|
||||
======================
|
||||
|
||||
A random subset of ANSI terminal escape codes for colored messages
|
||||
"""
|
||||
|
||||
red = '\x1b[1;31;40m'
|
||||
blue = '\x1b[1;34;40m'
|
||||
cyan = '\x1b[1;36;40m'
|
||||
yellow = '\x1b[1;33;40m'
|
||||
reset = '\x1b[0m'
|
||||
File diff suppressed because it is too large
Load Diff
82
gnpy/core/equipment.py
Normal file
82
gnpy/core/equipment.py
Normal file
@@ -0,0 +1,82 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
gnpy.core.equipment
|
||||
===================
|
||||
|
||||
This module contains functionality for specifying equipment.
|
||||
"""
|
||||
|
||||
from gnpy.core.exceptions import EquipmentConfigError
|
||||
|
||||
|
||||
def trx_mode_params(equipment, trx_type_variety='', trx_mode='', error_message=False):
|
||||
"""return the trx and SI parameters from eqpt_config for a given type_variety and mode (ie format)
|
||||
|
||||
if the type or mode do no match an existing transceiver in the library, then the function
|
||||
raises an error if error_message is True else returns a default mode based on equipment['SI']['default']
|
||||
If trx_mode is None (but type is valid), it returns an undetermined mode whatever the error message:
|
||||
this is a special case for automatic mode selection.
|
||||
"""
|
||||
trx_params = {}
|
||||
default_si_data = equipment['SI']['default']
|
||||
# default transponder characteristics
|
||||
# mainly used with transmission_main_example.py
|
||||
default_trx_params = {
|
||||
'f_min': default_si_data.f_min,
|
||||
'f_max': default_si_data.f_max,
|
||||
'baud_rate': default_si_data.baud_rate,
|
||||
'spacing': default_si_data.spacing,
|
||||
'OSNR': None,
|
||||
'penalties': {},
|
||||
'bit_rate': None,
|
||||
'cost': None,
|
||||
'roll_off': default_si_data.roll_off,
|
||||
'tx_osnr': default_si_data.tx_osnr,
|
||||
'min_spacing': None,
|
||||
'equalization_offset_db': 0
|
||||
}
|
||||
# Undetermined transponder characteristics
|
||||
# mainly used with path_request_run.py for the automatic mode computation case
|
||||
undetermined_trx_params = {
|
||||
"format": "undetermined",
|
||||
"baud_rate": None,
|
||||
"OSNR": None,
|
||||
"penalties": None,
|
||||
"bit_rate": None,
|
||||
"roll_off": None,
|
||||
"tx_osnr": None,
|
||||
"min_spacing": None,
|
||||
"cost": None,
|
||||
"equalization_offset_db": 0
|
||||
}
|
||||
|
||||
trxs = equipment['Transceiver']
|
||||
if trx_type_variety in trxs:
|
||||
modes = {mode['format']: mode for mode in trxs[trx_type_variety].mode}
|
||||
trx_frequencies = {'f_min': trxs[trx_type_variety].frequency['min'],
|
||||
'f_max': trxs[trx_type_variety].frequency['max']}
|
||||
if trx_mode in modes:
|
||||
# if called from transmission_main.py, trx_mode is ''
|
||||
trx_params = {**modes[trx_mode], **trx_frequencies}
|
||||
if trx_params['baud_rate'] > trx_params['min_spacing']:
|
||||
# sanity check: baudrate must be smaller than min spacing
|
||||
raise EquipmentConfigError(f'Inconsistency in equipment library:\n Transponder "{trx_type_variety}" '
|
||||
+ f'mode "{trx_params["format"]}" has baud rate '
|
||||
+ f'{trx_params["baud_rate"] * 1e-9:.2f} GHz greater than min_spacing '
|
||||
+ f'{trx_params["min_spacing"] * 1e-9:.2f}.')
|
||||
trx_params['equalization_offset_db'] = trx_params.get('equalization_offset_db', 0)
|
||||
return trx_params
|
||||
if trx_mode is None:
|
||||
# if called from path_requests_run.py, trx_mode is filled with None when not specified by user
|
||||
trx_params = {**undetermined_trx_params, **trx_frequencies}
|
||||
return trx_params
|
||||
if trx_type_variety in trxs and error_message:
|
||||
raise EquipmentConfigError(f'Could not find transponder "{trx_type_variety}" with mode "{trx_mode}" '
|
||||
+ 'in equipment library')
|
||||
if error_message:
|
||||
raise EquipmentConfigError(f'Could not find transponder "{trx_type_variety}" in equipment library')
|
||||
|
||||
trx_params = {**default_trx_params}
|
||||
return trx_params
|
||||
37
gnpy/core/exceptions.py
Normal file
37
gnpy/core/exceptions.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
gnpy.core.exceptions
|
||||
====================
|
||||
|
||||
Exceptions thrown by other gnpy modules
|
||||
"""
|
||||
|
||||
|
||||
class ConfigurationError(Exception):
|
||||
"""User-provided configuration contains an error"""
|
||||
|
||||
|
||||
class EquipmentConfigError(ConfigurationError):
|
||||
"""Incomplete or wrong configuration within the equipment library"""
|
||||
|
||||
|
||||
class NetworkTopologyError(ConfigurationError):
|
||||
"""Topology of user-provided network is wrong"""
|
||||
|
||||
|
||||
class ServiceError(Exception):
|
||||
"""Service of user-provided request is wrong"""
|
||||
|
||||
|
||||
class DisjunctionError(ServiceError):
|
||||
"""Disjunction of user-provided request can not be satisfied"""
|
||||
|
||||
|
||||
class SpectrumError(Exception):
|
||||
"""Spectrum errors of the program"""
|
||||
|
||||
|
||||
class ParametersError(ConfigurationError):
|
||||
"""Incomplete or wrong configurations within parameters json"""
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
'''
|
||||
gnpy.core.execute
|
||||
=================
|
||||
|
||||
This module contains functions for executing the propogation of
|
||||
spectral information on a `gnpy` network.
|
||||
'''
|
||||
@@ -1,65 +1,378 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
'''
|
||||
"""
|
||||
gnpy.core.info
|
||||
==============
|
||||
|
||||
This module contains classes for modelling SpectralInformation.
|
||||
'''
|
||||
|
||||
This module contains classes for modelling :class:`SpectralInformation`.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from collections import namedtuple
|
||||
from collections.abc import Iterable
|
||||
from typing import Union
|
||||
from dataclasses import dataclass
|
||||
from numpy import argsort, mean, array, append, ones, ceil, any, zeros, outer, full, ndarray, asarray
|
||||
|
||||
from gnpy.core.utils import automatic_nch, db2lin, watt2dbm
|
||||
from gnpy.core.exceptions import SpectrumError
|
||||
|
||||
DEFAULT_SLOT_WIDTH_STEP = 12.5e9 # Hz
|
||||
"""Channels with unspecified slot width will have their slot width evaluated as the baud rate rounded up to the minimum
|
||||
multiple of the DEFAULT_SLOT_WIDTH_STEP (the baud rate is extended including the roll off in this evaluation)"""
|
||||
|
||||
|
||||
class ConvenienceAccess:
|
||||
|
||||
def __init_subclass__(cls):
|
||||
for abbrev, field in getattr(cls, '_ABBREVS', {}).items():
|
||||
setattr(cls, abbrev, property(lambda self, f=field: getattr(self, f)))
|
||||
|
||||
def update(self, **kwargs):
|
||||
for abbrev, field in getattr(self, '_ABBREVS', {}).items():
|
||||
if abbrev in kwargs:
|
||||
kwargs[field] = kwargs.pop(abbrev)
|
||||
return self._replace(**kwargs)
|
||||
class Power(namedtuple('Power', 'signal nli ase')):
|
||||
"""carriers power in W"""
|
||||
|
||||
|
||||
class Power(namedtuple('Power', 'signal nonlinear_interference amplified_spontaneous_emission'), ConvenienceAccess):
|
||||
class Channel(
|
||||
namedtuple('Channel',
|
||||
'channel_number frequency baud_rate slot_width roll_off power chromatic_dispersion pmd pdl latency')):
|
||||
"""Class containing the parameters of a WDM signal.
|
||||
|
||||
_ABBREVS = {'nli': 'nonlinear_interference',
|
||||
'ase': 'amplified_spontaneous_emission',}
|
||||
:param channel_number: channel number in the WDM grid
|
||||
:param frequency: central frequency of the signal (Hz)
|
||||
:param baud_rate: the symbol rate of the signal (Baud)
|
||||
:param slot_width: the slot width (Hz)
|
||||
:param roll_off: the roll off of the signal. It is a pure number between 0 and 1
|
||||
:param power (gnpy.core.info.Power): power of signal, ASE noise and NLI (W)
|
||||
:param chromatic_dispersion: chromatic dispersion (s/m)
|
||||
:param pmd: polarization mode dispersion (s)
|
||||
:param pdl: polarization dependent loss (dB)
|
||||
:param latency: propagation latency (s)
|
||||
"""
|
||||
|
||||
|
||||
class Channel(namedtuple('Channel', 'channel_number frequency baud_rate roll_off power'), ConvenienceAccess):
|
||||
class SpectralInformation(object):
|
||||
"""Class containing the parameters of the entire WDM comb.
|
||||
|
||||
_ABBREVS = {'channel': 'channel_number',
|
||||
'num_chan': 'channel_number',
|
||||
'ffs': 'frequency',
|
||||
'freq': 'frequency',}
|
||||
delta_pdb_per_channel: (per frequency) per channel delta power in dbm for the actual mix of channels"""
|
||||
|
||||
def __init__(self, frequency: array, baud_rate: array, slot_width: array, signal: array, nli: array, ase: array,
|
||||
roll_off: array, chromatic_dispersion: array, pmd: array, pdl: array, latency: array,
|
||||
delta_pdb_per_channel: array, tx_osnr: array, tx_power: array, label: array):
|
||||
indices = argsort(frequency)
|
||||
self._frequency = frequency[indices]
|
||||
self._df = outer(ones(frequency.shape), frequency) - outer(frequency, ones(frequency.shape))
|
||||
self._number_of_channels = len(self._frequency)
|
||||
self._channel_number = [*range(1, self._number_of_channels + 1)]
|
||||
self._slot_width = slot_width[indices]
|
||||
self._baud_rate = baud_rate[indices]
|
||||
overlap = self._frequency[:-1] + self._slot_width[:-1] / 2 > self._frequency[1:] - self._slot_width[1:] / 2
|
||||
if any(overlap):
|
||||
overlap = [pair for pair in zip(overlap * self._channel_number[:-1], overlap * self._channel_number[1:])
|
||||
if pair != (0, 0)]
|
||||
raise SpectrumError(f'Spectrum required slot widths larger than the frequency spectral distances '
|
||||
f'between channels: {overlap}.')
|
||||
exceed = self._baud_rate > self._slot_width
|
||||
if any(exceed):
|
||||
raise SpectrumError(f'Spectrum baud rate, including the roll off, larger than the slot width for channels: '
|
||||
f'{[ch for ch in exceed * self._channel_number if ch]}.')
|
||||
self._signal = signal[indices]
|
||||
self._nli = nli[indices]
|
||||
self._ase = ase[indices]
|
||||
self._roll_off = roll_off[indices]
|
||||
self._chromatic_dispersion = chromatic_dispersion[indices]
|
||||
self._pmd = pmd[indices]
|
||||
self._pdl = pdl[indices]
|
||||
self._latency = latency[indices]
|
||||
self._delta_pdb_per_channel = delta_pdb_per_channel[indices]
|
||||
self._tx_osnr = tx_osnr[indices]
|
||||
self._tx_power = tx_power[indices]
|
||||
self._label = label[indices]
|
||||
|
||||
@property
|
||||
def frequency(self):
|
||||
return self._frequency
|
||||
|
||||
@property
|
||||
def df(self):
|
||||
"""Matrix of relative frequency distances between all channels. Positive elements in the upper right side."""
|
||||
return self._df
|
||||
|
||||
@property
|
||||
def slot_width(self):
|
||||
return self._slot_width
|
||||
|
||||
@property
|
||||
def baud_rate(self):
|
||||
return self._baud_rate
|
||||
|
||||
@property
|
||||
def number_of_channels(self):
|
||||
return self._number_of_channels
|
||||
|
||||
@property
|
||||
def powers(self):
|
||||
powers = zip(self.signal, self.nli, self.ase)
|
||||
return [Power(*p) for p in powers]
|
||||
|
||||
@property
|
||||
def signal(self):
|
||||
return self._signal
|
||||
|
||||
@signal.setter
|
||||
def signal(self, signal):
|
||||
self._signal = signal
|
||||
|
||||
@property
|
||||
def nli(self):
|
||||
return self._nli
|
||||
|
||||
@nli.setter
|
||||
def nli(self, nli):
|
||||
self._nli = nli
|
||||
|
||||
@property
|
||||
def ase(self):
|
||||
return self._ase
|
||||
|
||||
@ase.setter
|
||||
def ase(self, ase):
|
||||
self._ase = ase
|
||||
|
||||
@property
|
||||
def roll_off(self):
|
||||
return self._roll_off
|
||||
|
||||
@property
|
||||
def chromatic_dispersion(self):
|
||||
return self._chromatic_dispersion
|
||||
|
||||
@chromatic_dispersion.setter
|
||||
def chromatic_dispersion(self, chromatic_dispersion):
|
||||
self._chromatic_dispersion = chromatic_dispersion
|
||||
|
||||
@property
|
||||
def pmd(self):
|
||||
return self._pmd
|
||||
|
||||
@property
|
||||
def label(self):
|
||||
return self._label
|
||||
|
||||
@pmd.setter
|
||||
def pmd(self, pmd):
|
||||
self._pmd = pmd
|
||||
|
||||
@property
|
||||
def pdl(self):
|
||||
return self._pdl
|
||||
|
||||
@pdl.setter
|
||||
def pdl(self, pdl):
|
||||
self._pdl = pdl
|
||||
|
||||
@property
|
||||
def latency(self):
|
||||
return self._latency
|
||||
|
||||
@latency.setter
|
||||
def latency(self, latency):
|
||||
self._latency = latency
|
||||
|
||||
@property
|
||||
def delta_pdb_per_channel(self):
|
||||
return self._delta_pdb_per_channel
|
||||
|
||||
@delta_pdb_per_channel.setter
|
||||
def delta_pdb_per_channel(self, delta_pdb_per_channel):
|
||||
self._delta_pdb_per_channel = delta_pdb_per_channel
|
||||
|
||||
@property
|
||||
def tx_osnr(self):
|
||||
return self._tx_osnr
|
||||
|
||||
@tx_osnr.setter
|
||||
def tx_osnr(self, tx_osnr):
|
||||
self._tx_osnr = tx_osnr
|
||||
|
||||
@property
|
||||
def tx_power(self):
|
||||
return self._tx_power
|
||||
|
||||
@tx_power.setter
|
||||
def tx_power(self, tx_power):
|
||||
self._tx_power = tx_power
|
||||
|
||||
@property
|
||||
def channel_number(self):
|
||||
return self._channel_number
|
||||
|
||||
@property
|
||||
def carriers(self):
|
||||
entries = zip(self.channel_number, self.frequency, self.baud_rate, self.slot_width,
|
||||
self.roll_off, self.powers, self.chromatic_dispersion, self.pmd, self.pdl, self.latency)
|
||||
return [Channel(*entry) for entry in entries]
|
||||
|
||||
def apply_attenuation_lin(self, attenuation_lin):
|
||||
self.signal *= attenuation_lin
|
||||
self.nli *= attenuation_lin
|
||||
self.ase *= attenuation_lin
|
||||
|
||||
def apply_attenuation_db(self, attenuation_db):
|
||||
attenuation_lin = 1 / db2lin(attenuation_db)
|
||||
self.apply_attenuation_lin(attenuation_lin)
|
||||
|
||||
def apply_gain_lin(self, gain_lin):
|
||||
self.signal *= gain_lin
|
||||
self.nli *= gain_lin
|
||||
self.ase *= gain_lin
|
||||
|
||||
def apply_gain_db(self, gain_db):
|
||||
gain_lin = db2lin(gain_db)
|
||||
self.apply_gain_lin(gain_lin)
|
||||
|
||||
def __add__(self, other: SpectralInformation):
|
||||
try:
|
||||
return SpectralInformation(frequency=append(self.frequency, other.frequency),
|
||||
slot_width=append(self.slot_width, other.slot_width),
|
||||
signal=append(self.signal, other.signal), nli=append(self.nli, other.nli),
|
||||
ase=append(self.ase, other.ase),
|
||||
baud_rate=append(self.baud_rate, other.baud_rate),
|
||||
roll_off=append(self.roll_off, other.roll_off),
|
||||
chromatic_dispersion=append(self.chromatic_dispersion,
|
||||
other.chromatic_dispersion),
|
||||
pmd=append(self.pmd, other.pmd),
|
||||
pdl=append(self.pdl, other.pdl),
|
||||
latency=append(self.latency, other.latency),
|
||||
delta_pdb_per_channel=append(self.delta_pdb_per_channel,
|
||||
other.delta_pdb_per_channel),
|
||||
tx_osnr=append(self.tx_osnr, other.tx_osnr),
|
||||
tx_power=append(self.tx_power, other.tx_power),
|
||||
label=append(self.label, other.label))
|
||||
except SpectrumError:
|
||||
raise SpectrumError('Spectra cannot be summed: channels overlapping.')
|
||||
|
||||
def _replace(self, carriers):
|
||||
self.chromatic_dispersion = array([c.chromatic_dispersion for c in carriers])
|
||||
self.pmd = array([c.pmd for c in carriers])
|
||||
self.pdl = array([c.pdl for c in carriers])
|
||||
self.latency = array([c.latency for c in carriers])
|
||||
self.signal = array([c.power.signal for c in carriers])
|
||||
self.nli = array([c.power.nli for c in carriers])
|
||||
self.ase = array([c.power.ase for c in carriers])
|
||||
return self
|
||||
|
||||
|
||||
class SpectralInformation(namedtuple('SpectralInformation', 'carriers'), ConvenienceAccess):
|
||||
|
||||
def __new__(cls, *carriers):
|
||||
return super().__new__(cls, carriers)
|
||||
def create_arbitrary_spectral_information(frequency: Union[ndarray, Iterable, float],
|
||||
signal: Union[float, ndarray, Iterable],
|
||||
baud_rate: Union[float, ndarray, Iterable],
|
||||
tx_osnr: Union[float, ndarray, Iterable],
|
||||
tx_power: Union[float, ndarray, Iterable] = None,
|
||||
delta_pdb_per_channel: Union[float, ndarray, Iterable] = 0.,
|
||||
slot_width: Union[float, ndarray, Iterable] = None,
|
||||
roll_off: Union[float, ndarray, Iterable] = 0.,
|
||||
chromatic_dispersion: Union[float, ndarray, Iterable] = 0.,
|
||||
pmd: Union[float, ndarray, Iterable] = 0.,
|
||||
pdl: Union[float, ndarray, Iterable] = 0.,
|
||||
latency: Union[float, ndarray, Iterable] = 0.,
|
||||
label: Union[str, ndarray, Iterable] = None):
|
||||
"""This is just a wrapper around the SpectralInformation.__init__() that simplifies the creation of
|
||||
a non-uniform spectral information with NLI and ASE powers set to zero."""
|
||||
frequency = asarray(frequency)
|
||||
number_of_channels = frequency.size
|
||||
try:
|
||||
signal = full(number_of_channels, signal)
|
||||
baud_rate = full(number_of_channels, baud_rate)
|
||||
roll_off = full(number_of_channels, roll_off)
|
||||
slot_width = full(number_of_channels, slot_width) if slot_width is not None else \
|
||||
ceil((1 + roll_off) * baud_rate / DEFAULT_SLOT_WIDTH_STEP) * DEFAULT_SLOT_WIDTH_STEP
|
||||
chromatic_dispersion = full(number_of_channels, chromatic_dispersion)
|
||||
pmd = full(number_of_channels, pmd)
|
||||
pdl = full(number_of_channels, pdl)
|
||||
latency = full(number_of_channels, latency)
|
||||
nli = zeros(number_of_channels)
|
||||
ase = zeros(number_of_channels)
|
||||
delta_pdb_per_channel = full(number_of_channels, delta_pdb_per_channel)
|
||||
tx_osnr = full(number_of_channels, tx_osnr)
|
||||
tx_power = full(number_of_channels, tx_power)
|
||||
label = full(number_of_channels, label)
|
||||
return SpectralInformation(frequency=frequency, slot_width=slot_width,
|
||||
signal=signal, nli=nli, ase=ase,
|
||||
baud_rate=baud_rate, roll_off=roll_off,
|
||||
chromatic_dispersion=chromatic_dispersion,
|
||||
pmd=pmd, pdl=pdl, latency=latency,
|
||||
delta_pdb_per_channel=delta_pdb_per_channel,
|
||||
tx_osnr=tx_osnr, tx_power=tx_power, label=label)
|
||||
except ValueError as e:
|
||||
if 'could not broadcast' in str(e):
|
||||
raise SpectrumError('Dimension mismatch in input fields.')
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
si = SpectralInformation(
|
||||
Channel(1, 193.95e12, 32e9, 0.15, # 193.95 THz, 32 Gbaud
|
||||
Power(1e-3, 1e-6, 1e-6)), # 1 mW, 1uW, 1uW
|
||||
Channel(1, 195.95e12, 32e9, 0.15, # 195.95 THz, 32 Gbaud
|
||||
Power(1.2e-3, 1e-6, 1e-6)), # 1.2 mW, 1uW, 1uW
|
||||
)
|
||||
def create_input_spectral_information(f_min, f_max, roll_off, baud_rate, spacing, tx_osnr, tx_power,
|
||||
delta_pdb=0):
|
||||
"""Creates a fixed slot width spectral information with flat power.
|
||||
all arguments are scalar values"""
|
||||
number_of_channels = automatic_nch(f_min, f_max, spacing)
|
||||
frequency = [(f_min + spacing * i) for i in range(1, number_of_channels + 1)]
|
||||
delta_pdb_per_channel = delta_pdb * ones(number_of_channels)
|
||||
label = [f'{baud_rate * 1e-9 :.2f}G' for i in range(number_of_channels)]
|
||||
return create_arbitrary_spectral_information(frequency, slot_width=spacing, signal=tx_power, baud_rate=baud_rate,
|
||||
roll_off=roll_off, delta_pdb_per_channel=delta_pdb_per_channel,
|
||||
tx_osnr=tx_osnr, tx_power=tx_power, label=label)
|
||||
|
||||
si = SpectralInformation()
|
||||
spacing = 0.05 #THz
|
||||
|
||||
si = si.update(carriers=tuple(Channel(f+1, 191.3+spacing*(f+1), 32e9, 0.15, Power(1e-3, f, 1)) for f in range(96)))
|
||||
def carriers_to_spectral_information(initial_spectrum: dict[float, Carrier],
|
||||
power: float) -> SpectralInformation:
|
||||
"""Initial spectrum is a dict with key = carrier frequency, and value a Carrier object.
|
||||
:param initial_spectrum: indexed by frequency in Hz, with power offset (delta_pdb), baudrate, slot width,
|
||||
tx_osnr, tx_power and roll off.
|
||||
:param power: power of the request
|
||||
"""
|
||||
frequency = list(initial_spectrum.keys())
|
||||
signal = [c.tx_power for c in initial_spectrum.values()]
|
||||
roll_off = [c.roll_off for c in initial_spectrum.values()]
|
||||
baud_rate = [c.baud_rate for c in initial_spectrum.values()]
|
||||
delta_pdb_per_channel = [c.delta_pdb for c in initial_spectrum.values()]
|
||||
slot_width = [c.slot_width for c in initial_spectrum.values()]
|
||||
tx_osnr = [c.tx_osnr for c in initial_spectrum.values()]
|
||||
tx_power = [c.tx_power for c in initial_spectrum.values()]
|
||||
label = [c.label for c in initial_spectrum.values()]
|
||||
return create_arbitrary_spectral_information(frequency=frequency, signal=signal, baud_rate=baud_rate,
|
||||
slot_width=slot_width, roll_off=roll_off,
|
||||
delta_pdb_per_channel=delta_pdb_per_channel, tx_osnr=tx_osnr,
|
||||
tx_power=tx_power, label=label)
|
||||
|
||||
print(f'si = {si}')
|
||||
print(f'si = {si.carriers[0].power.nli}')
|
||||
print(f'si = {si.carriers[20].power.nli}')
|
||||
si2 = si.update(carriers=tuple(c.update(power = c.power.update(nli = c.power.nli * 1e5))
|
||||
for c in si.carriers))
|
||||
print(f'si2 = {si2}')
|
||||
|
||||
@dataclass
|
||||
class Carrier:
|
||||
"""One channel in the initial mixed-type spectrum definition, each type being defined by
|
||||
its delta_pdb (power offset with respect to reference power), baud rate, slot_width, roll_off
|
||||
tx_power, and tx_osnr. delta_pdb offset is applied to target power out of Roadm.
|
||||
Label is used to group carriers which belong to the same partition when printing results.
|
||||
"""
|
||||
delta_pdb: float
|
||||
baud_rate: float
|
||||
slot_width: float
|
||||
roll_off: float
|
||||
tx_osnr: float
|
||||
tx_power: float
|
||||
label: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class ReferenceCarrier:
|
||||
"""Reference channel type is used to determine target power out of ROADM for the reference channel when
|
||||
constant power spectral density (PSD) equalization is set. Reference channel is the type that has been defined
|
||||
in SI block and used for the initial design of the network.
|
||||
Computing the power out of ROADM for the reference channel is required to correctly compute the loss
|
||||
experienced by reference channel in Roadm element.
|
||||
|
||||
Baud rate is required to find the target power in constant PSD: power = PSD_target * baud_rate.
|
||||
For example, if target PSD is 3.125e4mW/GHz and reference carrier type a 32 GBaud channel then
|
||||
output power should be -20 dBm and for a 64 GBaud channel power target would need 3 dB more: -17 dBm.
|
||||
|
||||
Slot width is required to find the target power in constant PSW (constant power per slot width equalization):
|
||||
power = PSW_target * slot_width.
|
||||
For example, if target PSW is 2e4mW/GHz and reference carrier type a 32 GBaud channel in a 50GHz slot width then
|
||||
output power should be -20 dBm and for a 64 GBaud channel in a 75 GHz slot width, power target would be -18.24 dBm.
|
||||
|
||||
Other attributes (like roll-off) may be added there for future equalization purpose.
|
||||
"""
|
||||
baud_rate: float
|
||||
slot_width: float
|
||||
|
||||
@@ -1,124 +1,850 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
'''
|
||||
"""
|
||||
gnpy.core.network
|
||||
=================
|
||||
|
||||
This module contains functions for constructing networks of network elements.
|
||||
'''
|
||||
Working with networks which consist of network elements
|
||||
"""
|
||||
|
||||
|
||||
from networkx import DiGraph
|
||||
from copy import deepcopy
|
||||
from operator import attrgetter
|
||||
from collections import namedtuple
|
||||
from logging import getLogger
|
||||
|
||||
from gnpy.core import elements
|
||||
from gnpy.core.elements import Fiber, Edfa, Transceiver, Roadm
|
||||
from gnpy.core.units import UNITS
|
||||
from gnpy.core.exceptions import ConfigurationError, NetworkTopologyError
|
||||
from gnpy.core.utils import round2float, convert_length, psd2powerdbm, lin2db, watt2dbm, dbm2watt
|
||||
from gnpy.core.info import ReferenceCarrier, create_input_spectral_information
|
||||
from gnpy.core.parameters import SimParams, EdfaParams
|
||||
from gnpy.core.science_utils import RamanSolver
|
||||
|
||||
|
||||
MAX_SPAN_LENGTH = 125000
|
||||
TARGET_SPAN_LENGTH = 100000
|
||||
MIN_SPAN_LENGTH = 75000
|
||||
logger = getLogger(__name__)
|
||||
|
||||
|
||||
def network_from_json(json_data):
|
||||
# NOTE|dutc: we could use the following, but it would tie our data format
|
||||
# too closely to the graph library
|
||||
# from networkx import node_link_graph
|
||||
g = DiGraph()
|
||||
for el_config in json_data['elements']:
|
||||
g.add_node(getattr(elements, el_config['type'])(el_config))
|
||||
def edfa_nf(gain_target, variety_type, equipment):
|
||||
amp_params = equipment['Edfa'][variety_type]
|
||||
amp = elements.Edfa(
|
||||
uid='calc_NF',
|
||||
params=amp_params.__dict__,
|
||||
operational={
|
||||
'gain_target': gain_target,
|
||||
'tilt_target': 0
|
||||
}
|
||||
)
|
||||
amp.pin_db = 0
|
||||
amp.nch = 88
|
||||
amp.slot_width = 50e9
|
||||
return amp._calc_nf(True)
|
||||
|
||||
nodes = {k.uid: k for k in g.nodes()}
|
||||
|
||||
for cx in json_data['connections']:
|
||||
from_node, to_node = cx['from_node'], cx['to_node']
|
||||
g.add_edge(nodes[from_node], nodes[to_node])
|
||||
def select_edfa(raman_allowed, gain_target, power_target, equipment, uid, restrictions=None, verbose=True):
|
||||
"""amplifer selection algorithm
|
||||
@Orange Jean-Luc Augé
|
||||
"""
|
||||
Edfa_list = namedtuple('Edfa_list', 'variety power gain_min nf')
|
||||
TARGET_EXTENDED_GAIN = equipment['Span']['default'].target_extended_gain
|
||||
|
||||
return g
|
||||
# for roadm restriction only: create a dict including not allowed for design amps
|
||||
# because main use case is to have specific radm amp which are not allowed for ILA
|
||||
# with the auto design
|
||||
edfa_dict = {name: amp for (name, amp) in equipment['Edfa'].items()
|
||||
if restrictions is None or name in restrictions}
|
||||
|
||||
def calculate_new_length(fiber_length):
|
||||
result = (fiber_length, 1)
|
||||
if fiber_length > MAX_SPAN_LENGTH:
|
||||
n_spans = int(fiber_length // TARGET_SPAN_LENGTH)
|
||||
pin = power_target - gain_target
|
||||
|
||||
length1 = fiber_length / (n_spans+1)
|
||||
result1 = (length1, n_spans+1)
|
||||
delta1 = TARGET_SPAN_LENGTH-length1
|
||||
# create 2 list of available amplifiers with relevant attributes for their selection
|
||||
|
||||
length2 = fiber_length / n_spans
|
||||
delta2 = length2-TARGET_SPAN_LENGTH
|
||||
result2 = (length2, n_spans)
|
||||
# edfa list with:
|
||||
# extended gain min allowance of 3dB: could be parametrized, but a bit complex
|
||||
# extended gain max allowance TARGET_EXTENDED_GAIN is coming from eqpt_config.json
|
||||
# power attribut include power AND gain limitations
|
||||
edfa_list = [Edfa_list(
|
||||
variety=edfa_variety,
|
||||
power=min(pin + edfa.gain_flatmax + TARGET_EXTENDED_GAIN, edfa.p_max) - power_target,
|
||||
gain_min=gain_target + 3 - edfa.gain_min,
|
||||
nf=edfa_nf(gain_target, edfa_variety, equipment))
|
||||
for edfa_variety, edfa in edfa_dict.items()
|
||||
if ((edfa.allowed_for_design or restrictions is not None) and not edfa.raman)]
|
||||
|
||||
if length1<MIN_SPAN_LENGTH and length2<MAX_SPAN_LENGTH:
|
||||
result = result2
|
||||
elif length2>MAX_SPAN_LENGTH and length1>MIN_SPAN_LENGTH:
|
||||
result = result1
|
||||
# consider a Raman list because of different gain_min requirement:
|
||||
# do not allow extended gain min for Raman
|
||||
raman_list = [Edfa_list(
|
||||
variety=edfa_variety,
|
||||
power=min(pin + edfa.gain_flatmax + TARGET_EXTENDED_GAIN, edfa.p_max) - power_target,
|
||||
gain_min=gain_target - edfa.gain_min,
|
||||
nf=edfa_nf(gain_target, edfa_variety, equipment))
|
||||
for edfa_variety, edfa in edfa_dict.items()
|
||||
if (edfa.allowed_for_design and edfa.raman)] \
|
||||
if raman_allowed else []
|
||||
|
||||
# merge raman and edfa lists
|
||||
amp_list = edfa_list + raman_list
|
||||
|
||||
# filter on min gain limitation:
|
||||
acceptable_gain_min_list = [x for x in amp_list if x.gain_min > 0]
|
||||
|
||||
if len(acceptable_gain_min_list) < 1:
|
||||
# do not take this empty list into account for the rest of the code
|
||||
# but issue a warning to the user and do not consider Raman
|
||||
# Raman below min gain should not be allowed because i is meant to be a design requirement
|
||||
# and raman padding at the amplifier input is impossible!
|
||||
|
||||
if len(edfa_list) < 1:
|
||||
raise ConfigurationError(f'auto_design could not find any amplifier \
|
||||
to satisfy min gain requirement in node {uid} \
|
||||
please increase span fiber padding')
|
||||
else:
|
||||
if delta1 < delta2:
|
||||
result = result1
|
||||
# TODO: convert to logging
|
||||
if verbose:
|
||||
logger.warning(f'\n\tWARNING: target gain in node {uid} is below all available amplifiers min gain: '
|
||||
+ '\n\tamplifier input padding will be assumed, consider increase span fiber padding '
|
||||
+ 'instead.\n')
|
||||
acceptable_gain_min_list = edfa_list
|
||||
|
||||
# filter on gain+power limitation:
|
||||
# this list checks both the gain and the power requirement
|
||||
# because of the way .power is calculated in the list
|
||||
acceptable_power_list = [x for x in acceptable_gain_min_list if x.power > 0]
|
||||
if len(acceptable_power_list) < 1:
|
||||
# no amplifier satisfies the required power, so pick the highest power(s):
|
||||
power_max = max(acceptable_gain_min_list, key=attrgetter('power')).power
|
||||
# check and pick if other amplifiers may have a similar gain/power
|
||||
# allow a 0.3dB power range
|
||||
# this allows to chose an amplifier with a better NF subsequentely
|
||||
acceptable_power_list = [x for x in acceptable_gain_min_list
|
||||
if x.power - power_max > -0.3]
|
||||
|
||||
# gain and power requirements are resolved,
|
||||
# =>chose the amp with the best NF among the acceptable ones:
|
||||
selected_edfa = min(acceptable_power_list, key=attrgetter('nf')) # filter on NF
|
||||
# check what are the gain and power limitations of this amp
|
||||
power_reduction = min(selected_edfa.power, 0)
|
||||
if power_reduction < -0.5 and verbose:
|
||||
logger.warning(f'\n\tWARNING: target gain and power in node {uid}\n'
|
||||
+ '\tis beyond all available amplifiers capabilities and/or extended_gain_range:\n'
|
||||
+ f'\ta power reduction of {round(power_reduction, 2)} is applied\n')
|
||||
return selected_edfa.variety, power_reduction
|
||||
|
||||
|
||||
def target_power(network, node, equipment): # get_fiber_dp
|
||||
"""Computes target power using J. -L. Auge, V. Curri and E. Le Rouzic,
|
||||
Open Design for Multi-Vendor Optical Networks, OFC 2019.
|
||||
equation 4
|
||||
"""
|
||||
if isinstance(node, elements.Roadm):
|
||||
return 0
|
||||
|
||||
SPAN_LOSS_REF = 20
|
||||
POWER_SLOPE = 0.3
|
||||
dp_range = list(equipment['Span']['default'].delta_power_range_db)
|
||||
node_loss = span_loss(network, node, equipment)
|
||||
try:
|
||||
dp = round2float((node_loss - SPAN_LOSS_REF) * POWER_SLOPE, dp_range[2])
|
||||
dp = max(dp_range[0], dp)
|
||||
dp = min(dp_range[1], dp)
|
||||
except IndexError:
|
||||
raise ConfigurationError('invalid delta_power_range_db definition in eqpt_config[Span]'
|
||||
'delta_power_range_db: [lower_bound, upper_bound, step]')
|
||||
|
||||
return dp
|
||||
|
||||
|
||||
_fiber_fused_types = (elements.Fused, elements.Fiber)
|
||||
|
||||
|
||||
def prev_node_generator(network, node):
|
||||
"""fused spans interest:
|
||||
iterate over all predecessors while they are either Fused or Fibers succeeded by Fused"""
|
||||
try:
|
||||
prev_node = next(network.predecessors(node))
|
||||
except StopIteration:
|
||||
if isinstance(node, elements.Transceiver):
|
||||
return
|
||||
raise NetworkTopologyError(f'Node {node.uid} is not properly connected, please check network topology')
|
||||
if ((isinstance(prev_node, elements.Fused) and isinstance(node, _fiber_fused_types)) or
|
||||
(isinstance(prev_node, _fiber_fused_types) and isinstance(node, elements.Fused))):
|
||||
yield prev_node
|
||||
yield from prev_node_generator(network, prev_node)
|
||||
|
||||
|
||||
def next_node_generator(network, node):
|
||||
"""fused spans interest:
|
||||
iterate over all predecessors while they are either Fused or Fibers preceded by Fused"""
|
||||
try:
|
||||
next_node = next(network.successors(node))
|
||||
except StopIteration:
|
||||
if isinstance(node, elements.Transceiver):
|
||||
return
|
||||
raise NetworkTopologyError(f'Node {node.uid} is not properly connected, please check network topology')
|
||||
|
||||
if ((isinstance(next_node, elements.Fused) and isinstance(node, _fiber_fused_types)) or
|
||||
(isinstance(next_node, _fiber_fused_types) and isinstance(node, elements.Fused))):
|
||||
yield next_node
|
||||
yield from next_node_generator(network, next_node)
|
||||
|
||||
|
||||
def estimate_raman_gain(node, equipment, power_dbm):
|
||||
"""If node is RamanFiber, then estimate the possible Raman gain if any
|
||||
for this purpose computes stimulated_raman_scattering loss_profile. This may be time consuming.
|
||||
"""
|
||||
if isinstance(node, elements.RamanFiber):
|
||||
if hasattr(node, "estimated_gain"):
|
||||
return node.estimated_gain
|
||||
f_min = equipment['SI']['default'].f_min
|
||||
f_max = equipment['SI']['default'].f_max
|
||||
roll_off = equipment['SI']['default'].roll_off
|
||||
baud_rate = equipment['SI']['default'].baud_rate
|
||||
power = dbm2watt(power_dbm)
|
||||
spacing = equipment['SI']['default'].spacing
|
||||
tx_osnr = equipment['SI']['default'].tx_osnr
|
||||
|
||||
# reduce the nb of channels to speed up
|
||||
spacing = spacing * 3
|
||||
power = power * 3
|
||||
|
||||
sim_params = {
|
||||
"raman_params": {
|
||||
"flag": True,
|
||||
"result_spatial_resolution": 50e3,
|
||||
"solver_spatial_resolution": 100
|
||||
}
|
||||
}
|
||||
|
||||
# in order to take into account gain generated in RamanFiber, propagate in the RamanFiber with
|
||||
if hasattr(node, "estimated_gain"):
|
||||
# do not compute twice to save on time
|
||||
return node.estimated_gain
|
||||
spectral_info = create_input_spectral_information(f_min=f_min, f_max=f_max, roll_off=roll_off,
|
||||
baud_rate=baud_rate, tx_power=power, spacing=spacing,
|
||||
tx_osnr=tx_osnr)
|
||||
pin = watt2dbm(sum(spectral_info.signal))
|
||||
attenuation_in_db = node.params.con_in + node.params.att_in
|
||||
spectral_info.apply_attenuation_db(attenuation_in_db)
|
||||
save_sim_params = {"raman_params": SimParams._shared_dict['raman_params'].to_json(),
|
||||
"nli_params": SimParams._shared_dict['nli_params'].to_json()}
|
||||
SimParams.set_params(sim_params)
|
||||
stimulated_raman_scattering = RamanSolver.calculate_stimulated_raman_scattering(spectral_info, node)
|
||||
attenuation_fiber = stimulated_raman_scattering.loss_profile[:spectral_info.number_of_channels, -1]
|
||||
spectral_info.apply_attenuation_lin(attenuation_fiber)
|
||||
attenuation_out_db = node.params.con_out
|
||||
spectral_info.apply_attenuation_db(attenuation_out_db)
|
||||
pout = watt2dbm(sum(spectral_info.signal))
|
||||
estimated_loss = pin - pout
|
||||
estimated_gain = node.loss - estimated_loss
|
||||
node.estimated_gain = estimated_gain
|
||||
SimParams.set_params(save_sim_params)
|
||||
return round(estimated_gain, 2)
|
||||
else:
|
||||
return 0.0
|
||||
|
||||
|
||||
def span_loss(network, node, equipment, input_power=None):
|
||||
"""Total loss of a span (Fiber and Fused nodes) which contains the given node
|
||||
Do not recompute, if it was already computed: records it in design_span_loss"""
|
||||
if hasattr(node, "design_span_loss"):
|
||||
return node.design_span_loss
|
||||
loss = node.loss if node.passive else 0
|
||||
loss += sum(n.loss for n in prev_node_generator(network, node))
|
||||
loss += sum(n.loss for n in next_node_generator(network, node))
|
||||
# add the possible Raman gain
|
||||
gain = estimate_raman_gain(node, equipment, input_power)
|
||||
gain += sum(estimate_raman_gain(n, equipment, input_power) for n in prev_node_generator(network, node))
|
||||
gain += sum(estimate_raman_gain(n, equipment, input_power) for n in next_node_generator(network, node))
|
||||
return loss - gain
|
||||
|
||||
|
||||
def find_first_node(network, node):
|
||||
"""Fused node interest:
|
||||
returns the 1st node at the origin of a succession of fused nodes
|
||||
(aka no amp in between)"""
|
||||
this_node = node
|
||||
for this_node in prev_node_generator(network, node):
|
||||
pass
|
||||
return this_node
|
||||
|
||||
|
||||
def find_last_node(network, node):
|
||||
"""Fused node interest:
|
||||
returns the last node in a succession of fused nodes
|
||||
(aka no amp in between)"""
|
||||
this_node = node
|
||||
for this_node in next_node_generator(network, node):
|
||||
pass
|
||||
return this_node
|
||||
|
||||
|
||||
def set_amplifier_voa(amp, power_target, power_mode):
|
||||
VOA_MARGIN = 1 # do not maximize the VOA optimization
|
||||
if amp.out_voa is None:
|
||||
if power_mode and amp.params.out_voa_auto:
|
||||
voa = min(amp.params.p_max - power_target,
|
||||
amp.params.gain_flatmax - amp.effective_gain)
|
||||
voa = max(round2float(voa, 0.5) - VOA_MARGIN, 0)
|
||||
amp.delta_p = amp.delta_p + voa
|
||||
amp.effective_gain = amp.effective_gain + voa
|
||||
else:
|
||||
voa = 0 # no output voa optimization in gain mode
|
||||
amp.out_voa = voa
|
||||
|
||||
|
||||
def set_egress_amplifier(network, this_node, equipment, pref_ch_db, pref_total_db, verbose):
|
||||
"""This node can be a transceiver or a ROADM (same function called in both cases).
|
||||
go through each link staring from this_node until next Roadm or Transceiver and
|
||||
set gain and delta_p according to configurations set by user.
|
||||
power_mode = True, set amplifiers delta_p and effective_gain
|
||||
power_mode = False, set amplifiers effective_gain and ignore delta_p config: set it to None
|
||||
"""
|
||||
power_mode = equipment['Span']['default'].power_mode
|
||||
next_oms = (n for n in network.successors(this_node) if not isinstance(n, elements.Transceiver))
|
||||
for oms in next_oms:
|
||||
# go through all the OMS departing from the ROADM
|
||||
prev_node = this_node
|
||||
node = oms
|
||||
if isinstance(this_node, elements.Transceiver):
|
||||
# todo change pref to a ref channel
|
||||
if equipment['SI']['default'].tx_power_dbm is not None:
|
||||
this_node_out_power = equipment['SI']['default'].tx_power_dbm
|
||||
else:
|
||||
result = result2
|
||||
this_node_out_power = pref_ch_db
|
||||
if isinstance(this_node, elements.Roadm):
|
||||
# get target power out from ROADM for the reference carrier based on equalization settings
|
||||
this_node_out_power = this_node.get_per_degree_ref_power(degree=node.uid)
|
||||
# use the target power on this degree
|
||||
prev_dp = this_node_out_power - pref_ch_db
|
||||
dp = prev_dp
|
||||
prev_voa = 0
|
||||
voa = 0
|
||||
visited_nodes = []
|
||||
while not (isinstance(node, elements.Roadm) or isinstance(node, elements.Transceiver)):
|
||||
# go through all nodes in the OMS (loop until next Roadm instance)
|
||||
next_node = get_next_node(node, network)
|
||||
visited_nodes.append(node)
|
||||
if next_node in visited_nodes:
|
||||
raise NetworkTopologyError(f'Loop detected for {type(node).__name__} {node.uid}, '
|
||||
+ 'please check network topology')
|
||||
if isinstance(node, elements.Edfa):
|
||||
node_loss = span_loss(network, prev_node, equipment)
|
||||
voa = node.out_voa if node.out_voa else 0
|
||||
if node.operational.delta_p is None:
|
||||
dp = target_power(network, next_node, equipment) + voa
|
||||
else:
|
||||
dp = node.operational.delta_p
|
||||
if node.effective_gain is None or power_mode:
|
||||
gain_target = node_loss + dp - prev_dp + prev_voa
|
||||
else: # gain mode with effective_gain
|
||||
gain_target = node.effective_gain
|
||||
dp = prev_dp - node_loss - prev_voa + gain_target
|
||||
|
||||
return result
|
||||
power_target = pref_total_db + dp
|
||||
|
||||
def split_fiber(network, fiber):
|
||||
new_length, n_spans = calculate_new_length(fiber.length)
|
||||
prev_node = fiber
|
||||
if n_spans > 1:
|
||||
next_nodes = [_ for _ in network.successors(fiber)]
|
||||
for next_node in next_nodes:
|
||||
network.remove_edge(fiber, next_node)
|
||||
if isinstance(prev_node, elements.Fiber):
|
||||
max_fiber_lineic_loss_for_raman = \
|
||||
equipment['Span']['default'].max_fiber_lineic_loss_for_raman * 1e-3 # dB/m
|
||||
raman_allowed = (prev_node.params.loss_coef < max_fiber_lineic_loss_for_raman).all()
|
||||
else:
|
||||
raman_allowed = False
|
||||
|
||||
new_params_length = new_length / UNITS[fiber.params.length_units]
|
||||
config = {'uid':fiber.uid, 'type': 'Fiber', 'metadata': fiber.__dict__['metadata'], \
|
||||
'params': fiber.__dict__['params']}
|
||||
fiber.uid = config['uid'] + '_1'
|
||||
fiber.length = new_length
|
||||
fiber.loss = fiber.loss_coef * fiber.length
|
||||
if node.params.type_variety == '':
|
||||
if node.variety_list and isinstance(node.variety_list, list):
|
||||
restrictions = node.variety_list
|
||||
elif isinstance(prev_node, elements.Roadm) and prev_node.restrictions['booster_variety_list']:
|
||||
# implementation of restrictions on roadm boosters
|
||||
restrictions = prev_node.restrictions['booster_variety_list']
|
||||
elif isinstance(next_node, elements.Roadm) and next_node.restrictions['preamp_variety_list']:
|
||||
# implementation of restrictions on roadm preamp
|
||||
restrictions = next_node.restrictions['preamp_variety_list']
|
||||
else:
|
||||
restrictions = None
|
||||
edfa_variety, power_reduction = select_edfa(raman_allowed, gain_target, power_target, equipment,
|
||||
node.uid, restrictions, verbose)
|
||||
extra_params = equipment['Edfa'][edfa_variety]
|
||||
node.params.update_params(extra_params.__dict__)
|
||||
dp += power_reduction
|
||||
gain_target += power_reduction
|
||||
else:
|
||||
# Check power saturation also in this case
|
||||
p_max = equipment['Edfa'][node.params.type_variety].p_max
|
||||
if power_mode:
|
||||
power_reduction = min(0, p_max - (pref_total_db + dp))
|
||||
else:
|
||||
pout = pref_total_db + prev_dp - node_loss - prev_voa + gain_target
|
||||
power_reduction = min(0, p_max - pout)
|
||||
dp += power_reduction
|
||||
gain_target += power_reduction
|
||||
if node.params.raman and not raman_allowed:
|
||||
if isinstance(prev_node, elements.Fiber):
|
||||
logger.warning(f'\n\tWARNING: raman is used in node {node.uid}\n '
|
||||
+ '\tbut fiber lineic loss is above threshold\n')
|
||||
else:
|
||||
logger.critical(f'\n\tWARNING: raman is used in node {node.uid}\n '
|
||||
+ '\tbut previous node is not a fiber\n')
|
||||
# if variety is imposed by user, and if the gain_target (computed or imposed) is also above
|
||||
# variety max gain + extended range, then warn that gain > max_gain + extended range
|
||||
if gain_target - equipment['Edfa'][node.params.type_variety].gain_flatmax - \
|
||||
equipment['Span']['default'].target_extended_gain > 1e-2 and verbose:
|
||||
# 1e-2 to allow a small margin according to round2float min step
|
||||
logger.warning(f'\n\tWARNING: effective gain in Node {node.uid}\n'
|
||||
+ f'\tis above user specified amplifier {node.params.type_variety}\n'
|
||||
+ '\tmax flat gain: '
|
||||
+ f'{equipment["Edfa"][node.params.type_variety].gain_flatmax}dB ; '
|
||||
+ f'required gain: {round(gain_target, 2)}dB. Please check amplifier type.\n')
|
||||
|
||||
for i in range(2, n_spans+1):
|
||||
new_config = dict(config)
|
||||
new_config['uid'] = new_config['uid'] + '_' + str(i)
|
||||
new_config['params'].length = new_params_length
|
||||
new_node = Fiber(new_config)
|
||||
network.add_node(new_node)
|
||||
network.add_edge(prev_node, new_node)
|
||||
network = add_egress_amplifier(network, prev_node)
|
||||
prev_node = new_node
|
||||
node.delta_p = dp if power_mode else None
|
||||
node.effective_gain = gain_target
|
||||
# if voa is not set, then set it and possibly optimize it with gain and update delta_p and
|
||||
# effective_gain values
|
||||
set_amplifier_voa(node, power_target, power_mode)
|
||||
# set_amplifier_voa may change delta_p in power_mode
|
||||
node._delta_p = node.delta_p if power_mode else dp
|
||||
|
||||
for next_node in next_nodes:
|
||||
network.add_edge(prev_node, next_node)
|
||||
# target_pch_out_dbm records target power for design: If user defines one, then this is displayed,
|
||||
# else display the one computed during design
|
||||
if node.delta_p is not None and node.operational.delta_p is not None:
|
||||
# use the user defined target
|
||||
node.target_pch_out_dbm = round(node.operational.delta_p + pref_ch_db, 2)
|
||||
elif node.delta_p is not None:
|
||||
# use the design target if no target were set
|
||||
node.target_pch_out_dbm = round(node.delta_p + pref_ch_db, 2)
|
||||
elif node.delta_p is None:
|
||||
node.target_pch_out_dbm = None
|
||||
elif isinstance(node, elements.RamanFiber):
|
||||
_ = span_loss(network, node, equipment, input_power=pref_ch_db + dp)
|
||||
prev_dp = dp
|
||||
prev_voa = voa
|
||||
prev_node = node
|
||||
node = next_node
|
||||
|
||||
network = add_egress_amplifier(network, prev_node)
|
||||
return network
|
||||
|
||||
def add_egress_amplifier(network, node):
|
||||
next_nodes = [n for n in network.successors(node)
|
||||
if not (isinstance(n, Edfa) or isinstance(n, Transceiver))]
|
||||
i = 1
|
||||
def set_roadm_ref_carrier(roadm, equipment):
|
||||
"""ref_carrier records carrier information used for design and usefull for equalization
|
||||
"""
|
||||
roadm.ref_carrier = ReferenceCarrier(baud_rate=equipment['SI']['default'].baud_rate,
|
||||
slot_width=equipment['SI']['default'].spacing)
|
||||
|
||||
|
||||
def set_roadm_per_degree_targets(roadm, network):
|
||||
"""Set target powers/PSD on all degrees
|
||||
This is needed to populate per_degree_pch_out_dbm or per_degree_pch_psd or per_degree_pch_psw dicts when
|
||||
they are not initialized by users.
|
||||
"""
|
||||
next_oms = (n for n in network.successors(roadm) if not isinstance(n, elements.Transceiver))
|
||||
|
||||
for node in next_oms:
|
||||
# go through all the OMS departing from the ROADM
|
||||
if node.uid not in roadm.per_degree_pch_out_dbm and node.uid not in roadm.per_degree_pch_psd and \
|
||||
node.uid not in roadm.per_degree_pch_psw:
|
||||
# if no target power is defined on this degree or no per degree target power is given use the global one
|
||||
if roadm.params.target_pch_out_db:
|
||||
roadm.per_degree_pch_out_dbm[node.uid] = roadm.params.target_pch_out_db
|
||||
elif roadm.params.target_psd_out_mWperGHz:
|
||||
roadm.per_degree_pch_psd[node.uid] = roadm.params.target_psd_out_mWperGHz
|
||||
elif roadm.params.target_out_mWperSlotWidth:
|
||||
roadm.per_degree_pch_psw[node.uid] = roadm.params.target_out_mWperSlotWidth
|
||||
else:
|
||||
raise ConfigurationError(roadm.uid, 'needs an equalization target')
|
||||
|
||||
|
||||
def set_roadm_input_powers(network, roadm, equipment, pref_ch_db):
|
||||
"""Set reference powers at ROADM input for a reference channel and based on the adjacent OMS.
|
||||
This supposes that there is no dependency on path. For example, the succession:
|
||||
node power out of element
|
||||
roadm A (target power -10dBm) -10dBm
|
||||
fiber A (16 dB loss) -26dBm
|
||||
roadm B (target power -12dBm) -26dBm
|
||||
fiber B (10 dB loss) -36dBm
|
||||
roadm C (target power -14dBm) -36dBm
|
||||
is not consistent because target powers in roadm B and roadm C can not be met.
|
||||
input power for the reference channel will be set -26 dBm in roadm B and -22dBm in roadm C,
|
||||
because at design time we can not know about path.
|
||||
The function raises a warning if target powers can not be met with the design.
|
||||
User should be aware that design was not successfull and that power reduction was applied.
|
||||
Note that this value is only used for visualisation purpose (to compute ROADM loss in elements).
|
||||
"""
|
||||
previous_elements = [n for n in network.predecessors(roadm)]
|
||||
roadm.ref_pch_in_dbm = {}
|
||||
for element in previous_elements:
|
||||
node = element
|
||||
loss = 0.0
|
||||
while isinstance(node, (elements.Fiber, elements.Fused, elements.RamanFiber)):
|
||||
# go through all predecessors until a power target is found either in an amplifier, a ROADM or a transceiver
|
||||
# then deduce power at ROADM input from this degree based on this target and crossed losses
|
||||
loss += node.loss
|
||||
previous_node = node
|
||||
node = next(network.predecessors(node))
|
||||
if isinstance(node, elements.Edfa):
|
||||
roadm.ref_pch_in_dbm[element.uid] = pref_ch_db + node._delta_p - node.out_voa - loss
|
||||
elif isinstance(node, elements.Roadm):
|
||||
roadm.ref_pch_in_dbm[element.uid] = \
|
||||
node.get_per_degree_ref_power(degree=previous_node.uid) - loss
|
||||
elif isinstance(node, elements.Transceiver):
|
||||
roadm.ref_pch_in_dbm[element.uid] = pref_ch_db - loss
|
||||
# check if target power can be met
|
||||
temp = []
|
||||
if roadm.per_degree_pch_out_dbm:
|
||||
temp.append(max([p for p in roadm.per_degree_pch_out_dbm.values()]))
|
||||
if roadm.per_degree_pch_psd:
|
||||
temp.append(max([psd2powerdbm(p, roadm.ref_carrier.baud_rate) for p in roadm.per_degree_pch_psd.values()]))
|
||||
if roadm.per_degree_pch_psw:
|
||||
temp.append(max([psd2powerdbm(p, roadm.ref_carrier.slot_width) for p in roadm.per_degree_pch_psw.values()]))
|
||||
if roadm.params.target_pch_out_db:
|
||||
temp.append(roadm.params.target_pch_out_db)
|
||||
if roadm.params.target_psd_out_mWperGHz:
|
||||
temp.append(psd2powerdbm(roadm.params.target_psd_out_mWperGHz, roadm.ref_carrier.baud_rate))
|
||||
if roadm.params.target_out_mWperSlotWidth:
|
||||
temp.append(psd2powerdbm(roadm.params.target_out_mWperSlotWidth, roadm.ref_carrier.slot_width))
|
||||
if not temp:
|
||||
raise ConfigurationError(f'Could not find target power/PSD/PSW in ROADM "{roadm.uid}"')
|
||||
target_to_be_supported = max(temp)
|
||||
for from_degree, in_power in roadm.ref_pch_in_dbm.items():
|
||||
if in_power < target_to_be_supported:
|
||||
logger.warning(
|
||||
f'WARNING: maximum target power {target_to_be_supported}dBm '
|
||||
+ f'in ROADM "{roadm.uid}" can not be met for at least one crossing path. Min input power '
|
||||
+ f'from "{from_degree}" direction is {round(in_power, 2)}dBm. Please correct input topology.'
|
||||
)
|
||||
|
||||
|
||||
def set_fiber_input_power(network, fiber, equipment, pref_ch_db):
|
||||
"""Set reference powers at fiber input for a reference channel.
|
||||
Supposes that target power out of ROADMs and amplifiers are consistent.
|
||||
This is only for visualisation purpose
|
||||
"""
|
||||
loss = 0.0
|
||||
node = next(network.predecessors(fiber))
|
||||
while isinstance(node, elements.Fused):
|
||||
loss += node.loss
|
||||
previous_node = node
|
||||
node = next(network.predecessors(node))
|
||||
if isinstance(node, (elements.Fiber, elements.RamanFiber)) and node.ref_pch_in_dbm is not None:
|
||||
fiber.ref_pch_in_dbm = node.ref_pch_in_dbm - loss - node.loss
|
||||
if isinstance(node, (elements.Fiber, elements.RamanFiber)) and node.ref_pch_in_dbm is None:
|
||||
set_fiber_input_power(network, node, equipment, pref_ch_db)
|
||||
fiber.ref_pch_in_dbm = node.ref_pch_in_dbm - loss - node.loss
|
||||
elif isinstance(node, elements.Roadm):
|
||||
fiber.ref_pch_in_dbm = \
|
||||
node.get_per_degree_ref_power(degree=previous_node.uid) - loss
|
||||
elif isinstance(node, elements.Edfa):
|
||||
fiber.ref_pch_in_dbm = pref_ch_db + node._delta_p - node.out_voa - loss
|
||||
elif isinstance(node, elements.Transceiver):
|
||||
fiber.ref_pch_in_dbm = pref_ch_db - loss
|
||||
|
||||
|
||||
def set_roadm_internal_paths(roadm, network):
|
||||
"""Set ROADM path types (express, add, drop)
|
||||
|
||||
Uses implicit guess if no information is set in ROADM
|
||||
"""
|
||||
next_oms = [n.uid for n in network.successors(roadm) if not isinstance(n, elements.Transceiver)]
|
||||
previous_oms = [n.uid for n in network.predecessors(roadm) if not isinstance(n, elements.Transceiver)]
|
||||
drop_port = [n.uid for n in network.successors(roadm) if isinstance(n, elements.Transceiver)]
|
||||
add_port = [n.uid for n in network.predecessors(roadm) if isinstance(n, elements.Transceiver)]
|
||||
|
||||
default_express = 'express'
|
||||
default_add = 'add'
|
||||
default_drop = 'drop'
|
||||
# take user defined element impairment id if it exists
|
||||
correct_from_degrees = []
|
||||
correct_add = []
|
||||
correct_to_degrees = []
|
||||
correct_drop = []
|
||||
for from_degree in previous_oms:
|
||||
correct_from_degrees.append(from_degree)
|
||||
for to_degree in next_oms:
|
||||
correct_to_degrees.append(to_degree)
|
||||
impairment_id = roadm.get_per_degree_impairment_id(from_degree, to_degree)
|
||||
roadm.set_roadm_paths(from_degree=from_degree, to_degree=to_degree, path_type=default_express,
|
||||
impairment_id=impairment_id)
|
||||
for drop in drop_port:
|
||||
correct_drop.append(drop)
|
||||
impairment_id = roadm.get_per_degree_impairment_id(from_degree, drop)
|
||||
path_type = roadm.get_path_type_per_id(impairment_id)
|
||||
# a degree connected to a transceiver MUST be add or drop
|
||||
# but a degree connected to something else could be an express, add or drop
|
||||
# (for example case of external shelves)
|
||||
if path_type and path_type != 'drop':
|
||||
msg = f'Roadm {roadm.uid} path_type is defined as {path_type} but it should be drop'
|
||||
raise NetworkTopologyError(msg)
|
||||
roadm.set_roadm_paths(from_degree=from_degree, to_degree=drop, path_type=default_drop,
|
||||
impairment_id=impairment_id)
|
||||
for to_degree in next_oms:
|
||||
for add in add_port:
|
||||
correct_add.append(add)
|
||||
impairment_id = roadm.get_per_degree_impairment_id(add, to_degree)
|
||||
path_type = roadm.get_path_type_per_id(impairment_id)
|
||||
if path_type and path_type != 'add':
|
||||
msg = f'Roadm {roadm.uid} path_type is defined as {path_type} but it should be add'
|
||||
raise NetworkTopologyError(msg)
|
||||
roadm.set_roadm_paths(from_degree=add, to_degree=to_degree, path_type=default_add,
|
||||
impairment_id=impairment_id)
|
||||
# sanity check: raise an error if per_degree from or to degrees are not in the correct list
|
||||
# raise an error if user defined path_type is not consistent with inferred path_type:
|
||||
for item in roadm.per_degree_impairments.values():
|
||||
if item['from_degree'] not in correct_from_degrees + correct_add or \
|
||||
item['to_degree'] not in correct_to_degrees + correct_drop:
|
||||
msg = f'Roadm {roadm.uid} has wrong from-to degree uid {item["from_degree"]} - {item["to_degree"]}'
|
||||
raise NetworkTopologyError(msg)
|
||||
|
||||
|
||||
def add_roadm_booster(network, roadm):
|
||||
next_nodes = [n for n in network.successors(roadm)
|
||||
if not (isinstance(n, elements.Transceiver) or isinstance(n, elements.Fused)
|
||||
or isinstance(n, elements.Edfa))]
|
||||
# no amplification for fused spans or TRX
|
||||
for next_node in next_nodes:
|
||||
network.remove_edge(node, next_node)
|
||||
network.remove_edge(roadm, next_node)
|
||||
amp = elements.Edfa(
|
||||
uid=f'Edfa_booster_{roadm.uid}_to_{next_node.uid}',
|
||||
params=EdfaParams.default_values,
|
||||
metadata={
|
||||
'location': {
|
||||
'latitude': roadm.lat,
|
||||
'longitude': roadm.lng,
|
||||
'city': roadm.loc.city,
|
||||
'region': roadm.loc.region,
|
||||
}
|
||||
},
|
||||
operational={
|
||||
'gain_target': None,
|
||||
'tilt_target': 0,
|
||||
})
|
||||
network.add_node(amp)
|
||||
network.add_edge(roadm, amp, weight=0.01)
|
||||
network.add_edge(amp, next_node, weight=0.01)
|
||||
|
||||
uid = 'Edfa' + str(i)+ '_' + str(node.uid)
|
||||
metadata = next_node.metadata
|
||||
operational = {'gain_target': node.loss, 'tilt_target': 0}
|
||||
edfa_config_json = 'edfa_config.json'
|
||||
config = {'uid':uid, 'type': 'Edfa', 'metadata': metadata, \
|
||||
'config_from_json': edfa_config_json, 'operational': operational}
|
||||
new_edfa = Edfa(config)
|
||||
network.add_node(new_edfa)
|
||||
network.add_edge(node,new_edfa)
|
||||
network.add_edge(new_edfa, next_node)
|
||||
i +=1
|
||||
|
||||
return network
|
||||
def add_roadm_preamp(network, roadm):
|
||||
prev_nodes = [n for n in network.predecessors(roadm)
|
||||
if not (isinstance(n, elements.Transceiver) or isinstance(n, elements.Fused) or isinstance(n, elements.Edfa))]
|
||||
# no amplification for fused spans or TRX
|
||||
for prev_node in prev_nodes:
|
||||
network.remove_edge(prev_node, roadm)
|
||||
amp = elements.Edfa(
|
||||
uid=f'Edfa_preamp_{roadm.uid}_from_{prev_node.uid}',
|
||||
params=EdfaParams.default_values,
|
||||
metadata={
|
||||
'location': {
|
||||
'latitude': roadm.lat,
|
||||
'longitude': roadm.lng,
|
||||
'city': roadm.loc.city,
|
||||
'region': roadm.loc.region,
|
||||
}
|
||||
},
|
||||
operational={
|
||||
'gain_target': None,
|
||||
'tilt_target': 0,
|
||||
})
|
||||
network.add_node(amp)
|
||||
if isinstance(prev_node, elements.Fiber):
|
||||
edgeweight = prev_node.params.length
|
||||
else:
|
||||
edgeweight = 0.01
|
||||
network.add_edge(prev_node, amp, weight=edgeweight)
|
||||
network.add_edge(amp, roadm, weight=0.01)
|
||||
|
||||
def build_network(network):
|
||||
fibers = [f for f in network.nodes() if isinstance(f, Fiber)]
|
||||
|
||||
def add_inline_amplifier(network, fiber):
|
||||
next_node = get_next_node(fiber, network)
|
||||
if isinstance(next_node, elements.Fiber) or isinstance(next_node, elements.RamanFiber):
|
||||
# no amplification for fused spans or TRX
|
||||
network.remove_edge(fiber, next_node)
|
||||
amp = elements.Edfa(
|
||||
uid=f'Edfa_{fiber.uid}',
|
||||
params=EdfaParams.default_values,
|
||||
metadata={
|
||||
'location': {
|
||||
'latitude': (fiber.lat + next_node.lat) / 2,
|
||||
'longitude': (fiber.lng + next_node.lng) / 2,
|
||||
'city': fiber.loc.city,
|
||||
'region': fiber.loc.region,
|
||||
}
|
||||
},
|
||||
operational={
|
||||
'gain_target': None,
|
||||
'tilt_target': 0,
|
||||
})
|
||||
network.add_node(amp)
|
||||
network.add_edge(fiber, amp, weight=fiber.params.length)
|
||||
network.add_edge(amp, next_node, weight=0.01)
|
||||
|
||||
|
||||
def calculate_new_length(fiber_length, bounds, target_length):
|
||||
"""If fiber is over boundary, then assume this is a link "intent" and computes the set of
|
||||
identical fiber spans this link should be composed of.
|
||||
"""
|
||||
if fiber_length < bounds.stop:
|
||||
return fiber_length, 1
|
||||
|
||||
n_spans2 = int(fiber_length // target_length)
|
||||
n_spans1 = n_spans2 + 1
|
||||
|
||||
length1 = fiber_length / n_spans1
|
||||
length2 = fiber_length / n_spans2
|
||||
|
||||
if (bounds.start <= length1 <= bounds.stop) and not(bounds.start <= length2 <= bounds.stop):
|
||||
return (length1, n_spans1)
|
||||
elif (bounds.start <= length2 <= bounds.stop) and not(bounds.start <= length1 <= bounds.stop):
|
||||
return (length2, n_spans2)
|
||||
elif length2 - target_length <= target_length - length1 and length2 <= bounds.stop:
|
||||
return (length2, n_spans2)
|
||||
else:
|
||||
return (length1, n_spans1)
|
||||
|
||||
|
||||
def get_next_node(node, network):
|
||||
"""get_next node else raise tha appropriate error
|
||||
"""
|
||||
try:
|
||||
next_node = next(network.successors(node))
|
||||
return next_node
|
||||
except StopIteration:
|
||||
raise NetworkTopologyError(
|
||||
f'{type(node).__name__} {node.uid} is not properly connected, please check network topology')
|
||||
|
||||
|
||||
def split_fiber(network, fiber, bounds, target_length):
|
||||
"""If fiber length exceeds boundary then assume this is a link "intent", and replace this one-span link
|
||||
with an n_spans link, with identical fiber types.
|
||||
"""
|
||||
new_length, n_spans = calculate_new_length(fiber.params.length, bounds, target_length)
|
||||
if n_spans == 1:
|
||||
return
|
||||
|
||||
try:
|
||||
next_node = next(network.successors(fiber))
|
||||
prev_node = next(network.predecessors(fiber))
|
||||
except StopIteration:
|
||||
raise NetworkTopologyError(f'Fiber {fiber.uid} is not properly connected, please check network topology')
|
||||
|
||||
network.remove_node(fiber)
|
||||
|
||||
fiber.params.length = new_length
|
||||
|
||||
xpos = [prev_node.lng + (next_node.lng - prev_node.lng) * (n + 0.5) / n_spans for n in range(n_spans)]
|
||||
ypos = [prev_node.lat + (next_node.lat - prev_node.lat) * (n + 0.5) / n_spans for n in range(n_spans)]
|
||||
for span, lng, lat in zip(range(n_spans), xpos, ypos):
|
||||
new_span = elements.Fiber(uid=f'{fiber.uid}_({span+1}/{n_spans})',
|
||||
type_variety=fiber.type_variety,
|
||||
metadata={
|
||||
'location': {
|
||||
'latitude': lat,
|
||||
'longitude': lng,
|
||||
'city': fiber.loc.city,
|
||||
'region': fiber.loc.region,
|
||||
}
|
||||
},
|
||||
params=fiber.params.asdict())
|
||||
if isinstance(prev_node, elements.Fiber):
|
||||
edgeweight = prev_node.params.length
|
||||
else:
|
||||
edgeweight = 0.01
|
||||
network.add_edge(prev_node, new_span, weight=edgeweight)
|
||||
prev_node = new_span
|
||||
if isinstance(prev_node, elements.Fiber):
|
||||
edgeweight = prev_node.params.length
|
||||
else:
|
||||
edgeweight = 0.01
|
||||
network.add_edge(prev_node, next_node, weight=edgeweight)
|
||||
|
||||
|
||||
def add_connector_loss(network, fibers, default_con_in, default_con_out, EOL):
|
||||
"""Add default connector loss if no loss are defined. EOL repair margin is added as a connector loss
|
||||
"""
|
||||
for fiber in fibers:
|
||||
network = split_fiber(network, fiber)
|
||||
next_node = get_next_node(fiber, network)
|
||||
if fiber.params.con_in is None:
|
||||
fiber.params.con_in = default_con_in
|
||||
if fiber.params.con_out is None:
|
||||
fiber.params.con_out = default_con_out
|
||||
if not isinstance(next_node, elements.Fused):
|
||||
fiber.params.con_out += EOL
|
||||
|
||||
roadms = [r for r in network.nodes() if isinstance(r, Roadm)]
|
||||
|
||||
def add_fiber_padding(network, fibers, padding, equipment):
|
||||
"""Add a padding att_in at the input of the 1st fiber of a succession of fibers and fused
|
||||
"""
|
||||
for fiber in fibers:
|
||||
next_node = get_next_node(fiber, network)
|
||||
if isinstance(next_node, elements.Fused):
|
||||
continue
|
||||
# do not pad if this is a Raman Fiber
|
||||
if isinstance(fiber, elements.RamanFiber):
|
||||
continue
|
||||
this_span_loss = span_loss(network, fiber, equipment)
|
||||
fiber.design_span_loss = this_span_loss
|
||||
if this_span_loss < padding:
|
||||
# add a padding att_in at the input of the 1st fiber:
|
||||
# address the case when several fibers are spliced together
|
||||
first_fiber = find_first_node(network, fiber)
|
||||
# in order to support no booster , fused might be placed
|
||||
# just after a roadm: need to check that first_fiber is really a fiber
|
||||
if isinstance(first_fiber, elements.Fiber):
|
||||
first_fiber.params.att_in = first_fiber.params.att_in + padding - this_span_loss
|
||||
fiber.design_span_loss += first_fiber.params.att_in
|
||||
|
||||
|
||||
def add_missing_elements_in_network(network, equipment):
|
||||
"""Autodesign network: add missing elements. split fibers if their length is too big
|
||||
add ROADM preamp or booster and inline amplifiers between fibers
|
||||
"""
|
||||
default_span_data = equipment['Span']['default']
|
||||
max_length = int(convert_length(default_span_data.max_length, default_span_data.length_units))
|
||||
min_length = max(int(default_span_data.padding / 0.2 * 1e3), 50_000)
|
||||
bounds = range(min_length, max_length)
|
||||
target_length = max(min_length, min(max_length, 90_000))
|
||||
fibers = [f for f in network.nodes() if isinstance(f, elements.Fiber)]
|
||||
for fiber in fibers:
|
||||
split_fiber(network, fiber, bounds, target_length)
|
||||
roadms = [r for r in network.nodes() if isinstance(r, elements.Roadm)]
|
||||
for roadm in roadms:
|
||||
add_egress_amplifier(network, roadm)
|
||||
add_roadm_preamp(network, roadm)
|
||||
add_roadm_booster(network, roadm)
|
||||
fibers = [f for f in network.nodes() if isinstance(f, elements.Fiber)]
|
||||
for fiber in fibers:
|
||||
add_inline_amplifier(network, fiber)
|
||||
|
||||
|
||||
def add_missing_fiber_attributes(network, equipment):
|
||||
"""Fill in connector loss with default values. Add the padding loss is required.
|
||||
EOL is added as a connector loss
|
||||
"""
|
||||
default_span_data = equipment['Span']['default']
|
||||
fibers = [f for f in network.nodes() if isinstance(f, elements.Fiber)]
|
||||
add_connector_loss(network, fibers, default_span_data.con_in, default_span_data.con_out, default_span_data.EOL)
|
||||
# don't group split fiber and add amp in the same loop
|
||||
# =>for code clarity (at the expense of speed):
|
||||
add_fiber_padding(network, fibers, default_span_data.padding, equipment)
|
||||
|
||||
|
||||
def build_network(network, equipment, pref_ch_db, pref_total_db, set_connector_losses=True, verbose=True):
|
||||
"""Set roadm equalization target and amplifier gain and power
|
||||
"""
|
||||
roadms = [r for r in network.nodes() if isinstance(r, elements.Roadm)]
|
||||
transceivers = [t for t in network.nodes() if isinstance(t, elements.Transceiver)]
|
||||
|
||||
if set_connector_losses:
|
||||
add_missing_fiber_attributes(network, equipment)
|
||||
# set roadm equalization targets first
|
||||
for roadm in roadms:
|
||||
set_roadm_ref_carrier(roadm, equipment)
|
||||
set_roadm_per_degree_targets(roadm, network)
|
||||
# then set amplifiers gain, delta_p and out_voa on each OMS
|
||||
for roadm in roadms + transceivers:
|
||||
set_egress_amplifier(network, roadm, equipment, pref_ch_db, pref_total_db, verbose)
|
||||
for roadm in roadms:
|
||||
set_roadm_input_powers(network, roadm, equipment, pref_ch_db)
|
||||
set_roadm_internal_paths(roadm, network)
|
||||
for fiber in [f for f in network.nodes() if isinstance(f, (elements.Fiber, elements.RamanFiber))]:
|
||||
set_fiber_input_power(network, fiber, equipment, pref_ch_db)
|
||||
|
||||
|
||||
def design_network(reference_channel, network, equipment, set_connector_losses=True, verbose=True):
|
||||
"""Network is designed according to reference channel. Verbose indicate if the function should
|
||||
print all warnings or not
|
||||
"""
|
||||
pref_ch_db = watt2dbm(reference_channel.power) # reference channel power
|
||||
pref_total_db = pref_ch_db + lin2db(reference_channel.nb_channel) # reference total power
|
||||
build_network(network, equipment, pref_ch_db, pref_total_db, set_connector_losses=set_connector_losses,
|
||||
verbose=verbose)
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
#! /bin/usr/python3
|
||||
|
||||
'''
|
||||
gnpy.core.node
|
||||
==============
|
||||
|
||||
This module contains the base class for a network element.
|
||||
|
||||
Strictly, a network element is any callable which accepts an immutable
|
||||
.info.SpectralInformation object and returns a .info.SpectralInformation object
|
||||
(a copy.)
|
||||
|
||||
Network elements MUST implement two attributes .uid and .name representing a
|
||||
unique identifier and a printable name.
|
||||
|
||||
This base class provides a mode convenient way to define a network element
|
||||
via subclassing.
|
||||
'''
|
||||
|
||||
|
||||
from uuid import uuid4
|
||||
from gnpy.core.utils import load_json
|
||||
|
||||
|
||||
class ConfigStruct:
|
||||
|
||||
def __init__(self, **config):
|
||||
if config is None:
|
||||
return None
|
||||
if 'config_from_json' in config:
|
||||
json_config = load_json(config['config_from_json'])
|
||||
self.set_config_attr(json_config)
|
||||
|
||||
self.set_config_attr(config)
|
||||
|
||||
def set_config_attr(self, config):
|
||||
for k, v in config.items():
|
||||
setattr(self, k, ConfigStruct(**v)
|
||||
if isinstance(v, dict) else v)
|
||||
|
||||
def __repr__(self):
|
||||
return f'{self.__dict__}'
|
||||
|
||||
|
||||
class Node:
|
||||
|
||||
def __init__(self, config=None):
|
||||
self.config = ConfigStruct(**config)
|
||||
if self.config is None or not hasattr(self.config, 'uid'):
|
||||
self.uid = uuid4()
|
||||
else:
|
||||
self.uid = self.config.uid
|
||||
if hasattr(self.config, 'params'):
|
||||
self.params = self.config.params
|
||||
if hasattr(self.config, 'metadata'):
|
||||
self.metadata = self.config.metadata
|
||||
if hasattr(self.config, 'operational'):
|
||||
self.operational = self.config.operational
|
||||
|
||||
@property
|
||||
def coords(self):
|
||||
return tuple(self.lng, self.lat)
|
||||
|
||||
@property
|
||||
def location(self):
|
||||
return self.config.metadata.location
|
||||
|
||||
@property
|
||||
def loc(self): # Aliases .location
|
||||
return self.location
|
||||
|
||||
@property
|
||||
def lng(self):
|
||||
return self.config.metadata.location.longitude
|
||||
|
||||
@property
|
||||
def lat(self):
|
||||
return self.config.metadata.location.latitude
|
||||
616
gnpy/core/parameters.py
Normal file
616
gnpy/core/parameters.py
Normal file
@@ -0,0 +1,616 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
gnpy.core.parameters
|
||||
====================
|
||||
|
||||
This module contains all parameters to configure standard network elements.
|
||||
"""
|
||||
from collections import namedtuple
|
||||
|
||||
from scipy.constants import c, pi
|
||||
from numpy import asarray, array, exp, sqrt, log, outer, ones, squeeze, append, flip, linspace, full
|
||||
|
||||
from gnpy.core.utils import convert_length
|
||||
from gnpy.core.exceptions import ParametersError
|
||||
|
||||
|
||||
class Parameters:
|
||||
def asdict(self):
|
||||
class_dict = self.__class__.__dict__
|
||||
instance_dict = self.__dict__
|
||||
new_dict = {}
|
||||
for key in class_dict:
|
||||
if isinstance(class_dict[key], property):
|
||||
new_dict[key] = instance_dict['_' + key]
|
||||
return new_dict
|
||||
|
||||
|
||||
class PumpParams(Parameters):
|
||||
def __init__(self, power, frequency, propagation_direction):
|
||||
self.power = power
|
||||
self.frequency = frequency
|
||||
self.propagation_direction = propagation_direction.lower()
|
||||
|
||||
|
||||
class RamanParams(Parameters):
|
||||
def __init__(self, flag=False, result_spatial_resolution=10e3, solver_spatial_resolution=50):
|
||||
"""Simulation parameters used within the Raman Solver
|
||||
|
||||
:params flag: boolean for enabling/disable the evaluation of the Raman power profile in frequency and position
|
||||
:params result_spatial_resolution: spatial resolution of the evaluated Raman power profile
|
||||
:params solver_spatial_resolution: spatial step for the iterative solution of the first order ode
|
||||
"""
|
||||
self.flag = flag
|
||||
self.result_spatial_resolution = result_spatial_resolution # [m]
|
||||
self.solver_spatial_resolution = solver_spatial_resolution # [m]
|
||||
|
||||
def to_json(self):
|
||||
return {"flag": self.flag,
|
||||
"result_spatial_resolution": self.result_spatial_resolution,
|
||||
"solver_spatial_resolution": self.solver_spatial_resolution}
|
||||
|
||||
|
||||
class NLIParams(Parameters):
|
||||
def __init__(self, method='gn_model_analytic', dispersion_tolerance=1, phase_shift_tolerance=0.1,
|
||||
computed_channels=None, computed_number_of_channels=None):
|
||||
"""Simulation parameters used within the Nli Solver
|
||||
|
||||
:params method: formula for NLI calculation
|
||||
:params dispersion_tolerance: tuning parameter for ggn model solution
|
||||
:params phase_shift_tolerance: tuning parameter for ggn model solution
|
||||
:params computed_channels: the NLI is evaluated for these channels and extrapolated for the others
|
||||
:params computed_number_of_channels: the NLI is evaluated for this number of channels equally distributed
|
||||
in the spectrum and extrapolated for the others
|
||||
"""
|
||||
self.method = method.lower()
|
||||
self.dispersion_tolerance = dispersion_tolerance
|
||||
self.phase_shift_tolerance = phase_shift_tolerance
|
||||
self.computed_channels = computed_channels
|
||||
self.computed_number_of_channels = computed_number_of_channels
|
||||
|
||||
def to_json(self):
|
||||
return {"method": self.method,
|
||||
"dispersion_tolerance": self.dispersion_tolerance,
|
||||
"phase_shift_tolerance": self.phase_shift_tolerance,
|
||||
"computed_channels": self.computed_channels,
|
||||
"computed_number_of_channels": self.computed_number_of_channels}
|
||||
|
||||
|
||||
class SimParams(Parameters):
|
||||
_shared_dict = {'nli_params': NLIParams(), 'raman_params': RamanParams()}
|
||||
|
||||
@classmethod
|
||||
def set_params(cls, sim_params):
|
||||
cls._shared_dict['nli_params'] = NLIParams(**sim_params.get('nli_params', {}))
|
||||
cls._shared_dict['raman_params'] = RamanParams(**sim_params.get('raman_params', {}))
|
||||
|
||||
@property
|
||||
def nli_params(self):
|
||||
return self._shared_dict['nli_params']
|
||||
|
||||
@property
|
||||
def raman_params(self):
|
||||
return self._shared_dict['raman_params']
|
||||
|
||||
|
||||
class RoadmParams(Parameters):
|
||||
def __init__(self, **kwargs):
|
||||
self.target_pch_out_db = kwargs.get('target_pch_out_db')
|
||||
self.target_psd_out_mWperGHz = kwargs.get('target_psd_out_mWperGHz')
|
||||
self.target_out_mWperSlotWidth = kwargs.get('target_out_mWperSlotWidth')
|
||||
equalisation_type = ['target_pch_out_db', 'target_psd_out_mWperGHz', 'target_out_mWperSlotWidth']
|
||||
temp = [kwargs.get(k) is not None for k in equalisation_type]
|
||||
if sum(temp) > 1:
|
||||
raise ParametersError('ROADM config contains more than one equalisation type.'
|
||||
+ 'Please choose only one', kwargs)
|
||||
self.per_degree_pch_out_db = kwargs.get('per_degree_pch_out_db', {})
|
||||
self.per_degree_pch_psd = kwargs.get('per_degree_psd_out_mWperGHz', {})
|
||||
self.per_degree_pch_psw = kwargs.get('per_degree_psd_out_mWperSlotWidth', {})
|
||||
try:
|
||||
self.add_drop_osnr = kwargs['add_drop_osnr']
|
||||
self.pmd = kwargs['pmd']
|
||||
self.pdl = kwargs['pdl']
|
||||
self.restrictions = kwargs['restrictions']
|
||||
self.roadm_path_impairments = self.get_roadm_path_impairments(kwargs['roadm-path-impairments'])
|
||||
except KeyError as e:
|
||||
raise ParametersError(f'ROADM configurations must include {e}. Configuration: {kwargs}')
|
||||
self.per_degree_impairments = kwargs.get('per_degree_impairments', [])
|
||||
|
||||
def get_roadm_path_impairments(self, path_impairments_list):
|
||||
"""Get the ROADM list of profiles for impairments definition
|
||||
|
||||
transform the ietf model into gnpy internal model: add a path-type in the attributes
|
||||
"""
|
||||
if not path_impairments_list:
|
||||
return {}
|
||||
authorized_path_types = {
|
||||
'roadm-express-path': 'express',
|
||||
'roadm-add-path': 'add',
|
||||
'roadm-drop-path': 'drop',
|
||||
}
|
||||
roadm_path_impairments = {}
|
||||
for path_impairment in path_impairments_list:
|
||||
index = path_impairment['roadm-path-impairments-id']
|
||||
path_type = next(key for key in path_impairment if key in authorized_path_types.keys())
|
||||
impairment_dict = dict({'path-type': authorized_path_types[path_type]}, **path_impairment[path_type][0])
|
||||
roadm_path_impairments[index] = RoadmImpairment(impairment_dict)
|
||||
return roadm_path_impairments
|
||||
|
||||
|
||||
class RoadmPath:
|
||||
def __init__(self, from_degree, to_degree, path_type, impairment_id=None, impairment=None):
|
||||
"""Records roadm internal paths, types and impairment
|
||||
|
||||
path_type must be in "express", "add", "drop"
|
||||
impairment_id must be one of the id detailed in equipement
|
||||
"""
|
||||
self.from_degree = from_degree
|
||||
self.to_degree = to_degree
|
||||
self.path_type = path_type
|
||||
self.impairment_id = impairment_id
|
||||
self.impairment = impairment
|
||||
|
||||
|
||||
class RoadmImpairment:
|
||||
"""Generic definition of impairments for express, add and drop"""
|
||||
def __init__(self, params):
|
||||
"""Records roadm internal paths and types"""
|
||||
self.path_type = params.get('path-type')
|
||||
self.pmd = params.get('roadm-pmd')
|
||||
self.cd = params.get('roadm-cd')
|
||||
self.pdl = params.get('roadm-pdl')
|
||||
self.inband_crosstalk = params.get('roadm-inband-crosstalk')
|
||||
self.maxloss = params.get('roadm-maxloss', 0)
|
||||
if params.get('frequency-range') is not None:
|
||||
self.fmin = params.get('frequency-range')['lower-frequency']
|
||||
self.fmax = params.get('frequency-range')['upper-frequency']
|
||||
else:
|
||||
self.fmin, self.fmax = None, None
|
||||
self.osnr = params.get('roadm-osnr', None)
|
||||
self.pmax = params.get('roadm-pmax', None)
|
||||
self.nf = params.get('roadm-noise-figure', None)
|
||||
self.minloss = params.get('minloss', None)
|
||||
self.typloss = params.get('typloss', None)
|
||||
self.pmin = params.get('pmin', None)
|
||||
self.ptyp = params.get('ptyp', None)
|
||||
|
||||
|
||||
class FusedParams(Parameters):
|
||||
def __init__(self, **kwargs):
|
||||
self.loss = kwargs['loss'] if 'loss' in kwargs else 1
|
||||
|
||||
|
||||
DEFAULT_RAMAN_COEFFICIENT = {
|
||||
# SSMF Raman coefficient profile in terms of mode intensity (g0 * A_ff_overlap)
|
||||
'gamma_raman': array(
|
||||
[0.0, 8.524419934705497e-16, 2.643567866245371e-15, 4.410548410941305e-15, 6.153422961291078e-15,
|
||||
7.484924703044943e-15, 8.452060808349209e-15, 9.101549322698156e-15, 9.57837595158966e-15,
|
||||
1.0008642675474562e-14, 1.0865773569905647e-14, 1.1300776305865833e-14, 1.2143238647099625e-14,
|
||||
1.3231065750676068e-14, 1.4624900971525384e-14, 1.6013330554840492e-14, 1.7458119359310242e-14,
|
||||
1.9320241330434762e-14, 2.1720395392873534e-14, 2.4137337406734775e-14, 2.628163218460466e-14,
|
||||
2.8041019963285974e-14, 2.9723155447089933e-14, 3.129353531005888e-14, 3.251796163324624e-14,
|
||||
3.3198839487612773e-14, 3.329527690685666e-14, 3.313155691238456e-14, 3.289013852154548e-14,
|
||||
3.2458917188506916e-14, 3.060684277937575e-14, 3.2660349473783173e-14, 2.957419109657689e-14,
|
||||
2.518894321396672e-14, 1.734560485857344e-14, 9.902860761605233e-15, 7.219176385099358e-15,
|
||||
6.079565990401311e-15, 5.828373065963427e-15, 7.20580801091692e-15, 7.561924351387493e-15,
|
||||
7.621152352332206e-15, 6.8859886780643254e-15, 5.629181047471162e-15, 3.679727598966185e-15,
|
||||
2.7555869742500355e-15, 2.4810133942597675e-15, 2.2160080532403624e-15, 2.1440626024765557e-15,
|
||||
2.33873070799544e-15, 2.557317929858713e-15, 3.039839048226572e-15, 4.8337165515610065e-15,
|
||||
5.4647431818257436e-15, 5.229187813711269e-15, 4.510768525811313e-15, 3.3213473130607794e-15,
|
||||
2.2602577027996455e-15, 1.969576495866441e-15, 1.5179853954188527e-15, 1.2953988551200156e-15,
|
||||
1.1304672156251838e-15, 9.10004390675213e-16, 8.432919922183503e-16, 7.849224069008326e-16,
|
||||
7.827568196032024e-16, 9.000514440646232e-16, 1.3025926460013665e-15, 1.5444108938497558e-15,
|
||||
1.8795594063060786e-15, 1.7796130169921014e-15, 1.5938159865046653e-15, 1.1585522355108287e-15,
|
||||
8.507044444633358e-16, 7.625404663756823e-16, 8.14510750925789e-16, 9.047944693473188e-16,
|
||||
9.636431901702084e-16, 9.298633899602105e-16, 8.349739503637023e-16, 7.482901278066085e-16,
|
||||
6.240794767134268e-16, 5.00652535687506e-16, 3.553373263685851e-16, 2.0344217706119682e-16,
|
||||
1.4267522642294203e-16, 8.980016576743517e-17, 2.9829068181832594e-17, 1.4861959129014824e-17,
|
||||
7.404482113326137e-18]
|
||||
), # m/W
|
||||
# SSMF Raman coefficient profile
|
||||
'g0': array(
|
||||
[0.00000000e+00, 1.12351610e-05, 3.47838074e-05, 5.79356636e-05, 8.06921680e-05, 9.79845709e-05, 1.10454361e-04,
|
||||
1.18735302e-04, 1.24736889e-04, 1.30110053e-04, 1.41001273e-04, 1.46383247e-04, 1.57011792e-04, 1.70765865e-04,
|
||||
1.88408911e-04, 2.05914127e-04, 2.24074028e-04, 2.47508283e-04, 2.77729174e-04, 3.08044243e-04, 3.34764439e-04,
|
||||
3.56481704e-04, 3.77127256e-04, 3.96269124e-04, 4.10955175e-04, 4.18718761e-04, 4.19511263e-04, 4.17025384e-04,
|
||||
4.13565369e-04, 4.07726048e-04, 3.83671291e-04, 4.08564283e-04, 3.69571936e-04, 3.14442090e-04, 2.16074535e-04,
|
||||
1.23097823e-04, 8.95457457e-05, 7.52470400e-05, 7.19806145e-05, 8.87961158e-05, 9.30812065e-05, 9.37058268e-05,
|
||||
8.45719619e-05, 6.90585286e-05, 4.50407159e-05, 3.36521245e-05, 3.02292475e-05, 2.69376939e-05, 2.60020897e-05,
|
||||
2.82958958e-05, 3.08667558e-05, 3.66024657e-05, 5.80610307e-05, 6.54797937e-05, 6.25022715e-05, 5.37806442e-05,
|
||||
3.94996621e-05, 2.68120644e-05, 2.33038554e-05, 1.79140757e-05, 1.52472424e-05, 1.32707565e-05, 1.06541760e-05,
|
||||
9.84649374e-06, 9.13999627e-06, 9.08971012e-06, 1.04227525e-05, 1.50419271e-05, 1.77838232e-05, 2.15810815e-05,
|
||||
2.03744008e-05, 1.81939341e-05, 1.31862121e-05, 9.65352116e-06, 8.62698322e-06, 9.18688016e-06, 1.01737784e-05,
|
||||
1.08017817e-05, 1.03903588e-05, 9.30040333e-06, 8.30809173e-06, 6.90650401e-06, 5.52238029e-06, 3.90648708e-06,
|
||||
2.22908227e-06, 1.55796177e-06, 9.77218716e-07, 3.23477236e-07, 1.60602454e-07, 7.97306386e-08]
|
||||
), # [1 / (W m)]
|
||||
|
||||
# Note the non-uniform spacing of this range; this is required for properly capturing the Raman peak shape.
|
||||
'frequency_offset': array([
|
||||
0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5,
|
||||
12., 12.5, 12.75, 13., 13.25, 13.5, 14., 14.5, 14.75, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.25, 18.5, 18.75,
|
||||
19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5,
|
||||
29., 29.5, 30., 30.5, 31., 31.5, 32., 32.5, 33., 33.5, 34., 34.5, 35., 35.5, 36., 36.5, 37., 37.5, 38., 38.5,
|
||||
39., 39.5, 40., 40.5, 41., 41.5, 42.]) * 1e12, # [Hz]
|
||||
|
||||
# Raman profile reference frequency
|
||||
'reference_frequency': 206.184634112792e12, # [Hz] (1454 nm)
|
||||
|
||||
# Raman profile reference effective area
|
||||
'reference_effective_area': 75.74659443542413e-12 # [m^2] (@1454 nm)
|
||||
}
|
||||
|
||||
|
||||
class RamanGainCoefficient(namedtuple('RamanGainCoefficient', 'normalized_gamma_raman frequency_offset')):
|
||||
""" Raman Gain Coefficient Parameters
|
||||
|
||||
Based on:
|
||||
Andrea D’Amico, Bruno Correia, Elliot London, Emanuele Virgillito, Giacomo Borraccini, Antonio Napoli,
|
||||
and Vittorio Curri, "Scalable and Disaggregated GGN Approximation Applied to a C+L+S Optical Network,"
|
||||
J. Lightwave Technol. 40, 3499-3511 (2022)
|
||||
Section III.D
|
||||
"""
|
||||
|
||||
|
||||
class FiberParams(Parameters):
|
||||
def __init__(self, **kwargs):
|
||||
try:
|
||||
self._length = convert_length(kwargs['length'], kwargs['length_units'])
|
||||
# fixed attenuator for padding
|
||||
self._att_in = kwargs.get('att_in', 0)
|
||||
# if not defined in the network json connector loss in/out
|
||||
# the None value will be updated in network.py[build_network]
|
||||
# with default values from eqpt_config.json[Spans]
|
||||
self._con_in = kwargs.get('con_in')
|
||||
self._con_out = kwargs.get('con_out')
|
||||
|
||||
# Reference frequency (unique for all parameters: beta2, beta3, gamma, effective_area)
|
||||
if 'ref_wavelength' in kwargs:
|
||||
self._ref_wavelength = kwargs['ref_wavelength']
|
||||
self._ref_frequency = c / self._ref_wavelength
|
||||
elif 'ref_frequency' in kwargs:
|
||||
self._ref_frequency = kwargs['ref_frequency']
|
||||
self._ref_wavelength = c / self._ref_frequency
|
||||
else:
|
||||
self._ref_wavelength = 1550e-9 # conventional central C band wavelength [m]
|
||||
self._ref_frequency = c / self._ref_wavelength
|
||||
|
||||
# Chromatic Dispersion
|
||||
if 'dispersion_per_frequency' in kwargs:
|
||||
# Frequency-dependent dispersion
|
||||
self._dispersion = asarray(kwargs['dispersion_per_frequency']['value']) # s/m/m
|
||||
self._f_dispersion_ref = asarray(kwargs['dispersion_per_frequency']['frequency']) # Hz
|
||||
self._dispersion_slope = None
|
||||
elif 'dispersion' in kwargs:
|
||||
# Single value dispersion
|
||||
self._dispersion = asarray(kwargs['dispersion']) # s/m/m
|
||||
self._dispersion_slope = kwargs.get('dispersion_slope') # s/m/m/m
|
||||
self._f_dispersion_ref = asarray(self._ref_frequency) # Hz
|
||||
else:
|
||||
# Default single value dispersion
|
||||
self._dispersion = asarray(1.67e-05) # s/m/m
|
||||
self._dispersion_slope = None
|
||||
self._f_dispersion_ref = asarray(self.ref_frequency) # Hz
|
||||
|
||||
# Effective Area and Nonlinear Coefficient
|
||||
self._effective_area = kwargs.get('effective_area') # m^2
|
||||
self._n1 = 1.468
|
||||
self._core_radius = 4.2e-6 # m
|
||||
self._n2 = 2.6e-20 # m^2/W
|
||||
if self._effective_area is not None:
|
||||
default_gamma = 2 * pi * self._n2 / (self._ref_wavelength * self._effective_area)
|
||||
self._gamma = kwargs.get('gamma', default_gamma) # 1/W/m
|
||||
elif 'gamma' in kwargs:
|
||||
self._gamma = kwargs['gamma'] # 1/W/m
|
||||
self._effective_area = 2 * pi * self._n2 / (self._ref_wavelength * self._gamma) # m^2
|
||||
else:
|
||||
self._effective_area = 83e-12 # m^2
|
||||
self._gamma = 2 * pi * self._n2 / (self._ref_wavelength * self._effective_area) # 1/W/m
|
||||
self._contrast = 0.5 * (c / (2 * pi * self._ref_frequency * self._core_radius * self._n1) * exp(
|
||||
pi * self._core_radius ** 2 / self._effective_area)) ** 2
|
||||
|
||||
# Raman Gain Coefficient
|
||||
raman_coefficient = kwargs.get('raman_coefficient')
|
||||
if raman_coefficient is None:
|
||||
self._raman_reference_frequency = DEFAULT_RAMAN_COEFFICIENT['reference_frequency']
|
||||
frequency_offset = asarray(DEFAULT_RAMAN_COEFFICIENT['frequency_offset'])
|
||||
gamma_raman = asarray(DEFAULT_RAMAN_COEFFICIENT['gamma_raman'])
|
||||
stokes_wave = self._raman_reference_frequency - frequency_offset
|
||||
normalized_gamma_raman = gamma_raman / self._raman_reference_frequency # 1 / m / W / Hz
|
||||
self._g0 = gamma_raman / self.effective_area_overlap(stokes_wave, self._raman_reference_frequency)
|
||||
else:
|
||||
self._raman_reference_frequency = raman_coefficient['reference_frequency']
|
||||
frequency_offset = asarray(raman_coefficient['frequency_offset'])
|
||||
stokes_wave = self._raman_reference_frequency - frequency_offset
|
||||
self._g0 = asarray(raman_coefficient['g0'])
|
||||
gamma_raman = self._g0 * self.effective_area_overlap(stokes_wave, self._raman_reference_frequency)
|
||||
normalized_gamma_raman = gamma_raman / self._raman_reference_frequency # 1 / m / W / Hz
|
||||
|
||||
# Raman gain coefficient array of the frequency offset constructed such that positive frequency values
|
||||
# represent a positive power transfer from higher frequency and vice versa
|
||||
frequency_offset = append(-flip(frequency_offset[1:]), frequency_offset)
|
||||
normalized_gamma_raman = append(- flip(normalized_gamma_raman[1:]), normalized_gamma_raman)
|
||||
self._raman_coefficient = RamanGainCoefficient(normalized_gamma_raman, frequency_offset)
|
||||
|
||||
# Polarization Mode Dispersion
|
||||
self._pmd_coef = kwargs['pmd_coef'] # s/sqrt(m)
|
||||
|
||||
# Loss Coefficient
|
||||
if isinstance(kwargs['loss_coef'], dict):
|
||||
self._loss_coef = asarray(kwargs['loss_coef']['value']) * 1e-3 # lineic loss dB/m
|
||||
self._f_loss_ref = asarray(kwargs['loss_coef']['frequency']) # Hz
|
||||
else:
|
||||
self._loss_coef = asarray(kwargs['loss_coef']) * 1e-3 # lineic loss dB/m
|
||||
self._f_loss_ref = asarray(self._ref_frequency) # Hz
|
||||
# Lumped Losses
|
||||
self._lumped_losses = kwargs['lumped_losses'] if 'lumped_losses' in kwargs else array([])
|
||||
self._latency = self._length / (c / self._n1) # s
|
||||
except KeyError as e:
|
||||
raise ParametersError(f'Fiber configurations json must include {e}. Configuration: {kwargs}')
|
||||
|
||||
@property
|
||||
def length(self):
|
||||
return self._length
|
||||
|
||||
@length.setter
|
||||
def length(self, length):
|
||||
"""length must be in m"""
|
||||
self._length = length
|
||||
|
||||
@property
|
||||
def att_in(self):
|
||||
return self._att_in
|
||||
|
||||
@att_in.setter
|
||||
def att_in(self, att_in):
|
||||
self._att_in = att_in
|
||||
|
||||
@property
|
||||
def con_in(self):
|
||||
return self._con_in
|
||||
|
||||
@con_in.setter
|
||||
def con_in(self, con_in):
|
||||
self._con_in = con_in
|
||||
|
||||
@property
|
||||
def con_out(self):
|
||||
return self._con_out
|
||||
|
||||
@property
|
||||
def lumped_losses(self):
|
||||
return self._lumped_losses
|
||||
|
||||
@con_out.setter
|
||||
def con_out(self, con_out):
|
||||
self._con_out = con_out
|
||||
|
||||
@property
|
||||
def dispersion(self):
|
||||
return self._dispersion
|
||||
|
||||
@property
|
||||
def f_dispersion_ref(self):
|
||||
return self._f_dispersion_ref
|
||||
|
||||
@property
|
||||
def dispersion_slope(self):
|
||||
return self._dispersion_slope
|
||||
|
||||
@property
|
||||
def gamma(self):
|
||||
return self._gamma
|
||||
|
||||
def effective_area_scaling(self, frequency):
|
||||
V = 2 * pi * frequency / c * self._core_radius * self._n1 * sqrt(2 * self._contrast)
|
||||
w = self._core_radius / sqrt(log(V))
|
||||
return asarray(pi * w ** 2)
|
||||
|
||||
def effective_area_overlap(self, frequency_stokes_wave, frequency_pump):
|
||||
effective_area_stokes_wave = self.effective_area_scaling(frequency_stokes_wave)
|
||||
effective_area_pump = self.effective_area_scaling(frequency_pump)
|
||||
return squeeze(outer(effective_area_stokes_wave, ones(effective_area_pump.size)) + outer(
|
||||
ones(effective_area_stokes_wave.size), effective_area_pump)) / 2
|
||||
|
||||
def gamma_scaling(self, frequency):
|
||||
return asarray(2 * pi * self._n2 * frequency / (c * self.effective_area_scaling(frequency)))
|
||||
|
||||
@property
|
||||
def pmd_coef(self):
|
||||
return self._pmd_coef
|
||||
|
||||
@property
|
||||
def ref_wavelength(self):
|
||||
return self._ref_wavelength
|
||||
|
||||
@property
|
||||
def ref_frequency(self):
|
||||
return self._ref_frequency
|
||||
|
||||
@property
|
||||
def loss_coef(self):
|
||||
return self._loss_coef
|
||||
|
||||
@property
|
||||
def f_loss_ref(self):
|
||||
return self._f_loss_ref
|
||||
|
||||
@property
|
||||
def raman_coefficient(self):
|
||||
return self._raman_coefficient
|
||||
|
||||
@property
|
||||
def latency(self):
|
||||
return self._latency
|
||||
|
||||
def asdict(self):
|
||||
dictionary = super().asdict()
|
||||
dictionary['loss_coef'] = self.loss_coef * 1e3
|
||||
dictionary['length_units'] = 'm'
|
||||
if len(self.lumped_losses) == 0:
|
||||
dictionary.pop('lumped_losses')
|
||||
if not self.raman_coefficient:
|
||||
dictionary.pop('raman_coefficient')
|
||||
else:
|
||||
raman_frequency_offset = \
|
||||
self.raman_coefficient.frequency_offset[self.raman_coefficient.frequency_offset >= 0]
|
||||
dictionary['raman_coefficient'] = {'g0': self._g0.tolist(),
|
||||
'frequency_offset': raman_frequency_offset.tolist(),
|
||||
'reference_frequency': self._raman_reference_frequency}
|
||||
return dictionary
|
||||
|
||||
|
||||
class EdfaParams:
|
||||
default_values = {
|
||||
'f_min': 191.3e12,
|
||||
'f_max': 196.1e12,
|
||||
'multi_band': None,
|
||||
'bands': [],
|
||||
'type_variety': '',
|
||||
'type_def': '',
|
||||
'gain_flatmax': None,
|
||||
'gain_min': None,
|
||||
'p_max': None,
|
||||
'nf_model': None,
|
||||
'dual_stage_model': None,
|
||||
'preamp_variety': None,
|
||||
'booster_variety': None,
|
||||
'nf_min': None,
|
||||
'nf_max': None,
|
||||
'nf_coef': None,
|
||||
'nf0': None,
|
||||
'nf_fit_coeff': None,
|
||||
'nf_ripple': 0,
|
||||
'dgt': None,
|
||||
'gain_ripple': 0,
|
||||
'tilt_ripple': 0,
|
||||
'f_ripple_ref': None,
|
||||
'out_voa_auto': False,
|
||||
'allowed_for_design': False,
|
||||
'raman': False,
|
||||
'pmd': 0,
|
||||
'pdl': 0,
|
||||
'advance_configurations_from_json': None
|
||||
}
|
||||
|
||||
def __init__(self, **params):
|
||||
try:
|
||||
self.type_variety = params['type_variety']
|
||||
self.type_def = params['type_def']
|
||||
|
||||
# Bandwidth
|
||||
self.f_min = params['f_min']
|
||||
self.f_max = params['f_max']
|
||||
self.bandwidth = self.f_max - self.f_min
|
||||
self.f_cent = (self.f_max + self.f_min) / 2
|
||||
self.f_ripple_ref = params['f_ripple_ref']
|
||||
|
||||
# Gain
|
||||
self.gain_flatmax = params['gain_flatmax']
|
||||
self.gain_min = params['gain_min']
|
||||
|
||||
gain_ripple = params['gain_ripple']
|
||||
if gain_ripple == 0:
|
||||
self.gain_ripple = asarray([0, 0])
|
||||
self.f_ripple_ref = asarray([self.f_min, self.f_max])
|
||||
else:
|
||||
self.gain_ripple = asarray(gain_ripple)
|
||||
if self.f_ripple_ref is not None:
|
||||
if (self.f_ripple_ref[0] != self.f_min) or (self.f_ripple_ref[-1] != self.f_max):
|
||||
raise ParametersError("The reference ripple frequency maximum and minimum have to coincide "
|
||||
"with the EDFA frequency maximum and minimum.")
|
||||
elif self.gain_ripple.size != self.f_ripple_ref.size:
|
||||
raise ParametersError("The reference ripple frequency and the gain ripple must have the same "
|
||||
"size.")
|
||||
else:
|
||||
self.f_ripple_ref = linspace(self.f_min, self.f_max, self.gain_ripple.size)
|
||||
|
||||
tilt_ripple = params['tilt_ripple']
|
||||
|
||||
if tilt_ripple == 0:
|
||||
self.tilt_ripple = full(self.gain_ripple.size, 0)
|
||||
else:
|
||||
self.tilt_ripple = asarray(tilt_ripple)
|
||||
if self.tilt_ripple.size != self.gain_ripple.size:
|
||||
raise ParametersError("The tilt ripple and the gain ripple must have the same size.")
|
||||
|
||||
# Power
|
||||
self.p_max = params['p_max']
|
||||
|
||||
# Noise Figure
|
||||
self.nf_model = params['nf_model']
|
||||
self.nf_min = params['nf_min']
|
||||
self.nf_max = params['nf_max']
|
||||
self.nf_coef = params['nf_coef']
|
||||
self.nf0 = params['nf0']
|
||||
self.nf_fit_coeff = params['nf_fit_coeff']
|
||||
|
||||
nf_ripple = params['nf_ripple']
|
||||
if nf_ripple == 0:
|
||||
self.nf_ripple = full(self.gain_ripple.size, 0)
|
||||
else:
|
||||
self.nf_ripple = asarray(nf_ripple)
|
||||
if self.nf_ripple.size != self.gain_ripple.size:
|
||||
raise ParametersError("The noise figure ripple and the gain ripple must have the same size.")
|
||||
|
||||
# VOA
|
||||
self.out_voa_auto = params['out_voa_auto']
|
||||
|
||||
# Dual Stage
|
||||
self.dual_stage_model = params['dual_stage_model']
|
||||
if self.dual_stage_model is not None:
|
||||
# Preamp
|
||||
self.preamp_variety = params['preamp_variety']
|
||||
self.preamp_type_def = params['preamp_type_def']
|
||||
self.preamp_nf_model = params['preamp_nf_model']
|
||||
self.preamp_nf_fit_coeff = params['preamp_nf_fit_coeff']
|
||||
self.preamp_gain_min = params['preamp_gain_min']
|
||||
self.preamp_gain_flatmax = params['preamp_gain_flatmax']
|
||||
|
||||
# Booster
|
||||
self.booster_variety = params['booster_variety']
|
||||
self.booster_type_def = params['booster_type_def']
|
||||
self.booster_nf_model = params['booster_nf_model']
|
||||
self.booster_nf_fit_coeff = params['booster_nf_fit_coeff']
|
||||
self.booster_gain_min = params['booster_gain_min']
|
||||
self.booster_gain_flatmax = params['booster_gain_flatmax']
|
||||
|
||||
# Others
|
||||
self.pmd = params['pmd']
|
||||
self.pdl = params['pdl']
|
||||
self.raman = params['raman']
|
||||
self.dgt = params['dgt']
|
||||
self.advance_configurations_from_json = params['advance_configurations_from_json']
|
||||
|
||||
# Design
|
||||
self.allowed_for_design = params['allowed_for_design']
|
||||
|
||||
except KeyError as e:
|
||||
raise ParametersError(f'Edfa configurations json must include {e}. Configuration: {params}')
|
||||
|
||||
def update_params(self, kwargs):
|
||||
for k, v in kwargs.items():
|
||||
setattr(self, k, self.update_params(**v) if isinstance(v, dict) else v)
|
||||
|
||||
|
||||
class EdfaOperational:
|
||||
default_values = {
|
||||
'gain_target': None,
|
||||
'delta_p': None,
|
||||
'out_voa': None,
|
||||
'tilt_target': 0
|
||||
}
|
||||
|
||||
def __init__(self, **operational):
|
||||
self.update_attr(operational)
|
||||
|
||||
def update_attr(self, kwargs):
|
||||
clean_kwargs = {k: v for k, v in kwargs.items() if v != ''}
|
||||
for k, v in self.default_values.items():
|
||||
setattr(self, k, clean_kwargs.get(k, v))
|
||||
|
||||
def __repr__(self):
|
||||
return (f'{type(self).__name__}('
|
||||
f'gain_target={self.gain_target!r}, '
|
||||
f'tilt_target={self.tilt_target!r})')
|
||||
573
gnpy/core/science_utils.py
Normal file
573
gnpy/core/science_utils.py
Normal file
@@ -0,0 +1,573 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
gnpy.core.science_utils
|
||||
=======================
|
||||
|
||||
Solver definitions to calculate the Raman effect and the nonlinear interference noise
|
||||
|
||||
The solvers take as input instances of the spectral information, the fiber and the simulation parameters
|
||||
"""
|
||||
|
||||
from numpy import interp, pi, zeros, cos, array, append, ones, exp, arange, sqrt, trapz, arcsinh, clip, abs, sum, \
|
||||
concatenate, flip, outer, inner, transpose, max, format_float_scientific, diag, sort, unique, argsort, cumprod, \
|
||||
polyfit
|
||||
from logging import getLogger
|
||||
from scipy.constants import k, h
|
||||
from scipy.interpolate import interp1d
|
||||
from math import isclose
|
||||
|
||||
from gnpy.core.utils import db2lin, lin2db
|
||||
from gnpy.core.exceptions import EquipmentConfigError
|
||||
from gnpy.core.parameters import SimParams
|
||||
from gnpy.core.info import SpectralInformation
|
||||
|
||||
logger = getLogger(__name__)
|
||||
sim_params = SimParams()
|
||||
|
||||
|
||||
def raised_cosine(frequency, channel_frequency, channel_baud_rate, channel_roll_off):
|
||||
"""Returns a unitary raised cosine profile for the given parame
|
||||
|
||||
:param frequency: numpy array of frequencies in Hz for the resulting raised cosine
|
||||
:param channel_frequency: channel frequencies in Hz
|
||||
:param channel_baud_rate: channel baud rate in Hz
|
||||
:param channel_roll_off: channel roll off
|
||||
"""
|
||||
raised_cosine_mask = zeros(frequency.size)
|
||||
base_frequency = frequency - channel_frequency
|
||||
ts = 1 / channel_baud_rate
|
||||
pass_band = (1 - channel_roll_off) * channel_baud_rate / 2
|
||||
stop_band = (1 + channel_roll_off) * channel_baud_rate / 2
|
||||
|
||||
flat_condition = (abs(base_frequency) <= pass_band) == 1
|
||||
cosine_condition = (pass_band < abs(base_frequency)) * (abs(base_frequency) < stop_band) == 1
|
||||
|
||||
raised_cosine_mask[flat_condition] = 1
|
||||
raised_cosine_mask[cosine_condition] = \
|
||||
0.5 * (1 + cos(pi * ts / channel_roll_off * (abs(base_frequency[cosine_condition]) - pass_band)))
|
||||
return raised_cosine_mask
|
||||
|
||||
|
||||
class StimulatedRamanScattering:
|
||||
def __init__(self, power_profile, loss_profile, frequency, z):
|
||||
"""
|
||||
:params power_profile: power profile matrix along frequency and z [W]
|
||||
:params loss_profile: power profile matrix along frequency and z [linear units]
|
||||
:params frequency: channels frequencies array [Hz]
|
||||
:params z: positions array [m]
|
||||
"""
|
||||
self.power_profile = power_profile
|
||||
self.loss_profile = loss_profile
|
||||
# Field loss profile matrix along frequency and z
|
||||
self.rho = sqrt(loss_profile)
|
||||
self.frequency = frequency
|
||||
self.z = z
|
||||
|
||||
|
||||
class RamanSolver:
|
||||
"""This class contains the methods to calculate the Raman scattering effect."""
|
||||
|
||||
@staticmethod
|
||||
def _create_lumped_losses(z, lumped_losses, z_lumped_losses):
|
||||
lumped_losses = concatenate((lumped_losses, ones(z.size)))
|
||||
z, unique_indices = unique(concatenate((z_lumped_losses, z)), return_index=True)
|
||||
order = argsort(z)
|
||||
lumped_losses = (lumped_losses[unique_indices])[order]
|
||||
z = z[order]
|
||||
return z, lumped_losses
|
||||
|
||||
@staticmethod
|
||||
def calculate_attenuation_profile(spectral_info: SpectralInformation, fiber):
|
||||
"""Evaluates the attenuation profile along the z axis for all the frequency propagating in the
|
||||
fiber without considering the stimulated Raman scattering.
|
||||
"""
|
||||
# z array definition
|
||||
z = array([0, fiber.params.length])
|
||||
|
||||
# Lumped losses array definition
|
||||
z, lumped_losses = RamanSolver._create_lumped_losses(z, fiber.lumped_losses, fiber.z_lumped_losses)
|
||||
|
||||
lumped_loss_acc = cumprod(lumped_losses)
|
||||
frequency = spectral_info.frequency
|
||||
alpha = fiber.alpha(frequency)
|
||||
loss_profile = exp(- outer(alpha, z)) * lumped_loss_acc
|
||||
power_profile = outer(spectral_info.signal, ones(z.size)) * loss_profile
|
||||
return StimulatedRamanScattering(power_profile, loss_profile, spectral_info.frequency, z)
|
||||
|
||||
@staticmethod
|
||||
def calculate_stimulated_raman_scattering(spectral_info: SpectralInformation, fiber):
|
||||
"""Evaluates the Raman profile along the z axis for all the frequency propagated in the fiber
|
||||
including the Raman pumps co- and counter-propagating
|
||||
"""
|
||||
logger.debug('Start computing fiber Stimulated Raman Scattering')
|
||||
|
||||
if sim_params.raman_params.flag:
|
||||
# Raman parameters
|
||||
z_resolution = sim_params.raman_params.result_spatial_resolution
|
||||
z_step = sim_params.raman_params.solver_spatial_resolution
|
||||
z = append(arange(0, fiber.params.length, z_step), fiber.params.length)
|
||||
z_final = append(arange(0, fiber.params.length, z_resolution), fiber.params.length)
|
||||
z_final = sort(unique(concatenate((fiber.z_lumped_losses, z_final))))
|
||||
|
||||
# Lumped losses array definition
|
||||
z, lumped_losses = RamanSolver._create_lumped_losses(z, fiber.lumped_losses, fiber.z_lumped_losses)
|
||||
|
||||
if hasattr(fiber, 'raman_pumps'):
|
||||
# TODO: verify co-propagating pumps computation and in general unsorted frequency
|
||||
# Co-propagating spectrum definition
|
||||
co_raman_pump_power = array([pump.power for pump in fiber.raman_pumps
|
||||
if pump.propagation_direction == 'coprop'])
|
||||
co_raman_pump_frequency = array([pump.frequency for pump in fiber.raman_pumps
|
||||
if pump.propagation_direction == 'coprop'])
|
||||
|
||||
co_power = concatenate((spectral_info.signal, co_raman_pump_power))
|
||||
co_frequency = concatenate((spectral_info.frequency, co_raman_pump_frequency))
|
||||
|
||||
# Counter-propagating spectrum definition
|
||||
cnt_power = array([pump.power for pump in fiber.raman_pumps
|
||||
if pump.propagation_direction == 'counterprop'])
|
||||
cnt_frequency = array([pump.frequency for pump in fiber.raman_pumps
|
||||
if pump.propagation_direction == 'counterprop'])
|
||||
# Co-propagating profile initialization
|
||||
co_power_profile = zeros([co_frequency.size, z.size])
|
||||
if co_frequency.size:
|
||||
co_cr = fiber.cr(co_frequency)
|
||||
co_alpha = fiber.alpha(co_frequency)
|
||||
co_power_profile = \
|
||||
RamanSolver.first_order_derivative_solution(co_power, co_alpha, co_cr, z, lumped_losses)
|
||||
# Counter-propagating profile initialization
|
||||
cnt_power_profile = zeros([cnt_frequency.size, z.size])
|
||||
if cnt_frequency.size:
|
||||
cnt_cr = fiber.cr(cnt_frequency)
|
||||
cnt_alpha = fiber.alpha(cnt_frequency)
|
||||
cnt_power_profile = \
|
||||
flip(RamanSolver.first_order_derivative_solution(cnt_power, cnt_alpha, cnt_cr,
|
||||
z[-1] - flip(z), flip(lumped_losses)), axis=1)
|
||||
# Co-propagating and Counter-propagating Profile Computation
|
||||
if co_frequency.size and cnt_frequency.size:
|
||||
co_power_profile, cnt_power_profile = \
|
||||
RamanSolver.iterative_algorithm(co_power_profile, cnt_power_profile,
|
||||
co_frequency, cnt_frequency, z, fiber, lumped_losses)
|
||||
# Complete Power Profile
|
||||
power_profile = concatenate((co_power_profile, cnt_power_profile), axis=0)
|
||||
# Complete Loss Profile
|
||||
co_loss_profile = co_power_profile / outer(co_power, ones(z.size))
|
||||
cnt_loss_profile = cnt_power_profile / outer(cnt_power, ones(z.size))
|
||||
loss_profile = concatenate((co_loss_profile, cnt_loss_profile), axis=0)
|
||||
# Complete frequency
|
||||
frequency = concatenate((co_frequency, cnt_frequency))
|
||||
else:
|
||||
# Without Raman pumps
|
||||
alpha = fiber.alpha(spectral_info.frequency)
|
||||
cr = fiber.cr(spectral_info.frequency)
|
||||
# Power profile
|
||||
power_profile = \
|
||||
RamanSolver.first_order_derivative_solution(spectral_info.signal, alpha, cr, z, lumped_losses)
|
||||
# Loss profile
|
||||
loss_profile = power_profile / outer(spectral_info.signal, ones(z.size))
|
||||
frequency = spectral_info.frequency
|
||||
power_profile = interp1d(z, power_profile, axis=1)(z_final)
|
||||
loss_profile = interp1d(z, loss_profile, axis=1)(z_final)
|
||||
stimulated_raman_scattering = StimulatedRamanScattering(power_profile, loss_profile, frequency, z_final)
|
||||
else:
|
||||
stimulated_raman_scattering = \
|
||||
RamanSolver.calculate_attenuation_profile(spectral_info, fiber)
|
||||
return stimulated_raman_scattering
|
||||
|
||||
@staticmethod
|
||||
def calculate_spontaneous_raman_scattering(spectral_info: SpectralInformation, srs: StimulatedRamanScattering,
|
||||
fiber):
|
||||
"""Evaluates the Raman profile along the z axis for all the frequency propagated in the fiber
|
||||
including the Raman pumps co- and counter-propagating.
|
||||
"""
|
||||
logger.debug('Start computing fiber Spontaneous Raman Scattering')
|
||||
z = srs.z
|
||||
baud_rate = spectral_info.baud_rate
|
||||
frequency = spectral_info.frequency
|
||||
channels_loss = srs.loss_profile[:spectral_info.number_of_channels, :]
|
||||
|
||||
# calculate ase power
|
||||
ase = zeros(spectral_info.number_of_channels)
|
||||
cr = fiber.cr(srs.frequency)[:spectral_info.number_of_channels, spectral_info.number_of_channels:]
|
||||
for i, pump in enumerate(fiber.raman_pumps):
|
||||
pump_power = srs.power_profile[spectral_info.number_of_channels + i, :]
|
||||
df = pump.frequency - frequency
|
||||
eta = - 1 / (1 - exp(h * df / (k * fiber.temperature)))
|
||||
integral = trapz(pump_power / channels_loss, z, axis=1)
|
||||
ase += 2 * h * baud_rate * frequency * (1 + eta) * cr[:, i] * (df > 0) * integral # 2 factor for double pol
|
||||
return ase
|
||||
|
||||
@staticmethod
|
||||
def first_order_derivative_solution(power_in, alpha, cr, z, lumped_losses):
|
||||
"""Solves the Raman first order derivative equation
|
||||
|
||||
:param power_in: launch power array
|
||||
:param alpha: loss coefficient array
|
||||
:param cr: Raman efficiency coefficients matrix
|
||||
:param z: z position array
|
||||
:param lumped_losses: concentrated losses array along the fiber span
|
||||
:return: power profile matrix
|
||||
"""
|
||||
dz = z[1:] - z[:-1]
|
||||
power = outer(power_in, ones(z.size))
|
||||
for i in range(1, z.size):
|
||||
power[:, i] = \
|
||||
power[:, i - 1] * (1 + (- alpha + sum(cr * power[:, i - 1], 1)) * dz[i - 1]) * lumped_losses[i - 1]
|
||||
return power
|
||||
|
||||
@staticmethod
|
||||
def iterative_algorithm(co_initial_guess_power, cnt_initial_guess_power, co_frequency, cnt_frequency, z, fiber,
|
||||
lumped_losses):
|
||||
"""Solves the Raman first order derivative equation in case of both co- and counter-propagating
|
||||
frequencies
|
||||
|
||||
:param co_initial_guess_power: co-propagationg Raman first order derivative equation solution
|
||||
:param cnt_initial_guess_power: counter-propagationg Raman first order derivative equation solution
|
||||
:param co_frequency: co-propagationg frequencies
|
||||
:param cnt_frequency: counter-propagationg frequencies
|
||||
:param z: z position array
|
||||
:param fiber: instance of gnpy.core.elements.Fiber or gnpy.core.elements.RamanFiber
|
||||
:param lumped_losses: concentrated losses array along the fiber span
|
||||
:return: co- and counter-propagatng power profile matrix
|
||||
"""
|
||||
logger.debug(' Start iterative algorithm')
|
||||
residue = 1
|
||||
residue_tol = 1e-6
|
||||
accuracy = 1
|
||||
accuracy_tol = 1e-3
|
||||
iteration = 0
|
||||
num_max_iter = 1000
|
||||
prev_power = concatenate((co_initial_guess_power, cnt_initial_guess_power))
|
||||
frequency = concatenate((co_frequency, cnt_frequency))
|
||||
dz = z[1:] - z[:-1]
|
||||
cr = fiber.cr(frequency)
|
||||
alpha = fiber.alpha(frequency)
|
||||
next_power = array(prev_power)
|
||||
while residue > residue_tol and accuracy > accuracy_tol and iteration < num_max_iter:
|
||||
iteration += 1
|
||||
for i in range(1, z.size):
|
||||
dpdz = - alpha + sum(cr * next_power[:, i - 1], 1)
|
||||
next_power[:co_frequency.size, i] = \
|
||||
next_power[:co_frequency.size, i - 1] * (1 + dpdz[:co_frequency.size] * dz[i - 1]) * \
|
||||
lumped_losses[i - 1]
|
||||
for i in range(1, z.size):
|
||||
dpdz = - alpha + sum(cr * next_power[:, -i], 1)
|
||||
next_power[co_frequency.size:, -i - 1] = \
|
||||
next_power[co_frequency.size:, -i] * (1 + dpdz[co_frequency.size:] * dz[-i]) * \
|
||||
lumped_losses[-i]
|
||||
|
||||
dpdz_num = (next_power[:co_frequency.size, 1:] - next_power[:co_frequency.size, :-1]) / dz
|
||||
dpdz_exp = next_power[:co_frequency.size, :-1] * \
|
||||
(- outer(alpha, ones(z.size)) + inner(cr, transpose(next_power)))[:co_frequency.size, :-1] * \
|
||||
lumped_losses[:-1]
|
||||
|
||||
residue = max(abs((next_power - prev_power) / next_power))
|
||||
accuracy = max(abs((dpdz_exp - dpdz_num) / dpdz_exp))
|
||||
prev_power = array(next_power)
|
||||
logger.debug(f' Iteration: {iteration} Accuracy: {format_float_scientific(accuracy, precision=3)}')
|
||||
return next_power[:co_frequency.size, :], next_power[co_frequency.size:, :]
|
||||
|
||||
|
||||
class NliSolver:
|
||||
"""This class implements the NLI models.
|
||||
Model and method can be specified in `sim_params.nli_params.method`.
|
||||
List of implemented methods:
|
||||
'gn_model_analytic': eq. 120 from arXiv:1209.0394
|
||||
'ggn_spectrally_separated': eq. 21 from arXiv: 1710.02225
|
||||
"""
|
||||
|
||||
SPM_WEIGHT = (16.0 / 27.0)
|
||||
XPM_WEIGHT = 2 * (16.0 / 27.0)
|
||||
|
||||
@staticmethod
|
||||
def effective_length(alpha, length):
|
||||
"""The effective length identify the region in which the NLI has a significant contribution to
|
||||
the signal degradation.
|
||||
"""
|
||||
return (1 - exp(- alpha * length)) / alpha
|
||||
|
||||
@staticmethod
|
||||
def compute_nli(spectral_info: SpectralInformation, srs: StimulatedRamanScattering, fiber):
|
||||
"""Compute NLI power generated by the WDM comb `*carriers` on the channel under test `carrier`
|
||||
at the end of the fiber span.
|
||||
"""
|
||||
logger.debug('Start computing fiber NLI noise')
|
||||
|
||||
if 'gn_model_analytic' == sim_params.nli_params.method:
|
||||
eta = NliSolver._gn_analytic(spectral_info, fiber)
|
||||
|
||||
cut_power = outer(spectral_info.signal, ones(spectral_info.number_of_channels))
|
||||
pump_power = outer(ones(spectral_info.number_of_channels), spectral_info.signal)
|
||||
nli_matrix = cut_power * pump_power ** 2 * eta
|
||||
nli = sum(nli_matrix, 1)
|
||||
elif 'ggn_spectrally_separated' in sim_params.nli_params.method:
|
||||
if sim_params.nli_params.computed_channels is not None:
|
||||
cut_indices = array(sim_params.nli_params.computed_channels) - 1
|
||||
elif sim_params.nli_params.computed_number_of_channels is not None:
|
||||
nb_ch_computed = sim_params.nli_params.computed_number_of_channels
|
||||
nb_ch = len(spectral_info.channel_number)
|
||||
cut_indices = array([round(i * (nb_ch - 1) / (nb_ch_computed - 1)) for i in range(0, nb_ch_computed)])
|
||||
else:
|
||||
cut_indices = array(spectral_info.channel_number) - 1
|
||||
|
||||
eta = NliSolver._ggn_spectrally_separated(cut_indices, spectral_info, fiber, srs)
|
||||
|
||||
# Interpolation over the channels not indicated as compted channels in simulation parameters
|
||||
cut_power = outer(spectral_info.signal[cut_indices], ones(spectral_info.number_of_channels))
|
||||
cut_frequency = spectral_info.frequency[cut_indices]
|
||||
pump_power = outer(ones(cut_indices.size), spectral_info.signal)
|
||||
cut_baud_rate = outer(spectral_info.baud_rate[cut_indices], ones(spectral_info.number_of_channels))
|
||||
|
||||
g_nli = eta * cut_power * pump_power**2 / cut_baud_rate
|
||||
g_nli = sum(g_nli, 1)
|
||||
g_nli = interp(spectral_info.frequency, cut_frequency, g_nli)
|
||||
nli = spectral_info.baud_rate * g_nli # Local white noise
|
||||
else:
|
||||
raise ValueError(f'Method {sim_params.nli_params.method} not implemented.')
|
||||
|
||||
return nli
|
||||
|
||||
# Methods for computing GN-model eta matrix
|
||||
@staticmethod
|
||||
def _gn_analytic(spectral_info, fiber, spm_weight=SPM_WEIGHT, xpm_weight=XPM_WEIGHT):
|
||||
"""Computes the nonlinear interference power evaluated at the fiber input.
|
||||
The method uses eq. 120 from arXiv:1209.0394
|
||||
"""
|
||||
# Spectral Features
|
||||
nch = spectral_info.number_of_channels
|
||||
frequency = spectral_info.frequency
|
||||
baud_rate = spectral_info.baud_rate
|
||||
delta_frequency = spectral_info.df
|
||||
|
||||
# Physical fiber parameters
|
||||
alpha = fiber.alpha(frequency)
|
||||
beta2 = fiber.beta2(frequency)
|
||||
gamma = outer(fiber.gamma(frequency), ones(nch))
|
||||
length = fiber.params.length
|
||||
|
||||
identity = diag(ones(nch))
|
||||
weight = spm_weight * identity + xpm_weight * (ones([nch, nch]) - identity)
|
||||
|
||||
effective_length = NliSolver.effective_length(alpha, length)
|
||||
asymptotic_length = 1 / alpha
|
||||
|
||||
cut_baud_rate = outer(baud_rate, ones(nch))
|
||||
pump_baud_rate = outer(ones(nch), baud_rate)
|
||||
|
||||
psi = NliSolver._psi(delta_frequency, baud_rate, beta2, effective_length, asymptotic_length)
|
||||
eta_cut_central_frequency = gamma ** 2 * weight * psi / (cut_baud_rate * pump_baud_rate ** 2)
|
||||
eta = cut_baud_rate * eta_cut_central_frequency # Local white noise
|
||||
return eta
|
||||
|
||||
@staticmethod
|
||||
def _psi(df, baud_rate, beta2, effective_length, asymptotic_length):
|
||||
"""Calculates eq. 123 from `arXiv:1209.0394 <https://arxiv.org/abs/1209.0394>`__"""
|
||||
cut_baud_rate = outer(baud_rate, ones(baud_rate.size))
|
||||
cut_beta = outer(beta2, ones(baud_rate.size))
|
||||
pump_baud_rate = baud_rate
|
||||
pump_beta = outer(ones(baud_rate.size), beta2)
|
||||
beta2 = (cut_beta + pump_beta) / 2
|
||||
right_extreme = df + pump_baud_rate / 2
|
||||
left_extreme = df - pump_baud_rate / 2
|
||||
psi = (arcsinh(pi ** 2 * asymptotic_length * abs(beta2) * cut_baud_rate * right_extreme) -
|
||||
arcsinh(pi ** 2 * asymptotic_length * abs(beta2) * cut_baud_rate * left_extreme)) / 2
|
||||
psi *= effective_length ** 2 / (2 * pi * abs(beta2) * asymptotic_length)
|
||||
return psi
|
||||
|
||||
# Methods for computing the GGN-model eta matrix
|
||||
@staticmethod
|
||||
def _ggn_spectrally_separated(cut_indices, spectral_info, fiber, srs, spm_weight=SPM_WEIGHT, xpm_weight=XPM_WEIGHT):
|
||||
"""Computes the nonlinear interference power evaluated at the fiber input.
|
||||
The method uses eq. 21 from arXiv: 1710.02225
|
||||
"""
|
||||
# Spectral Features
|
||||
nch = spectral_info.number_of_channels
|
||||
frequency = spectral_info.frequency
|
||||
baud_rate = spectral_info.baud_rate
|
||||
slot_width = spectral_info.slot_width
|
||||
roll_off = spectral_info.roll_off
|
||||
|
||||
# Physical fiber parameters
|
||||
alpha = fiber.alpha(frequency)
|
||||
beta2 = fiber.beta2(frequency)
|
||||
gamma = outer(fiber.gamma(frequency[cut_indices]), ones(nch))
|
||||
|
||||
identity = diag(ones(nch))
|
||||
weight = spm_weight * identity + xpm_weight * (ones([nch, nch]) - identity)
|
||||
weight = weight[cut_indices, :]
|
||||
|
||||
dispersion_tolerance = sim_params.nli_params.dispersion_tolerance
|
||||
phase_shift_tolerance = sim_params.nli_params.phase_shift_tolerance
|
||||
max_slot_width = max(slot_width)
|
||||
delta_z = sim_params.raman_params.result_spatial_resolution
|
||||
|
||||
psi_cut_central_frequency = zeros([cut_indices.size, nch])
|
||||
for i, cut_index in enumerate(cut_indices):
|
||||
logger.debug(f'Start computing fiber NLI noise of cut: {cut_index + 1}')
|
||||
cut_frequency = frequency[cut_index]
|
||||
cut_baud_rate = baud_rate[cut_index]
|
||||
cut_roll_off = roll_off[cut_index]
|
||||
cut_number = cut_index + 1
|
||||
cut_beta2 = beta2[cut_index]
|
||||
cut_base_frequency = frequency - cut_frequency
|
||||
cut_beta_coefficients = polyfit(cut_base_frequency, beta2, 2)
|
||||
cut_beta3 = cut_beta_coefficients[1] / (2 * pi)
|
||||
|
||||
for pump_index in range(nch):
|
||||
pump_frequency = frequency[pump_index]
|
||||
pump_baud_rate = baud_rate[pump_index]
|
||||
pump_roll_off = roll_off[pump_index]
|
||||
pump_number = pump_index + 1
|
||||
pump_alpha = alpha[pump_index]
|
||||
dn = abs(pump_number - cut_number)
|
||||
delta_f = abs(cut_frequency - pump_frequency)
|
||||
k_tol = dispersion_tolerance * abs(alpha[pump_index])
|
||||
phi_tol = phase_shift_tolerance / delta_z
|
||||
f_cut_resolution = min(k_tol, phi_tol) / abs(cut_beta2) / (4 * pi ** 2 * (1 + dn) * max_slot_width)
|
||||
f_pump_resolution = min(k_tol, phi_tol) / abs(cut_beta2) / (4 * pi ** 2 * max_slot_width)
|
||||
if cut_index == pump_index: # SPM
|
||||
psi_cut_central_frequency[i, pump_index] = \
|
||||
NliSolver._generalized_psi(cut_frequency, cut_frequency, cut_baud_rate, cut_roll_off,
|
||||
pump_frequency, pump_baud_rate, pump_roll_off, f_cut_resolution,
|
||||
f_pump_resolution, srs, pump_alpha, cut_beta2, cut_beta3,
|
||||
cut_frequency)
|
||||
else: # XPM
|
||||
frequency_offset_threshold = NliSolver._frequency_offset_threshold(cut_beta2, pump_baud_rate)
|
||||
if abs(delta_f) <= frequency_offset_threshold:
|
||||
psi_cut_central_frequency[i, pump_index] = \
|
||||
NliSolver._generalized_psi(cut_frequency, cut_frequency, cut_baud_rate, cut_roll_off,
|
||||
pump_frequency, pump_baud_rate, pump_roll_off, f_cut_resolution,
|
||||
f_pump_resolution, srs, pump_alpha, cut_beta2, cut_beta3,
|
||||
cut_frequency)
|
||||
else:
|
||||
psi_cut_central_frequency[i, pump_index] = \
|
||||
NliSolver._fast_generalized_psi(cut_frequency, cut_frequency, cut_baud_rate, cut_roll_off,
|
||||
pump_frequency, pump_baud_rate, pump_roll_off,
|
||||
f_cut_resolution, srs, pump_alpha, cut_beta2, cut_beta3,
|
||||
cut_frequency)
|
||||
|
||||
cut_baud_rate = outer(baud_rate[cut_indices], ones(nch))
|
||||
pump_baud_rate = outer(ones(cut_indices.size), baud_rate)
|
||||
|
||||
eta_cut_central_frequency = \
|
||||
gamma ** 2 * weight * psi_cut_central_frequency / (cut_baud_rate * pump_baud_rate ** 2)
|
||||
eta = cut_baud_rate * eta_cut_central_frequency # Local white noise
|
||||
return eta
|
||||
|
||||
@staticmethod
|
||||
def _fast_generalized_psi(f_eval, cut_frequency, cut_baud_rate, cut_roll_off, pump_frequency, pump_baud_rate,
|
||||
pump_roll_off, f_cut_resolution, srs, alpha, beta2, beta3, f_ref_beta):
|
||||
"""Computes the generalized psi function similarly to the one used in the GN model."""
|
||||
z = srs.z
|
||||
rho_norm = srs.rho * exp(outer(alpha / 2, z))
|
||||
rho_pump = interp1d(srs.frequency, rho_norm, axis=0)(pump_frequency)
|
||||
|
||||
f1_array = array([pump_frequency - (pump_baud_rate * (1 + pump_roll_off) / 2),
|
||||
pump_frequency + (pump_baud_rate * (1 + pump_roll_off) / 2)])
|
||||
f2_array = arange(cut_frequency, cut_frequency + (cut_baud_rate * (1 + cut_roll_off) / 2),
|
||||
f_cut_resolution) # Only positive f2 is used since integrand_f2 is symmetric
|
||||
|
||||
integrand_f1 = zeros(f1_array.size)
|
||||
for f1_index, f1 in enumerate(f1_array):
|
||||
delta_beta = 4 * pi ** 2 * (f1 - f_eval) * (f2_array - f_eval) * (
|
||||
beta2 + pi * beta3 * (f1 + f2_array - 2 * f_ref_beta))
|
||||
integrand_f2 = NliSolver._generalized_rho_nli(delta_beta, rho_pump, z, alpha)
|
||||
integrand_f1[f1_index] = 2 * trapz(integrand_f2, f2_array) # 2x since integrand_f2 is symmetric in f2
|
||||
generalized_psi = 0.5 * sum(integrand_f1) * pump_baud_rate
|
||||
return generalized_psi
|
||||
|
||||
@staticmethod
|
||||
def _generalized_psi(f_eval, cut_frequency, cut_baud_rate, cut_roll_off, pump_frequency, pump_baud_rate,
|
||||
pump_roll_off, f_cut_resolution, f_pump_resolution, srs, alpha, beta2, beta3, f_ref_beta):
|
||||
"""Computes the generalized psi function similarly to the one used in the GN model."""
|
||||
z = srs.z
|
||||
rho_norm = srs.rho * exp(outer(alpha / 2, z))
|
||||
rho_pump = interp1d(srs.frequency, rho_norm, axis=0)(pump_frequency)
|
||||
|
||||
f1_array = arange(pump_frequency - (pump_baud_rate * (1 + pump_roll_off) / 2),
|
||||
pump_frequency + (pump_baud_rate * (1 + pump_roll_off) / 2),
|
||||
f_pump_resolution)
|
||||
f2_array = arange(cut_frequency - (cut_baud_rate * (1 + cut_roll_off) / 2),
|
||||
cut_frequency + (cut_baud_rate * (1 + cut_roll_off) / 2),
|
||||
f_cut_resolution)
|
||||
rc1 = raised_cosine(f1_array, pump_frequency, pump_baud_rate, pump_roll_off)
|
||||
|
||||
integrand_f1 = zeros(f1_array.size)
|
||||
for i in range(f1_array.size):
|
||||
f3_array = f1_array[i] + f2_array - f_eval
|
||||
rc2 = raised_cosine(f2_array, cut_frequency, cut_baud_rate, cut_roll_off)
|
||||
rc3 = raised_cosine(f3_array, pump_frequency, pump_baud_rate, pump_roll_off)
|
||||
delta_beta = 4 * pi ** 2 * (f1_array[i] - f_eval) * (f2_array - f_eval) * (
|
||||
beta2 + pi * beta3 * (f1_array[i] + f2_array - 2 * f_ref_beta))
|
||||
integrand_f2 = rc1[i] * rc2 * rc3 * NliSolver._generalized_rho_nli(delta_beta, rho_pump, z, alpha)
|
||||
integrand_f1[i] = trapz(integrand_f2, f2_array)
|
||||
generalized_psi = trapz(integrand_f1, f1_array)
|
||||
return generalized_psi
|
||||
|
||||
@staticmethod
|
||||
def _generalized_rho_nli(delta_beta, rho_pump, z, alpha):
|
||||
w = 1j * delta_beta - alpha
|
||||
generalized_rho_nli = (rho_pump[-1]**2 * exp(w * z[-1]) - rho_pump[0]**2 * exp(w * z[0])) / w
|
||||
for z_ind in range(0, len(z) - 1):
|
||||
derivative_rho = (rho_pump[z_ind + 1]**2 - rho_pump[z_ind]**2) / (z[z_ind + 1] - z[z_ind])
|
||||
generalized_rho_nli -= derivative_rho * (exp(w * z[z_ind + 1]) - exp(w * z[z_ind])) / (w**2)
|
||||
generalized_rho_nli = abs(generalized_rho_nli)**2
|
||||
return generalized_rho_nli
|
||||
|
||||
@staticmethod
|
||||
def _frequency_offset_threshold(beta2, symbol_rate):
|
||||
k_ref = 5
|
||||
beta2_ref = 21.3e-27
|
||||
delta_f_ref = 50e9
|
||||
rs_ref = 32e9
|
||||
beta2 = abs(beta2)
|
||||
freq_offset_th = ((k_ref * delta_f_ref) * rs_ref * beta2_ref) / (beta2 * symbol_rate)
|
||||
return freq_offset_th
|
||||
|
||||
|
||||
def estimate_nf_model(type_variety, gain_min, gain_max, nf_min, nf_max):
|
||||
if nf_min < -10:
|
||||
raise EquipmentConfigError(f'Invalid nf_min value {nf_min!r} for amplifier {type_variety}')
|
||||
if nf_max < -10:
|
||||
raise EquipmentConfigError(f'Invalid nf_max value {nf_max!r} for amplifier {type_variety}')
|
||||
|
||||
# NF estimation model based on nf_min and nf_max
|
||||
# delta_p: max power dB difference between first and second stage coils
|
||||
# dB g1a: first stage gain - internal VOA attenuation
|
||||
# nf1, nf2: first and second stage coils
|
||||
# calculated by solving nf_{min,max} = nf1 + nf2 / g1a{min,max}
|
||||
delta_p = 5
|
||||
g1a_min = gain_min - (gain_max - gain_min) - delta_p
|
||||
g1a_max = gain_max - delta_p
|
||||
nf2 = lin2db((db2lin(nf_min) - db2lin(nf_max)) /
|
||||
(1 / db2lin(g1a_max) - 1 / db2lin(g1a_min)))
|
||||
nf1 = lin2db(db2lin(nf_min) - db2lin(nf2) / db2lin(g1a_max))
|
||||
|
||||
if nf1 < 4:
|
||||
raise EquipmentConfigError(f'First coil value too low {nf1} for amplifier {type_variety}')
|
||||
|
||||
# Check 1 dB < delta_p < 6 dB to ensure nf_min and nf_max values make sense.
|
||||
# There shouldn't be high nf differences between the two coils:
|
||||
# nf2 should be nf1 + 0.3 < nf2 < nf1 + 2
|
||||
# If not, recompute and check delta_p
|
||||
if not nf1 + 0.3 < nf2 < nf1 + 2:
|
||||
nf2 = clip(nf2, nf1 + 0.3, nf1 + 2)
|
||||
g1a_max = lin2db(db2lin(nf2) / (db2lin(nf_min) - db2lin(nf1)))
|
||||
delta_p = gain_max - g1a_max
|
||||
g1a_min = gain_min - (gain_max - gain_min) - delta_p
|
||||
if not 1 < delta_p < 11:
|
||||
raise EquipmentConfigError(f'Computed \N{greek capital letter delta}P invalid \
|
||||
\n 1st coil vs 2nd coil calculated DeltaP {delta_p:.2f} for \
|
||||
\n amplifier {type_variety} is not valid: revise inputs \
|
||||
\n calculated 1st coil NF = {nf1:.2f}, 2nd coil NF = {nf2:.2f}')
|
||||
# Check calculated values for nf1 and nf2
|
||||
calc_nf_min = lin2db(db2lin(nf1) + db2lin(nf2) / db2lin(g1a_max))
|
||||
if not isclose(nf_min, calc_nf_min, abs_tol=0.01):
|
||||
raise EquipmentConfigError(f'nf_min does not match calc_nf_min, {nf_min} vs {calc_nf_min} for amp {type_variety}')
|
||||
calc_nf_max = lin2db(db2lin(nf1) + db2lin(nf2) / db2lin(g1a_min))
|
||||
if not isclose(nf_max, calc_nf_max, abs_tol=0.01):
|
||||
raise EquipmentConfigError(f'nf_max does not match calc_nf_max, {nf_max} vs {calc_nf_max} for amp {type_variety}')
|
||||
|
||||
return nf1, nf2, delta_p
|
||||
@@ -1,2 +0,0 @@
|
||||
UNITS = {'m': 1,
|
||||
'km': 1E3}
|
||||
@@ -1,81 +1,251 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
'''
|
||||
"""
|
||||
gnpy.core.utils
|
||||
===============
|
||||
|
||||
This module contains utility functions that are used with gnpy.
|
||||
'''
|
||||
"""
|
||||
|
||||
|
||||
import json
|
||||
|
||||
import numpy as np
|
||||
from numpy import pi, cos, sqrt, log10
|
||||
from csv import writer
|
||||
from numpy import pi, cos, sqrt, log10, linspace, zeros, shape, where, logical_and, mean, array
|
||||
from scipy import constants
|
||||
from copy import deepcopy
|
||||
|
||||
from gnpy.core.exceptions import ConfigurationError
|
||||
|
||||
|
||||
def load_json(filename):
|
||||
with open(filename, 'r') as f:
|
||||
data = json.load(f)
|
||||
return data
|
||||
|
||||
|
||||
def save_json(obj, filename):
|
||||
with open(filename, 'w') as f:
|
||||
json.dump(obj, f)
|
||||
|
||||
|
||||
def c():
|
||||
def write_csv(obj, filename):
|
||||
"""
|
||||
Returns the speed of light in meters per second
|
||||
Convert dictionary items to a CSV file the dictionary format:
|
||||
::
|
||||
|
||||
{'result category 1':
|
||||
[
|
||||
# 1st line of results
|
||||
{'header 1' : value_xxx,
|
||||
'header 2' : value_yyy},
|
||||
# 2nd line of results: same headers, different results
|
||||
{'header 1' : value_www,
|
||||
'header 2' : value_zzz}
|
||||
],
|
||||
'result_category 2':
|
||||
[
|
||||
{},{}
|
||||
]
|
||||
}
|
||||
|
||||
The generated csv file will be:
|
||||
::
|
||||
|
||||
result_category 1
|
||||
header 1 header 2
|
||||
value_xxx value_yyy
|
||||
value_www value_zzz
|
||||
result_category 2
|
||||
...
|
||||
"""
|
||||
return constants.c
|
||||
with open(filename, 'w', encoding='utf-8') as f:
|
||||
w = writer(f)
|
||||
for data_key, data_list in obj.items():
|
||||
# main header
|
||||
w.writerow([data_key])
|
||||
# sub headers:
|
||||
headers = [_ for _ in data_list[0].keys()]
|
||||
w.writerow(headers)
|
||||
for data_dict in data_list:
|
||||
w.writerow([_ for _ in data_dict.values()])
|
||||
|
||||
|
||||
def itufs(spacing, startf=191.35, stopf=196.10):
|
||||
"""Creates an array of frequencies whose default range is
|
||||
191.35-196.10 THz
|
||||
def arrange_frequencies(length, start, stop):
|
||||
"""Create an array of frequencies
|
||||
|
||||
:param spacing: Frequency spacing in THz
|
||||
:param starf: Start frequency in THz
|
||||
:param stopf: Stop frequency in THz
|
||||
:type spacing: float
|
||||
:type startf: float
|
||||
:type stopf: float
|
||||
:return an array of frequnecies determined by the spacing parameter
|
||||
:param length: number of elements
|
||||
:param start: Start frequency in THz
|
||||
:param stop: Stop frequency in THz
|
||||
:type length: integer
|
||||
:type start: float
|
||||
:type stop: float
|
||||
:return: an array of frequencies determined by the spacing parameter
|
||||
:rtype: numpy.ndarray
|
||||
"""
|
||||
return np.arange(startf, stopf + spacing / 2, spacing)
|
||||
|
||||
|
||||
def h():
|
||||
"""
|
||||
Returns plank's constant in J*s
|
||||
"""
|
||||
return constants.h
|
||||
return linspace(start, stop, length)
|
||||
|
||||
|
||||
def lin2db(value):
|
||||
"""Convert linear unit to logarithmic (dB)
|
||||
|
||||
>>> lin2db(0.001)
|
||||
-30.0
|
||||
>>> round(lin2db(1.0), 2)
|
||||
0.0
|
||||
>>> round(lin2db(1.26), 2)
|
||||
1.0
|
||||
>>> round(lin2db(10.0), 2)
|
||||
10.0
|
||||
>>> round(lin2db(100.0), 2)
|
||||
20.0
|
||||
"""
|
||||
return 10 * log10(value)
|
||||
|
||||
|
||||
def db2lin(value):
|
||||
"""Convert logarithimic units to linear
|
||||
|
||||
>>> round(db2lin(10.0), 2)
|
||||
10.0
|
||||
>>> round(db2lin(20.0), 2)
|
||||
100.0
|
||||
>>> round(db2lin(1.0), 2)
|
||||
1.26
|
||||
>>> round(db2lin(0.0), 2)
|
||||
1.0
|
||||
>>> round(db2lin(-10.0), 2)
|
||||
0.1
|
||||
"""
|
||||
return 10**(value / 10)
|
||||
|
||||
|
||||
def watt2dbm(value):
|
||||
"""Convert Watt units to dBm
|
||||
|
||||
>>> round(watt2dbm(0.001), 1)
|
||||
0.0
|
||||
>>> round(watt2dbm(0.02), 1)
|
||||
13.0
|
||||
"""
|
||||
return lin2db(value * 1e3)
|
||||
|
||||
|
||||
def dbm2watt(value):
|
||||
"""Convert dBm units to Watt
|
||||
|
||||
>>> round(dbm2watt(0), 4)
|
||||
0.001
|
||||
>>> round(dbm2watt(-3), 4)
|
||||
0.0005
|
||||
>>> round(dbm2watt(13), 4)
|
||||
0.02
|
||||
"""
|
||||
return db2lin(value) * 1e-3
|
||||
|
||||
|
||||
def psd2powerdbm(psd_mwperghz, baudrate_baud):
|
||||
"""computes power in dBm based on baudrate in bauds and psd in mW/GHz
|
||||
|
||||
>>> round(psd2powerdbm(0.031176, 64e9),3)
|
||||
3.0
|
||||
>>> round(psd2powerdbm(0.062352, 32e9),3)
|
||||
3.0
|
||||
>>> round(psd2powerdbm(0.015625, 64e9),3)
|
||||
0.0
|
||||
"""
|
||||
return lin2db(baudrate_baud * psd_mwperghz * 1e-9)
|
||||
|
||||
|
||||
def power_dbm_to_psd_mw_ghz(power_dbm, baudrate_baud):
|
||||
"""computes power spectral density in mW/GHz based on baudrate in bauds and power in dBm
|
||||
|
||||
>>> power_dbm_to_psd_mw_ghz(0, 64e9)
|
||||
0.015625
|
||||
>>> round(power_dbm_to_psd_mw_ghz(3, 64e9), 6)
|
||||
0.031176
|
||||
>>> round(power_dbm_to_psd_mw_ghz(3, 32e9), 6)
|
||||
0.062352
|
||||
"""
|
||||
return db2lin(power_dbm) / (baudrate_baud * 1e-9)
|
||||
|
||||
|
||||
def psd_mw_per_ghz(power_watt, baudrate_baud):
|
||||
"""computes power spectral density in mW/GHz based on baudrate in bauds and power in W
|
||||
|
||||
>>> psd_mw_per_ghz(2e-3, 32e9)
|
||||
0.0625
|
||||
>>> psd_mw_per_ghz(1e-3, 64e9)
|
||||
0.015625
|
||||
>>> psd_mw_per_ghz(0.5e-3, 32e9)
|
||||
0.015625
|
||||
"""
|
||||
return power_watt * 1e3 / (baudrate_baud * 1e-9)
|
||||
|
||||
|
||||
def round2float(number, step):
|
||||
"""Round a floating point number so that its "resolution" is not bigger than 'step'
|
||||
|
||||
The finest step is fixed at 0.01; smaller values are silently changed to 0.01.
|
||||
|
||||
>>> round2float(123.456, 1000)
|
||||
0.0
|
||||
>>> round2float(123.456, 100)
|
||||
100.0
|
||||
>>> round2float(123.456, 10)
|
||||
120.0
|
||||
>>> round2float(123.456, 1)
|
||||
123.0
|
||||
>>> round2float(123.456, 0.1)
|
||||
123.5
|
||||
>>> round2float(123.456, 0.01)
|
||||
123.46
|
||||
>>> round2float(123.456, 0.001)
|
||||
123.46
|
||||
>>> round2float(123.249, 0.5)
|
||||
123.0
|
||||
>>> round2float(123.250, 0.5)
|
||||
123.0
|
||||
>>> round2float(123.251, 0.5)
|
||||
123.5
|
||||
>>> round2float(123.300, 0.2)
|
||||
123.2
|
||||
>>> round2float(123.301, 0.2)
|
||||
123.4
|
||||
"""
|
||||
step = round(step, 1)
|
||||
if step >= 0.01:
|
||||
number = round(number / step, 0)
|
||||
number = round(number * step, 1)
|
||||
else:
|
||||
number = round(number, 2)
|
||||
return number
|
||||
|
||||
|
||||
wavelength2freq = constants.lambda2nu
|
||||
freq2wavelength = constants.nu2lambda
|
||||
|
||||
def freq2wavelength(value):
|
||||
""" Converts frequency units to wavelength units.
|
||||
|
||||
def snr_sum(snr, bw, snr_added, bw_added=12.5e9):
|
||||
snr_added = snr_added - lin2db(bw / bw_added)
|
||||
snr = -lin2db(db2lin(-snr) + db2lin(-snr_added))
|
||||
return snr
|
||||
|
||||
|
||||
def per_label_average(values, labels):
|
||||
"""computes the average per defined spectrum band, using labels
|
||||
|
||||
>>> labels = ['A', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'C', 'D', 'D', 'D', 'D']
|
||||
>>> values = [28.51, 28.23, 28.15, 28.17, 28.36, 28.53, 28.64, 28.68, 28.7, 28.71, 28.72, 28.73, 28.74, 28.91, 27.96, 27.85, 27.87, 28.02]
|
||||
>>> per_label_average(values, labels)
|
||||
{'A': 28.28, 'B': 28.68, 'C': 28.91, 'D': 27.92}
|
||||
"""
|
||||
return c() / value
|
||||
|
||||
label_set = sorted(set(labels))
|
||||
summary = {}
|
||||
for label in label_set:
|
||||
vals = [val for val, lab in zip(values, labels) if lab == label]
|
||||
summary[label] = round(mean(vals), 2)
|
||||
return summary
|
||||
|
||||
|
||||
def pretty_summary_print(summary):
|
||||
"""Build a prettty string that shows the summary dict values per label with 2 digits"""
|
||||
if len(summary) == 1:
|
||||
return f'{list(summary.values())[0]:.2f}'
|
||||
text = ', '.join([f'{label}: {value:.2f}' for label, value in summary.items()])
|
||||
return text
|
||||
|
||||
|
||||
def deltawl2deltaf(delta_wl, wavelength):
|
||||
""" deltawl2deltaf(delta_wl, wavelength):
|
||||
"""deltawl2deltaf(delta_wl, wavelength):
|
||||
delta_wl is BW in wavelength units
|
||||
wavelength is the center wl
|
||||
units for delta_wl and wavelength must be same
|
||||
@@ -93,9 +263,9 @@ def deltawl2deltaf(delta_wl, wavelength):
|
||||
|
||||
|
||||
def deltaf2deltawl(delta_f, frequency):
|
||||
""" deltawl2deltaf(delta_f, frequency):
|
||||
converts delta frequency to delta wavelength
|
||||
units for delta_wl and wavelength must be same
|
||||
"""convert delta frequency to delta wavelength
|
||||
|
||||
Units for delta_wl and wavelength must be same.
|
||||
|
||||
:param delta_f: delta frequency in same units as frequency
|
||||
:param frequency: frequency BW is relevant for
|
||||
@@ -110,8 +280,7 @@ def deltaf2deltawl(delta_f, frequency):
|
||||
|
||||
|
||||
def rrc(ffs, baud_rate, alpha):
|
||||
""" rrc(ffs, baud_rate, alpha): computes the root-raised cosine filter
|
||||
function.
|
||||
"""compute the root-raised cosine filter function
|
||||
|
||||
:param ffs: A numpy array of frequencies
|
||||
:param baud_rate: The Baud Rate of the System
|
||||
@@ -126,11 +295,166 @@ def rrc(ffs, baud_rate, alpha):
|
||||
Ts = 1 / baud_rate
|
||||
l_lim = (1 - alpha) / (2 * Ts)
|
||||
r_lim = (1 + alpha) / (2 * Ts)
|
||||
hf = np.zeros(np.shape(ffs))
|
||||
slope_inds = np.where(
|
||||
np.logical_and(np.abs(ffs) > l_lim, np.abs(ffs) < r_lim))
|
||||
hf = zeros(shape(ffs))
|
||||
slope_inds = where(
|
||||
logical_and(abs(ffs) > l_lim, abs(ffs) < r_lim))
|
||||
hf[slope_inds] = 0.5 * (1 + cos((pi * Ts / alpha) *
|
||||
(np.abs(ffs[slope_inds]) - l_lim)))
|
||||
p_inds = np.where(np.logical_and(np.abs(ffs) > 0, np.abs(ffs) < l_lim))
|
||||
(abs(ffs[slope_inds]) - l_lim)))
|
||||
p_inds = where(logical_and(abs(ffs) > 0, abs(ffs) < l_lim))
|
||||
hf[p_inds] = 1
|
||||
return sqrt(hf)
|
||||
|
||||
|
||||
def merge_amplifier_restrictions(dict1, dict2):
|
||||
"""Update contents of dicts recursively
|
||||
|
||||
>>> d1 = {'params': {'restrictions': {'preamp_variety_list': [], 'booster_variety_list': []}}}
|
||||
>>> d2 = {'params': {'target_pch_out_db': -20}}
|
||||
>>> merge_amplifier_restrictions(d1, d2)
|
||||
{'params': {'restrictions': {'preamp_variety_list': [], 'booster_variety_list': []}, 'target_pch_out_db': -20}}
|
||||
|
||||
>>> d3 = {'params': {'restrictions': {'preamp_variety_list': ['foo'], 'booster_variety_list': ['bar']}}}
|
||||
>>> merge_amplifier_restrictions(d1, d3)
|
||||
{'params': {'restrictions': {'preamp_variety_list': [], 'booster_variety_list': []}}}
|
||||
"""
|
||||
|
||||
copy_dict1 = dict1.copy()
|
||||
for key in dict2:
|
||||
if key in dict1:
|
||||
if isinstance(dict1[key], dict):
|
||||
copy_dict1[key] = merge_amplifier_restrictions(copy_dict1[key], dict2[key])
|
||||
else:
|
||||
copy_dict1[key] = dict2[key]
|
||||
return copy_dict1
|
||||
|
||||
|
||||
def silent_remove(this_list, elem):
|
||||
"""Remove matching elements from a list without raising ValueError
|
||||
|
||||
>>> li = [0, 1]
|
||||
>>> li = silent_remove(li, 1)
|
||||
>>> li
|
||||
[0]
|
||||
>>> li = silent_remove(li, 1)
|
||||
>>> li
|
||||
[0]
|
||||
"""
|
||||
|
||||
try:
|
||||
this_list.remove(elem)
|
||||
except ValueError:
|
||||
pass
|
||||
return this_list
|
||||
|
||||
|
||||
def automatic_nch(f_min, f_max, spacing):
|
||||
"""How many channels are available in the spectrum
|
||||
|
||||
:param f_min Lowest frequenecy [Hz]
|
||||
:param f_max Highest frequency [Hz]
|
||||
:param spacing Channel width [Hz]
|
||||
:return Number of uniform channels
|
||||
|
||||
>>> automatic_nch(191.325e12, 196.125e12, 50e9)
|
||||
96
|
||||
>>> automatic_nch(193.475e12, 193.525e12, 50e9)
|
||||
1
|
||||
"""
|
||||
return int((f_max - f_min) // spacing)
|
||||
|
||||
|
||||
def automatic_fmax(f_min, spacing, nch):
|
||||
"""Find the high-frequenecy boundary of a spectrum
|
||||
|
||||
:param f_min Start of the spectrum (lowest frequency edge) [Hz]
|
||||
:param spacing Grid/channel spacing [Hz]
|
||||
:param nch Number of channels
|
||||
:return End of the spectrum (highest frequency) [Hz]
|
||||
|
||||
>>> automatic_fmax(191.325e12, 50e9, 96)
|
||||
196125000000000.0
|
||||
"""
|
||||
return f_min + spacing * nch
|
||||
|
||||
|
||||
def convert_length(value, units):
|
||||
"""Convert length into basic SI units
|
||||
|
||||
>>> convert_length(1, 'km')
|
||||
1000.0
|
||||
>>> convert_length(2.0, 'km')
|
||||
2000.0
|
||||
>>> convert_length(123, 'm')
|
||||
123.0
|
||||
>>> convert_length(123.0, 'm')
|
||||
123.0
|
||||
>>> convert_length(42.1, 'km')
|
||||
42100.0
|
||||
>>> convert_length(666, 'yards')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
gnpy.core.exceptions.ConfigurationError: Cannot convert length in "yards" into meters
|
||||
"""
|
||||
if units == 'm':
|
||||
return value * 1e0
|
||||
elif units == 'km':
|
||||
return value * 1e3
|
||||
else:
|
||||
raise ConfigurationError(f'Cannot convert length in "{units}" into meters')
|
||||
|
||||
|
||||
def replace_none(dictionary):
|
||||
""" Replaces None with inf values in a frequency slots dict
|
||||
|
||||
>>> replace_none({'N': 3, 'M': None})
|
||||
{'N': 3, 'M': inf}
|
||||
|
||||
"""
|
||||
for key, val in dictionary.items():
|
||||
if val is None:
|
||||
dictionary[key] = float('inf')
|
||||
if val == float('inf'):
|
||||
dictionary[key] = None
|
||||
return dictionary
|
||||
|
||||
|
||||
def order_slots(slots):
|
||||
""" Order frequency slots from larger slots to smaller ones up to None
|
||||
|
||||
>>> l = [{'N': 3, 'M': None}, {'N': 2, 'M': 1}, {'N': None, 'M': None},{'N': 7, 'M': 2},{'N': None, 'M': 1} , {'N': None, 'M': 0}]
|
||||
>>> order_slots(l)
|
||||
([7, 2, None, None, 3, None], [2, 1, 1, 0, None, None], [3, 1, 4, 5, 0, 2])
|
||||
"""
|
||||
slots_list = deepcopy(slots)
|
||||
slots_list = [replace_none(e) for e in slots_list]
|
||||
for i, e in enumerate(slots_list):
|
||||
e['i'] = i
|
||||
slots_list = sorted(slots_list, key=lambda x: (-x['M'], x['N']) if x['M'] != float('inf') else (x['M'], x['N']))
|
||||
slots_list = [replace_none(e) for e in slots_list]
|
||||
return [e['N'] for e in slots_list], [e['M'] for e in slots_list], [e['i'] for e in slots_list]
|
||||
|
||||
|
||||
def restore_order(elements, order):
|
||||
""" Use order to re-order the element of the list, and ignore None values
|
||||
|
||||
>>> restore_order([7, 2, None, None, 3, None], [3, 1, 4, 5, 0, 2])
|
||||
[3, 2, 7]
|
||||
"""
|
||||
return [elements[i[0]] for i in sorted(enumerate(order), key=lambda x:x[1]) if elements[i[0]] is not None]
|
||||
|
||||
|
||||
def calculate_absolute_min_or_zero(x: array) -> array:
|
||||
"""Calculates the element-wise absolute minimum between the x and zero.
|
||||
|
||||
Parameters:
|
||||
x (array): The first input array.
|
||||
|
||||
Returns:
|
||||
array: The element-wise absolute minimum between x and zero.
|
||||
|
||||
Example:
|
||||
>>> x = array([-1, 2, -3])
|
||||
>>> calculate_absolute_min_or_zero(x)
|
||||
array([1., 0., 3.])
|
||||
"""
|
||||
return (abs(x) - x) / 2
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
10278
gnpy/example-data/CORONET_Global_Topology.json
Normal file
10278
gnpy/example-data/CORONET_Global_Topology.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
gnpy/example-data/CORONET_Global_Topology.xls
Normal file
BIN
gnpy/example-data/CORONET_Global_Topology.xls
Normal file
Binary file not shown.
160
gnpy/example-data/Juniper-BoosterHG.json
Normal file
160
gnpy/example-data/Juniper-BoosterHG.json
Normal file
@@ -0,0 +1,160 @@
|
||||
{
|
||||
"nf_fit_coeff": [
|
||||
0.0008,
|
||||
0.0272,
|
||||
-0.2249,
|
||||
6.4902
|
||||
],
|
||||
"f_min": 191.4e12,
|
||||
"f_max": 196.1e12,
|
||||
"nf_ripple": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"gain_ripple": [
|
||||
-0.15656302345061,
|
||||
-0.22244242043552,
|
||||
-0.25188965661642,
|
||||
-0.23575900335007,
|
||||
-0.20897508375209,
|
||||
-0.19440221943049,
|
||||
-0.18324644053602,
|
||||
-0.18053287269681,
|
||||
-0.17113588777219,
|
||||
-0.15460322445561,
|
||||
-0.13550774706866,
|
||||
-0.10606051088777,
|
||||
-0.0765630234506,
|
||||
-0.04962835008375,
|
||||
-0.01319618927973,
|
||||
0.01027114740367,
|
||||
0.03378873534338,
|
||||
0.04961788107202,
|
||||
0.04494451423784,
|
||||
0.0399193886097,
|
||||
0.01584903685091,
|
||||
-0.00420121440538,
|
||||
-0.01847257118928,
|
||||
-0.02475397822447,
|
||||
-0.01053287269681,
|
||||
0.01509526800668,
|
||||
0.05921587102177,
|
||||
0.1191656197655,
|
||||
0.18147717755444,
|
||||
0.23579878559464,
|
||||
0.26941687604691,
|
||||
0.27836159966498,
|
||||
0.26956762981574,
|
||||
0.23826109715241,
|
||||
0.18936662479061,
|
||||
0.1204721524288,
|
||||
0.0453465242881,
|
||||
-0.00877407872698,
|
||||
-0.02199015912898,
|
||||
0.00107516750419,
|
||||
0.02795958961474,
|
||||
0.02740682579566,
|
||||
-0.01028161641541,
|
||||
-0.05982935510889,
|
||||
-0.06701528475711,
|
||||
0.00223094639866,
|
||||
0.14157768006701,
|
||||
0.15017064489112
|
||||
],
|
||||
"dgt": [
|
||||
1.0,
|
||||
1.03941448941778,
|
||||
1.07773189112355,
|
||||
1.11575888725852,
|
||||
1.15209185089701,
|
||||
1.18632744096844,
|
||||
1.21911100318577,
|
||||
1.24931318255134,
|
||||
1.27657903892303,
|
||||
1.30069883494415,
|
||||
1.32210817897091,
|
||||
1.3405812000038,
|
||||
1.35690844654118,
|
||||
1.3710092503689,
|
||||
1.38430337205545,
|
||||
1.3966294751726,
|
||||
1.40864903907609,
|
||||
1.42089447397912,
|
||||
1.43476940680732,
|
||||
1.44977369463316,
|
||||
1.46637521309853,
|
||||
1.48420288841848,
|
||||
1.50335352244996,
|
||||
1.5242627235492,
|
||||
1.54578500307573,
|
||||
1.56750088631614,
|
||||
1.58973304612691,
|
||||
1.61073904908309,
|
||||
1.63068023161292,
|
||||
1.64799163036252,
|
||||
1.66286684904577,
|
||||
1.6761448370895,
|
||||
1.68845480656382,
|
||||
1.70379790088896,
|
||||
1.72461030013125,
|
||||
1.75428006928365,
|
||||
1.79748596476494,
|
||||
1.85543800978691,
|
||||
1.92915262384742,
|
||||
2.01414465424155,
|
||||
2.10336369905543,
|
||||
2.19013043016015,
|
||||
2.26678136721453,
|
||||
2.33147727493671,
|
||||
2.38192717604575,
|
||||
2.41879254989742,
|
||||
2.44342862248888,
|
||||
2.4553191172498
|
||||
]
|
||||
}
|
||||
6233
gnpy/example-data/Sweden_OpenROADMv4_example_network.json
Normal file
6233
gnpy/example-data/Sweden_OpenROADMv4_example_network.json
Normal file
File diff suppressed because it is too large
Load Diff
6233
gnpy/example-data/Sweden_OpenROADMv5_example_network.json
Normal file
6233
gnpy/example-data/Sweden_OpenROADMv5_example_network.json
Normal file
File diff suppressed because it is too large
Load Diff
104
gnpy/example-data/create_eqpt_sheet.py
Normal file
104
gnpy/example-data/create_eqpt_sheet.py
Normal file
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
create_eqpt_sheet.py
|
||||
====================
|
||||
|
||||
XLS parser that can be called to create a "City" column in the "Eqpt" sheet.
|
||||
|
||||
If not present in the "Nodes" sheet, the "Type" column will be implicitly
|
||||
determined based on the topology.
|
||||
"""
|
||||
|
||||
from xlrd import open_workbook
|
||||
from argparse import ArgumentParser
|
||||
|
||||
PARSER = ArgumentParser()
|
||||
PARSER.add_argument('workbook', nargs='?', default='meshTopologyExampleV2.xls',
|
||||
help='create the mandatory columns in Eqpt sheet')
|
||||
|
||||
|
||||
def ALL_ROWS(sh, start=0):
|
||||
return (sh.row(x) for x in range(start, sh.nrows))
|
||||
|
||||
|
||||
class Node:
|
||||
""" Node element contains uid, list of connected nodes and eqpt type
|
||||
"""
|
||||
|
||||
def __init__(self, uid, to_node):
|
||||
self.uid = uid
|
||||
self.to_node = to_node
|
||||
self.eqpt = None
|
||||
|
||||
def __repr__(self):
|
||||
return f'uid {self.uid} \nto_node {[node for node in self.to_node]}\neqpt {self.eqpt}\n'
|
||||
|
||||
def __str__(self):
|
||||
return f'uid {self.uid} \nto_node {[node for node in self.to_node]}\neqpt {self.eqpt}\n'
|
||||
|
||||
|
||||
def read_excel(input_filename):
|
||||
""" read excel Nodes and Links sheets and create a dict of nodes with
|
||||
their to_nodes and type of eqpt
|
||||
"""
|
||||
with open_workbook(input_filename) as wobo:
|
||||
# reading Links sheet
|
||||
links_sheet = wobo.sheet_by_name('Links')
|
||||
nodes = {}
|
||||
for row in ALL_ROWS(links_sheet, start=5):
|
||||
try:
|
||||
nodes[row[0].value].to_node.append(row[1].value)
|
||||
except KeyError:
|
||||
nodes[row[0].value] = Node(row[0].value, [row[1].value])
|
||||
try:
|
||||
nodes[row[1].value].to_node.append(row[0].value)
|
||||
except KeyError:
|
||||
nodes[row[1].value] = Node(row[1].value, [row[0].value])
|
||||
|
||||
nodes_sheet = wobo.sheet_by_name('Nodes')
|
||||
for row in ALL_ROWS(nodes_sheet, start=5):
|
||||
node = row[0].value
|
||||
eqpt = row[6].value
|
||||
try:
|
||||
if eqpt == 'ILA' and len(nodes[node].to_node) != 2:
|
||||
print(f'Inconsistancy ILA node with degree > 2: {node} ')
|
||||
exit()
|
||||
if eqpt == '' and len(nodes[node].to_node) == 2:
|
||||
nodes[node].eqpt = 'ILA'
|
||||
elif eqpt == '' and len(nodes[node].to_node) != 2:
|
||||
nodes[node].eqpt = 'ROADM'
|
||||
else:
|
||||
nodes[node].eqpt = eqpt
|
||||
except KeyError:
|
||||
print(f'inconsistancy between nodes and links sheet: {node} is not listed in links')
|
||||
exit()
|
||||
return nodes
|
||||
|
||||
|
||||
def create_eqt_template(nodes, input_filename):
|
||||
""" writes list of node A node Z corresponding to Nodes and Links sheets in order
|
||||
to help user populating Eqpt
|
||||
"""
|
||||
output_filename = f'{input_filename[:-4]}_eqpt_sheet.txt'
|
||||
with open(output_filename, 'w', encoding='utf-8') as my_file:
|
||||
# print header similar to excel
|
||||
my_file.write('OPTIONAL\n\n\n\
|
||||
\t\tNode a egress amp (from a to z)\t\t\t\t\tNode a ingress amp (from z to a) \
|
||||
\nNode A \tNode Z \tamp type \tatt_in \tamp gain \ttilt \tatt_out\
|
||||
amp type \tatt_in \tamp gain \ttilt \tatt_out\n')
|
||||
|
||||
for node in nodes.values():
|
||||
if node.eqpt == 'ILA':
|
||||
my_file.write(f'{node.uid}\t{node.to_node[0]}\n')
|
||||
if node.eqpt == 'ROADM':
|
||||
for to_node in node.to_node:
|
||||
my_file.write(f'{node.uid}\t{to_node}\n')
|
||||
|
||||
print(f'File {output_filename} successfully created with Node A - Node Z entries for Eqpt sheet in excel file.')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ARGS = PARSER.parse_args()
|
||||
create_eqt_template(read_excel(ARGS.workbook), ARGS.workbook)
|
||||
108
gnpy/example-data/default_edfa_config.json
Normal file
108
gnpy/example-data/default_edfa_config.json
Normal file
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"nf_ripple": [
|
||||
0.0
|
||||
],
|
||||
"gain_ripple": [
|
||||
0.0
|
||||
],
|
||||
"f_min": 191.35e12,
|
||||
"f_max": 196.1e12,
|
||||
"dgt": [
|
||||
1.0,
|
||||
1.017807767853702,
|
||||
1.0356155337864215,
|
||||
1.0534217504465226,
|
||||
1.0712204022764056,
|
||||
1.0895983485572227,
|
||||
1.108555289615659,
|
||||
1.1280891949729075,
|
||||
1.1476135933863398,
|
||||
1.1672278304018044,
|
||||
1.1869318618366975,
|
||||
1.2067249615595257,
|
||||
1.2264996957264114,
|
||||
1.2428104897182262,
|
||||
1.2556591482982988,
|
||||
1.2650555289898042,
|
||||
1.2744470198196236,
|
||||
1.2838336236692311,
|
||||
1.2932153453410835,
|
||||
1.3040618749785347,
|
||||
1.316383926863083,
|
||||
1.3301807335621048,
|
||||
1.3439818461440451,
|
||||
1.3598972673004606,
|
||||
1.3779439775587023,
|
||||
1.3981208704326855,
|
||||
1.418273806730323,
|
||||
1.4340878115214444,
|
||||
1.445565137158368,
|
||||
1.45273959485914,
|
||||
1.4599103316162523,
|
||||
1.4670307626366115,
|
||||
1.474100442252211,
|
||||
1.48111939735681,
|
||||
1.488134243479226,
|
||||
1.495145456062699,
|
||||
1.502153039909686,
|
||||
1.5097346239790443,
|
||||
1.5178910621476225,
|
||||
1.5266220576235803,
|
||||
1.5353620432989845,
|
||||
1.545374152761467,
|
||||
1.5566577309558969,
|
||||
1.569199764184379,
|
||||
1.5817353179379183,
|
||||
1.5986915141218316,
|
||||
1.6201194134191075,
|
||||
1.6460167077689267,
|
||||
1.6719047669939942,
|
||||
1.6918150918099673,
|
||||
1.7057507692361864,
|
||||
1.7137640932265894,
|
||||
1.7217732861435076,
|
||||
1.7297783508684146,
|
||||
1.737780757913635,
|
||||
1.7459181197626403,
|
||||
1.7541903672600494,
|
||||
1.7625959636196327,
|
||||
1.7709972329654864,
|
||||
1.7793941781790852,
|
||||
1.7877868031023945,
|
||||
1.7961751115773796,
|
||||
1.8045606557581335,
|
||||
1.8139629377087627,
|
||||
1.824381436842932,
|
||||
1.835814081380705,
|
||||
1.847275503201129,
|
||||
1.862235672444246,
|
||||
1.8806927939516411,
|
||||
1.9026104247588487,
|
||||
1.9245345552113182,
|
||||
1.9482128147680253,
|
||||
1.9736443063300082,
|
||||
2.0008103857988204,
|
||||
2.0279625371819305,
|
||||
2.055100772005235,
|
||||
2.082225099873648,
|
||||
2.1183028432496016,
|
||||
2.16337565384239,
|
||||
2.2174389328192197,
|
||||
2.271520771371253,
|
||||
2.322373696229342,
|
||||
2.3699990328716107,
|
||||
2.414398437185221,
|
||||
2.4587748041127506,
|
||||
2.499446286796604,
|
||||
2.5364027376452056,
|
||||
2.5696460593920065,
|
||||
2.602860350286428,
|
||||
2.630396440815385,
|
||||
2.6521732021128046,
|
||||
2.6681935771243177,
|
||||
2.6841217449620203,
|
||||
2.6947834587664494,
|
||||
2.705443819238505,
|
||||
2.714526681131686
|
||||
]
|
||||
}
|
||||
80
gnpy/example-data/edfa_example_network.json
Normal file
80
gnpy/example-data/edfa_example_network.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"network_name": "EDFA Example Network - P2P",
|
||||
"elements": [
|
||||
{
|
||||
"uid": "Site_A",
|
||||
"type": "Transceiver",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"city": "Site A",
|
||||
"region": "",
|
||||
"latitude": 0,
|
||||
"longitude": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "Span1",
|
||||
"type": "Fiber",
|
||||
"type_variety": "SSMF",
|
||||
"params": {
|
||||
"length": 80,
|
||||
"loss_coef": 0.2,
|
||||
"length_units": "km",
|
||||
"att_in": 0,
|
||||
"con_in": 0.5,
|
||||
"con_out": 0.5
|
||||
},
|
||||
"metadata": {
|
||||
"location": {
|
||||
"region": "",
|
||||
"latitude": 1,
|
||||
"longitude": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "Edfa1",
|
||||
"type": "Edfa",
|
||||
"type_variety": "std_low_gain",
|
||||
"operational": {
|
||||
"gain_target": 17,
|
||||
"tilt_target": 0,
|
||||
"out_voa": 0
|
||||
},
|
||||
"metadata": {
|
||||
"location": {
|
||||
"region": "",
|
||||
"latitude": 2,
|
||||
"longitude": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "Site_B",
|
||||
"type": "Transceiver",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"city": "Site B",
|
||||
"region": "",
|
||||
"latitude": 2,
|
||||
"longitude": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"from_node": "Site_A",
|
||||
"to_node": "Span1"
|
||||
},
|
||||
{
|
||||
"from_node": "Span1",
|
||||
"to_node": "Edfa1"
|
||||
},
|
||||
{
|
||||
"from_node": "Edfa1",
|
||||
"to_node": "Site_B"
|
||||
}
|
||||
]
|
||||
}
|
||||
0
examples/edfa_model/DFG_96.txt → gnpy/example-data/edfa_model/DFG_96.txt
Executable file → Normal file
0
examples/edfa_model/DFG_96.txt → gnpy/example-data/edfa_model/DFG_96.txt
Executable file → Normal file
0
examples/edfa_model/DGT_96.txt → gnpy/example-data/edfa_model/DGT_96.txt
Executable file → Normal file
0
examples/edfa_model/DGT_96.txt → gnpy/example-data/edfa_model/DGT_96.txt
Executable file → Normal file
0
examples/edfa_model/NFR_96.txt → gnpy/example-data/edfa_model/NFR_96.txt
Executable file → Normal file
0
examples/edfa_model/NFR_96.txt → gnpy/example-data/edfa_model/NFR_96.txt
Executable file → Normal file
6
gnpy/example-data/edfa_model/OA.json
Normal file
6
gnpy/example-data/edfa_model/OA.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"nf_ripple": "NFR_96.txt",
|
||||
"gain_ripple": "DFG_96.txt",
|
||||
"dgt": "DGT_96.txt",
|
||||
"nf_fit_coeff": "pNFfit3.txt"
|
||||
}
|
||||
300
gnpy/example-data/edfa_model/amplifier_models_description.rst
Normal file
300
gnpy/example-data/edfa_model/amplifier_models_description.rst
Normal file
@@ -0,0 +1,300 @@
|
||||
*********************************************
|
||||
Amplifier models and configuration
|
||||
*********************************************
|
||||
|
||||
|
||||
1. Equipment configuration description
|
||||
#######################################
|
||||
|
||||
Equipment description defines equipment types and parameters.
|
||||
It takes place in the default **eqpt_config.json** file.
|
||||
By default **gnpy-transmission-example** uses **eqpt_config.json** file and that
|
||||
can be changed with **-e** or **--equipment** command line parameter.
|
||||
|
||||
2. Amplifier parameters and subtypes
|
||||
#######################################
|
||||
|
||||
Several amplifiers can be used by GNpy, so they are defined as an array of equipment parameters in **eqpt_config.json** file.
|
||||
|
||||
- *"type_variety"*:
|
||||
Each amplifier is identified by its unique *"type_variety"*, which is used in the topology files input to reference a specific amplifier. It is a user free defined id.
|
||||
|
||||
For each amplifier *type_variety*, specific parameters are describing its attributes and performance:
|
||||
|
||||
- *"type_def"*:
|
||||
Sets the amplifier model that the simulation will use to calculate the ase noise contribution. 5 models are defined with reserved words:
|
||||
|
||||
- *"advanced_model"*
|
||||
- *"variable_gain"*
|
||||
- *"fixed_gain"*
|
||||
- *"dual_stage"*
|
||||
- *"openroadm"*
|
||||
*see next section for a full description of these models*
|
||||
|
||||
- *"advanced_config_from_json"*:
|
||||
**This parameter is only applicable to the _"advanced_model"_ model**
|
||||
|
||||
json file name describing:
|
||||
|
||||
- nf_fit_coeff
|
||||
- f_min/max
|
||||
- gain_ripple
|
||||
- nf_ripple
|
||||
- dgt
|
||||
|
||||
*see next section for a full description*
|
||||
|
||||
- *"gain_flatmax"*:
|
||||
amplifier maximum gain in dB before its extended gain range: flat or nominal tilt output.
|
||||
|
||||
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.
|
||||
|
||||
- *"gain_min"*:
|
||||
amplifier minimum gain in dB.
|
||||
|
||||
If gain < gain_min, the amplifier input is automatically padded, which results in
|
||||
|
||||
NF += gain_min - gain
|
||||
|
||||
- *"p_max"*:
|
||||
amplifier max output power, full load
|
||||
|
||||
Total signal output power will not be allowed beyond this value
|
||||
|
||||
- *"nf_min/max"*:
|
||||
**These parameters are only applicable to the _"variable_gain"_ model**
|
||||
|
||||
min & max NF values in dB
|
||||
|
||||
NF_min is the amplifier NF @ gain_max
|
||||
|
||||
NF_max is the amplifier NF @ gain_min
|
||||
|
||||
- *"nf_coef"*:
|
||||
**This parameter is only applicable to the *"openroadm"* model**
|
||||
|
||||
[a, b, c, d] 3rd order polynomial coefficients list to define the incremental OSNR vs Pin
|
||||
|
||||
Incremental OSNR is the amplifier OSNR contribution
|
||||
|
||||
Pin is the amplifier channel input power defined in a 50GHz bandwidth
|
||||
|
||||
Incremental OSNR = a*Pin³ + b*Pin² + c*Pin + d
|
||||
|
||||
- *"preamp_variety"*:
|
||||
**This parameter is only applicable to the _"dual_stage"_ model**
|
||||
|
||||
1st stage type_variety
|
||||
|
||||
- *"booster_variety"*:
|
||||
**This parameter is only applicable to the *"dual_stage"* model**
|
||||
|
||||
2nd stage type_variety
|
||||
|
||||
- *"out_voa_auto"*: true/false
|
||||
**power_mode only**
|
||||
|
||||
**This parameter is only applicable to the *"advanced_model"* and *"variable_gain"* models**
|
||||
|
||||
If "out_voa_auto": true, auto_design will chose the output_VOA value that maximizes the amplifier gain within its power capability and therefore minimizes its NF.
|
||||
|
||||
- *"allowed_for_design"*: true/false
|
||||
**auto_design only**
|
||||
|
||||
Tells auto_design if this amplifier can be picked for the design (deactivates unwanted amplifiers)
|
||||
|
||||
It does not prevent the use of an amplifier if it is placed in the topology input.
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{"Edfa": [{
|
||||
"type_variety": "std_medium_gain",
|
||||
"type_def": "variable_gain",
|
||||
"gain_flatmax": 26,
|
||||
"gain_min": 15,
|
||||
"p_max": 23,
|
||||
"nf_min": 6,
|
||||
"nf_max": 10,
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "std_low_gain",
|
||||
"type_def": "variable_gain",
|
||||
"gain_flatmax": 16,
|
||||
"gain_min": 8,
|
||||
"p_max": 23,
|
||||
"nf_min": 6.5,
|
||||
"nf_max": 11,
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": true
|
||||
}
|
||||
]}
|
||||
|
||||
|
||||
3. Amplifier models
|
||||
#######################################
|
||||
|
||||
In an opensource and multi-vendor environnement, it is needed to support different use cases and context. Therefore several models are supported for amplifiers.
|
||||
|
||||
5 types of EDFA definition are possible and referenced by the *"type_def"* parameter with the following reserved words:
|
||||
|
||||
- *"advanced_model"*
|
||||
This model is refered as a whitebox model because of the detailed level of knowledge that is required. The amplifier NF model and ripple definition are described by a json file referenced with *"advanced_config_from_json"*: json filename. This json file contains:
|
||||
|
||||
- nf_fit_coeff: [a,b,c,d]
|
||||
|
||||
3rd order polynomial NF = f(-dg) coeficients list
|
||||
|
||||
dg = gain - gain_max
|
||||
|
||||
- f_min/max: amplifier frequency range in Hz
|
||||
- gain_ripple : [...]
|
||||
|
||||
amplifier gain ripple excursion comb list in dB across the frequency range.
|
||||
- nf_ripple : [...]
|
||||
|
||||
amplifier nf ripple excursion comb list in dB across the frequency range.
|
||||
- dgt : [...]
|
||||
amplifier dynamic gain tilt comb list across the frequency range.
|
||||
|
||||
*See next section for the generation of this json file*
|
||||
|
||||
.. code-block:: json-object
|
||||
|
||||
"Edfa":[{
|
||||
"type_variety": "high_detail_model_example",
|
||||
"type_def": "advanced_model",
|
||||
"gain_flatmax": 25,
|
||||
"gain_min": 15,
|
||||
"p_max": 21,
|
||||
"advanced_config_from_json": "std_medium_gain_advanced_config.json",
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": false
|
||||
}
|
||||
]
|
||||
|
||||
- *"variable_gain"*
|
||||
This model is refered as an operator model because a lower level of knowledge is required. A full polynomial description of the NF cross the gain range is not required. Instead, NF_min and NF_max values are required and used by the code to model a dual stage amplifier with an internal mid stage VOA. NF_min and NF_max values are typically available from equipment suppliers data-sheet.
|
||||
|
||||
There is a default JSON file ”default_edfa_config.json”* to enforce 0 tilt and ripple values because GNpy core algorithm is a multi-carrier propogation.
|
||||
- gain_ripple =[0,...,0]
|
||||
- nf_ripple = [0,...,0]
|
||||
- dgt = [...] generic dgt comb
|
||||
|
||||
.. code-block:: json-object
|
||||
|
||||
"Edfa":[{
|
||||
"type_variety": "std_medium_gain",
|
||||
"type_def": "variable_gain",
|
||||
"gain_flatmax": 26,
|
||||
"gain_min": 15,
|
||||
"p_max": 23,
|
||||
"nf_min": 6,
|
||||
"nf_max": 10,
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": true
|
||||
}
|
||||
]
|
||||
|
||||
- *"fixed_gain"*
|
||||
This model is also an operator model with a single NF value that emulates basic single coil amplifiers without internal VOA.
|
||||
|
||||
if gain_min < gain < gain_max, NF == nf0
|
||||
|
||||
if gain < gain_min, the amplifier input is automatically padded, which results in
|
||||
|
||||
NF += gain_min - gain
|
||||
|
||||
.. code-block:: json-object
|
||||
|
||||
"Edfa":[{
|
||||
"type_variety": "std_fixed_gain",
|
||||
"type_def": "fixed_gain",
|
||||
"gain_flatmax": 21,
|
||||
"gain_min": 20,
|
||||
"p_max": 21,
|
||||
"nf0": 5.5,
|
||||
"allowed_for_design": false
|
||||
}
|
||||
]
|
||||
|
||||
- *"openroadm"*
|
||||
This model is a black box model replicating OpenRoadm MSA spec for ILA.
|
||||
|
||||
.. code-block:: json-object
|
||||
|
||||
"Edfa":[{
|
||||
"type_variety": "openroadm_ila_low_noise",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 12,
|
||||
"p_max": 22,
|
||||
"nf_coef": [-8.104e-4,-6.221e-2,-5.889e-1,37.62],
|
||||
"allowed_for_design": false
|
||||
}
|
||||
]
|
||||
|
||||
- *"dual_stage"*
|
||||
This model allows the cascade (pre-defined combination) of any 2 amplifiers already described in the eqpt_config.json library.
|
||||
|
||||
- preamp_variety defines the 1st stge type variety
|
||||
|
||||
- booster variety defines the 2nd stage type variety
|
||||
|
||||
Both preamp and booster variety must exist in the eqpt libray
|
||||
The resulting NF is the sum of the 2 amplifiers
|
||||
The preamp is operated to its maximum gain
|
||||
|
||||
- gain_min indicates to auto_design when this dual_stage should be used
|
||||
|
||||
But unlike other models the 1st stage input will not be padded: it is always operated to its maximu gain and min NF. Therefore if gain adaptation and padding is needed it will be performed by the 2nd stage.
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"type_variety": "medium+low_gain",
|
||||
"type_def": "dual_stage",
|
||||
"gain_min": 25,
|
||||
"preamp_variety": "std_medium_gain",
|
||||
"booster_variety": "std_low_gain",
|
||||
"allowed_for_design": true
|
||||
}
|
||||
|
||||
4. advanced_config_from_json
|
||||
#######################################
|
||||
|
||||
The build_oa_json.py library in ``gnpy/example-data/edfa_model/`` can be used to build the json file required for the amplifier advanced_model type_def:
|
||||
|
||||
Update an existing json file with all the 96ch txt files for a given amplifier type
|
||||
amplifier type 'OA_type1' is hard coded but can be modified and other types added
|
||||
returns an updated amplifier json file: output_json_file_name = 'edfa_config.json'
|
||||
amplifier file names
|
||||
|
||||
Convert a set of amplifier files + input json definiton file into a valid edfa_json_file:
|
||||
|
||||
nf_fit_coeff: NF 3rd order polynomial coefficients txt file
|
||||
|
||||
nf = f(dg) with dg = gain_operational - gain_max
|
||||
|
||||
nf_ripple: NF ripple excursion txt file
|
||||
|
||||
gain_ripple: gain ripple txt file
|
||||
|
||||
dgt: dynamic gain txt file
|
||||
|
||||
input json file in argument (defult = 'OA.json')
|
||||
|
||||
the json input file should have the following fields:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"nf_fit_coeff": "nf_filename.txt",
|
||||
"nf_ripple": "nf_ripple_filename.txt",
|
||||
"gain_ripple": "DFG_filename.txt",
|
||||
"dgt": "DGT_filename.txt"
|
||||
}
|
||||
|
||||
89
gnpy/example-data/edfa_model/build_oa_json.py
Normal file
89
gnpy/example-data/edfa_model/build_oa_json.py
Normal file
@@ -0,0 +1,89 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Tue Jan 30 12:32:00 2018
|
||||
|
||||
@author: jeanluc-auge
|
||||
|
||||
update an existing json file with all the 96ch txt files for a given amplifier type
|
||||
amplifier type 'OA_type1' is hard coded but can be modified and other types added
|
||||
returns an updated amplifier json file: output_json_file_name = 'edfa_config.json'
|
||||
"""
|
||||
import re
|
||||
import sys
|
||||
import json
|
||||
import numpy as np
|
||||
|
||||
"""amplifier file names
|
||||
convert a set of amplifier files + input json definiton file into a valid edfa_json_file:
|
||||
nf_fit_coeff: NF 3rd order polynomial coefficients txt file
|
||||
nf = f(dg)
|
||||
with dg = gain_operational - gain_max
|
||||
nf_ripple: NF ripple excursion txt file
|
||||
gain_ripple: gain ripple txt file
|
||||
dgt: dynamic gain txt file
|
||||
input json file in argument (defult = 'OA.json')
|
||||
|
||||
the json input file should have the following fields:
|
||||
{
|
||||
"nf_fit_coeff": "nf_filename.txt",
|
||||
"nf_ripple": "nf_ripple_filename.txt",
|
||||
"gain_ripple": "DFG_filename.txt",
|
||||
"dgt": "DGT_filename.txt",
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
input_json_file_name = "OA.json" # default path
|
||||
output_json_file_name = "default_edfa_config.json"
|
||||
gain_ripple_field = "gain_ripple"
|
||||
nf_ripple_field = "nf_ripple"
|
||||
nf_fit_coeff = "nf_fit_coeff"
|
||||
|
||||
|
||||
def read_file(field, file_name):
|
||||
"""read and format the 96 channels txt files describing the amplifier NF and ripple
|
||||
convert dfg into gain ripple by removing the mean component
|
||||
"""
|
||||
|
||||
# with open(path + file_name,'r') as this_file:
|
||||
# data = this_file.read()
|
||||
# data.strip()
|
||||
#data = re.sub(r"([0-9])([ ]{1,3})([0-9-+])",r"\1,\3",data)
|
||||
#data = list(data.split(","))
|
||||
#data = [float(x) for x in data]
|
||||
data = np.loadtxt(file_name)
|
||||
print(len(data), file_name)
|
||||
if field == gain_ripple_field or field == nf_ripple_field:
|
||||
# consider ripple excursion only to avoid redundant information
|
||||
# because the max flat_gain is already given by the 'gain_flat' field in json
|
||||
# remove the mean component
|
||||
print(file_name, ', mean value =', data.mean(), ' is substracted')
|
||||
data = data - data.mean()
|
||||
data = data.tolist()
|
||||
return data
|
||||
|
||||
|
||||
def input_json(path):
|
||||
"""read the json input file and add all the 96 channels txt files
|
||||
create the output json file with output_json_file_name"""
|
||||
with open(path, 'r') as edfa_json_file:
|
||||
amp_text = edfa_json_file.read()
|
||||
amp_dict = json.loads(amp_text)
|
||||
|
||||
for k, v in amp_dict.items():
|
||||
if re.search(r'.txt$', str(v)):
|
||||
amp_dict[k] = read_file(k, v)
|
||||
|
||||
amp_text = json.dumps(amp_dict, indent=4)
|
||||
# print(amp_text)
|
||||
with open(output_json_file_name, 'w') as edfa_json_file:
|
||||
edfa_json_file.write(amp_text)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) == 2:
|
||||
path = sys.argv[1]
|
||||
else:
|
||||
path = input_json_file_name
|
||||
input_json(path)
|
||||
0
examples/edfa_model/pNFfit3.txt → gnpy/example-data/edfa_model/pNFfit3.txt
Executable file → Normal file
0
examples/edfa_model/pNFfit3.txt → gnpy/example-data/edfa_model/pNFfit3.txt
Executable file → Normal file
443
gnpy/example-data/eqpt_config.json
Normal file
443
gnpy/example-data/eqpt_config.json
Normal file
@@ -0,0 +1,443 @@
|
||||
{
|
||||
"Edfa": [
|
||||
{
|
||||
"type_variety": "high_detail_model_example",
|
||||
"type_def": "advanced_model",
|
||||
"gain_flatmax": 25,
|
||||
"gain_min": 15,
|
||||
"p_max": 21,
|
||||
"advanced_config_from_json": "std_medium_gain_advanced_config.json",
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "Juniper_BoosterHG",
|
||||
"type_def": "advanced_model",
|
||||
"gain_flatmax": 25,
|
||||
"gain_min": 10,
|
||||
"p_max": 21,
|
||||
"advanced_config_from_json": "Juniper-BoosterHG.json",
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "operator_model_example",
|
||||
"type_def": "variable_gain",
|
||||
"gain_flatmax": 26,
|
||||
"gain_min": 15,
|
||||
"p_max": 23,
|
||||
"nf_min": 6,
|
||||
"nf_max": 10,
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_ila_low_noise",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"nf_coef": [
|
||||
-8.104e-4,
|
||||
-6.221e-2,
|
||||
-5.889e-1,
|
||||
37.62
|
||||
],
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_ila_standard",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"nf_coef": [
|
||||
-5.952e-4,
|
||||
-6.250e-2,
|
||||
-1.071,
|
||||
28.99
|
||||
],
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_mw_mw_preamp",
|
||||
"type_def": "openroadm_preamp",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_mw_mw_preamp_typical_ver5",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"nf_coef": [
|
||||
-5.952e-4,
|
||||
-6.250e-2,
|
||||
-1.071,
|
||||
28.99
|
||||
],
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_mw_mw_preamp_worstcase_ver5",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"nf_coef": [
|
||||
-5.952e-4,
|
||||
-6.250e-2,
|
||||
-1.071,
|
||||
27.99
|
||||
],
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_mw_mw_booster",
|
||||
"type_def": "openroadm_booster",
|
||||
"gain_flatmax": 32,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "std_high_gain",
|
||||
"type_def": "variable_gain",
|
||||
"gain_flatmax": 35,
|
||||
"gain_min": 25,
|
||||
"p_max": 21,
|
||||
"nf_min": 5.5,
|
||||
"nf_max": 7,
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "std_medium_gain",
|
||||
"type_def": "variable_gain",
|
||||
"gain_flatmax": 26,
|
||||
"gain_min": 15,
|
||||
"p_max": 23,
|
||||
"nf_min": 6,
|
||||
"nf_max": 10,
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "std_low_gain",
|
||||
"type_def": "variable_gain",
|
||||
"gain_flatmax": 16,
|
||||
"gain_min": 8,
|
||||
"p_max": 23,
|
||||
"nf_min": 6.5,
|
||||
"nf_max": 11,
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "high_power",
|
||||
"type_def": "variable_gain",
|
||||
"gain_flatmax": 16,
|
||||
"gain_min": 8,
|
||||
"p_max": 25,
|
||||
"nf_min": 9,
|
||||
"nf_max": 15,
|
||||
"out_voa_auto": false,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "std_fixed_gain",
|
||||
"type_def": "fixed_gain",
|
||||
"gain_flatmax": 21,
|
||||
"gain_min": 20,
|
||||
"p_max": 21,
|
||||
"nf0": 5.5,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "4pumps_raman",
|
||||
"type_def": "fixed_gain",
|
||||
"gain_flatmax": 12,
|
||||
"gain_min": 12,
|
||||
"p_max": 21,
|
||||
"nf0": -1,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "hybrid_4pumps_lowgain",
|
||||
"type_def": "dual_stage",
|
||||
"raman": true,
|
||||
"gain_min": 25,
|
||||
"preamp_variety": "4pumps_raman",
|
||||
"booster_variety": "std_low_gain",
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "hybrid_4pumps_mediumgain",
|
||||
"type_def": "dual_stage",
|
||||
"raman": true,
|
||||
"gain_min": 25,
|
||||
"preamp_variety": "4pumps_raman",
|
||||
"booster_variety": "std_medium_gain",
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "medium+low_gain",
|
||||
"type_def": "dual_stage",
|
||||
"gain_min": 25,
|
||||
"preamp_variety": "std_medium_gain",
|
||||
"booster_variety": "std_low_gain",
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "medium+high_power",
|
||||
"type_def": "dual_stage",
|
||||
"gain_min": 25,
|
||||
"preamp_variety": "std_medium_gain",
|
||||
"booster_variety": "high_power",
|
||||
"allowed_for_design": false
|
||||
}
|
||||
],
|
||||
"Fiber": [
|
||||
{
|
||||
"type_variety": "SSMF",
|
||||
"dispersion": 1.67e-05,
|
||||
"effective_area": 83e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
},
|
||||
{
|
||||
"type_variety": "NZDF",
|
||||
"dispersion": 0.5e-05,
|
||||
"effective_area": 72e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
},
|
||||
{
|
||||
"type_variety": "LOF",
|
||||
"dispersion": 2.2e-05,
|
||||
"effective_area": 125e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
}
|
||||
],
|
||||
"RamanFiber": [
|
||||
{
|
||||
"type_variety": "SSMF",
|
||||
"dispersion": 1.67e-05,
|
||||
"effective_area": 83e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
}
|
||||
],
|
||||
"Span": [
|
||||
{
|
||||
"power_mode": true,
|
||||
"delta_power_range_db": [
|
||||
-2,
|
||||
3,
|
||||
0.5
|
||||
],
|
||||
"max_fiber_lineic_loss_for_raman": 0.25,
|
||||
"target_extended_gain": 2.5,
|
||||
"max_length": 150,
|
||||
"length_units": "km",
|
||||
"max_loss": 28,
|
||||
"padding": 10,
|
||||
"EOL": 0,
|
||||
"con_in": 0,
|
||||
"con_out": 0
|
||||
}
|
||||
],
|
||||
"Roadm": [
|
||||
{
|
||||
"target_pch_out_db": -20,
|
||||
"add_drop_osnr": 38,
|
||||
"pmd": 0,
|
||||
"pdl": 0,
|
||||
"restrictions": {
|
||||
"preamp_variety_list": [],
|
||||
"booster_variety_list": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type_variety": "roadm_type_1",
|
||||
"target_pch_out_db": -18,
|
||||
"add_drop_osnr": 35,
|
||||
"pmd": 0,
|
||||
"pdl": 0,
|
||||
"restrictions": {
|
||||
"preamp_variety_list": [],
|
||||
"booster_variety_list": []
|
||||
},
|
||||
"roadm-path-impairments": []
|
||||
},
|
||||
{
|
||||
"type_variety": "detailed_impairments",
|
||||
"target_pch_out_db": -20,
|
||||
"add_drop_osnr": 38,
|
||||
"pmd": 0,
|
||||
"pdl": 0,
|
||||
"restrictions": {
|
||||
"preamp_variety_list": [],
|
||||
"booster_variety_list": []
|
||||
},
|
||||
"roadm-path-impairments": [
|
||||
{
|
||||
"roadm-path-impairments-id": 0,
|
||||
"roadm-express-path": [
|
||||
{
|
||||
"frequency-range": {
|
||||
"lower-frequency": 191.3e12,
|
||||
"upper-frequency": 196.1e12
|
||||
},
|
||||
"roadm-pmd": 0,
|
||||
"roadm-cd": 0,
|
||||
"roadm-pdl": 0,
|
||||
"roadm-inband-crosstalk": 0,
|
||||
"roadm-maxloss": 16.5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"roadm-path-impairments-id": 1,
|
||||
"roadm-add-path": [
|
||||
{
|
||||
"frequency-range": {
|
||||
"lower-frequency": 191.3e12,
|
||||
"upper-frequency": 196.1e12
|
||||
},
|
||||
"roadm-pmd": 0,
|
||||
"roadm-cd": 0,
|
||||
"roadm-pdl": 0,
|
||||
"roadm-inband-crosstalk": 0,
|
||||
"roadm-maxloss": 11.5,
|
||||
"roadm-pmax": 2.5,
|
||||
"roadm-osnr": 41,
|
||||
"roadm-noise-figure": 23
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"roadm-path-impairments-id": 2,
|
||||
"roadm-drop-path": [
|
||||
{
|
||||
"frequency-range": {
|
||||
"lower-frequency": 191.3e12,
|
||||
"upper-frequency": 196.1e12
|
||||
},
|
||||
"roadm-pmd": 0,
|
||||
"roadm-cd": 0,
|
||||
"roadm-pdl": 0,
|
||||
"roadm-inband-crosstalk": 0,
|
||||
"roadm-maxloss": 11.5,
|
||||
"roadm-minloss": 7.5,
|
||||
"roadm-typloss": 10,
|
||||
"roadm-pmin": -13.5,
|
||||
"roadm-pmax": -9.5,
|
||||
"roadm-ptyp": -12,
|
||||
"roadm-osnr": 41,
|
||||
"roadm-noise-figure": 15
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"SI": [
|
||||
{
|
||||
"f_min": 191.3e12,
|
||||
"baud_rate": 32e9,
|
||||
"f_max": 195.1e12,
|
||||
"spacing": 50e9,
|
||||
"power_dbm": 0,
|
||||
"power_range_db": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"tx_power_dbm": 0,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"sys_margins": 2
|
||||
}
|
||||
],
|
||||
"Transceiver": [
|
||||
{
|
||||
"type_variety": "vendorA_trx-type1",
|
||||
"frequency": {
|
||||
"min": 191.35e12,
|
||||
"max": 196.1e12
|
||||
},
|
||||
"mode": [
|
||||
{
|
||||
"format": "mode 1",
|
||||
"baud_rate": 32e9,
|
||||
"OSNR": 11,
|
||||
"bit_rate": 100e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"min_spacing": 37.5e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "mode 2",
|
||||
"baud_rate": 66e9,
|
||||
"OSNR": 15,
|
||||
"bit_rate": 200e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"min_spacing": 75e9,
|
||||
"cost": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type_variety": "Voyager",
|
||||
"frequency": {
|
||||
"min": 191.35e12,
|
||||
"max": 196.1e12
|
||||
},
|
||||
"mode": [
|
||||
{
|
||||
"format": "mode 1",
|
||||
"baud_rate": 32e9,
|
||||
"OSNR": 12,
|
||||
"bit_rate": 100e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"min_spacing": 37.5e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "mode 3",
|
||||
"baud_rate": 44e9,
|
||||
"OSNR": 18,
|
||||
"bit_rate": 300e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"min_spacing": 62.5e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "mode 2",
|
||||
"baud_rate": 66e9,
|
||||
"OSNR": 21,
|
||||
"bit_rate": 400e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"min_spacing": 75e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "mode 4",
|
||||
"baud_rate": 66e9,
|
||||
"OSNR": 16,
|
||||
"bit_rate": 200e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"min_spacing": 75e9,
|
||||
"cost": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
371
gnpy/example-data/eqpt_config_openroadm_ver4.json
Normal file
371
gnpy/example-data/eqpt_config_openroadm_ver4.json
Normal file
@@ -0,0 +1,371 @@
|
||||
{
|
||||
"Edfa": [
|
||||
{
|
||||
"type_variety": "openroadm_ila_low_noise",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"nf_coef": [
|
||||
-8.104e-4,
|
||||
-6.221e-2,
|
||||
-5.889e-1,
|
||||
37.62
|
||||
],
|
||||
"pmd": 3e-12,
|
||||
"pdl": 0.7,
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_ila_standard",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"nf_coef": [
|
||||
-5.952e-4,
|
||||
-6.250e-2,
|
||||
-1.071,
|
||||
28.99
|
||||
],
|
||||
"pmd": 3e-12,
|
||||
"pdl": 0.7,
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_mw_mw_preamp",
|
||||
"type_def": "openroadm_preamp",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"pmd": 0,
|
||||
"pdl": 0,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_mw_mw_booster",
|
||||
"type_def": "openroadm_booster",
|
||||
"gain_flatmax": 32,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"pmd": 0,
|
||||
"pdl": 0,
|
||||
"allowed_for_design": false
|
||||
}
|
||||
],
|
||||
"Fiber": [
|
||||
{
|
||||
"type_variety": "SSMF",
|
||||
"dispersion": 1.67e-05,
|
||||
"effective_area": 83e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
},
|
||||
{
|
||||
"type_variety": "NZDF",
|
||||
"dispersion": 0.5e-05,
|
||||
"effective_area": 72e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
},
|
||||
{
|
||||
"type_variety": "LOF",
|
||||
"dispersion": 2.2e-05,
|
||||
"effective_area": 125e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
}
|
||||
],
|
||||
"RamanFiber": [
|
||||
{
|
||||
"type_variety": "SSMF",
|
||||
"dispersion": 1.67e-05,
|
||||
"effective_area": 83e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
}
|
||||
],
|
||||
"Span": [
|
||||
{
|
||||
"power_mode": true,
|
||||
"delta_power_range_db": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"max_fiber_lineic_loss_for_raman": 0.25,
|
||||
"target_extended_gain": 0,
|
||||
"max_length": 135,
|
||||
"length_units": "km",
|
||||
"max_loss": 28,
|
||||
"padding": 11,
|
||||
"EOL": 0,
|
||||
"con_in": 0,
|
||||
"con_out": 0
|
||||
}
|
||||
],
|
||||
"Roadm": [
|
||||
{
|
||||
"target_pch_out_db": -20,
|
||||
"add_drop_osnr": 30,
|
||||
"pmd": 3e-12,
|
||||
"pdl": 1.5,
|
||||
"restrictions": {
|
||||
"preamp_variety_list": [
|
||||
"openroadm_mw_mw_preamp"
|
||||
],
|
||||
"booster_variety_list": [
|
||||
"openroadm_mw_mw_booster"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"SI": [
|
||||
{
|
||||
"f_min": 191.3e12,
|
||||
"baud_rate": 31.57e9,
|
||||
"f_max": 196.1e12,
|
||||
"spacing": 50e9,
|
||||
"power_dbm": 2,
|
||||
"power_range_db": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 35,
|
||||
"sys_margins": 2
|
||||
}
|
||||
],
|
||||
"Transceiver": [
|
||||
{
|
||||
"type_variety": "OpenROADM MSA ver. 4.0",
|
||||
"frequency": {
|
||||
"min": 191.35e12,
|
||||
"max": 196.1e12
|
||||
},
|
||||
"mode": [
|
||||
{
|
||||
"format": "100 Gbit/s, 27.95 Gbaud, DP-QPSK",
|
||||
"baud_rate": 27.95e9,
|
||||
"OSNR": 17,
|
||||
"bit_rate": 100e9,
|
||||
"roll_off": null,
|
||||
"tx_osnr": 33,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 18e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 30,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
},
|
||||
{
|
||||
"pdl": 6,
|
||||
"penalty_value": 4
|
||||
}
|
||||
],
|
||||
"min_spacing": 50e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "100 Gbit/s, 31.57 Gbaud, DP-QPSK",
|
||||
"baud_rate": 31.57e9,
|
||||
"OSNR": 12,
|
||||
"bit_rate": 100e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 35,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": -1e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 40e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 30,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
},
|
||||
{
|
||||
"pdl": 6,
|
||||
"penalty_value": 4
|
||||
}
|
||||
],
|
||||
"min_spacing": 50e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "200 Gbit/s, DP-QPSK",
|
||||
"baud_rate": 63.1e9,
|
||||
"OSNR": 17,
|
||||
"bit_rate": 200e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 36,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": -1e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 24e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 25,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
}
|
||||
],
|
||||
"min_spacing": 87.5e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "300 Gbit/s, DP-8QAM",
|
||||
"baud_rate": 63.1e9,
|
||||
"OSNR": 21,
|
||||
"bit_rate": 300e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 36,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": -1e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 18e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 25,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
}
|
||||
],
|
||||
"min_spacing": 87.5e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "400 Gbit/s, DP-16QAM",
|
||||
"baud_rate": 63.1e9,
|
||||
"OSNR": 24,
|
||||
"bit_rate": 400e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 36,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": -1e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 12e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 20,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
}
|
||||
],
|
||||
"min_spacing": 87.5e9,
|
||||
"cost": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
441
gnpy/example-data/eqpt_config_openroadm_ver5.json
Normal file
441
gnpy/example-data/eqpt_config_openroadm_ver5.json
Normal file
@@ -0,0 +1,441 @@
|
||||
{
|
||||
"Edfa": [
|
||||
{
|
||||
"type_variety": "openroadm_ila_low_noise",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"nf_coef": [
|
||||
-8.104e-4,
|
||||
-6.221e-2,
|
||||
-5.889e-1,
|
||||
37.62
|
||||
],
|
||||
"pmd": 3e-12,
|
||||
"pdl": 0.7,
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_ila_standard",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"nf_coef": [
|
||||
-5.952e-4,
|
||||
-6.250e-2,
|
||||
-1.071,
|
||||
28.99
|
||||
],
|
||||
"pmd": 3e-12,
|
||||
"pdl": 0.7,
|
||||
"allowed_for_design": true
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_mw_mw_preamp_typical_ver5",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"nf_coef": [
|
||||
-5.952e-4,
|
||||
-6.250e-2,
|
||||
-1.071,
|
||||
28.99
|
||||
],
|
||||
"pmd": 0,
|
||||
"pdl": 0,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_mw_mw_preamp_worstcase_ver5",
|
||||
"type_def": "openroadm",
|
||||
"gain_flatmax": 27,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"nf_coef": [
|
||||
-5.952e-4,
|
||||
-6.250e-2,
|
||||
-1.071,
|
||||
27.99
|
||||
],
|
||||
"pmd": 0,
|
||||
"pdl": 0,
|
||||
"allowed_for_design": false
|
||||
},
|
||||
{
|
||||
"type_variety": "openroadm_mw_mw_booster",
|
||||
"type_def": "openroadm_booster",
|
||||
"gain_flatmax": 32,
|
||||
"gain_min": 0,
|
||||
"p_max": 22,
|
||||
"pmd": 0,
|
||||
"pdl": 0,
|
||||
"allowed_for_design": false
|
||||
}
|
||||
],
|
||||
"Fiber": [
|
||||
{
|
||||
"type_variety": "SSMF",
|
||||
"dispersion": 1.67e-05,
|
||||
"effective_area": 83e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
},
|
||||
{
|
||||
"type_variety": "NZDF",
|
||||
"dispersion": 0.5e-05,
|
||||
"effective_area": 72e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
},
|
||||
{
|
||||
"type_variety": "LOF",
|
||||
"dispersion": 2.2e-05,
|
||||
"effective_area": 125e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
}
|
||||
],
|
||||
"RamanFiber": [
|
||||
{
|
||||
"type_variety": "SSMF",
|
||||
"dispersion": 1.67e-05,
|
||||
"effective_area": 83e-12,
|
||||
"pmd_coef": 1.265e-15
|
||||
}
|
||||
],
|
||||
"Span": [
|
||||
{
|
||||
"power_mode": true,
|
||||
"delta_power_range_db": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"max_fiber_lineic_loss_for_raman": 0.25,
|
||||
"target_extended_gain": 0,
|
||||
"max_length": 135,
|
||||
"length_units": "km",
|
||||
"max_loss": 28,
|
||||
"padding": 11,
|
||||
"EOL": 0,
|
||||
"con_in": 0,
|
||||
"con_out": 0
|
||||
}
|
||||
],
|
||||
"Roadm": [
|
||||
{
|
||||
"target_pch_out_db": -20,
|
||||
"add_drop_osnr": 33,
|
||||
"pmd": 3e-12,
|
||||
"pdl": 1.5,
|
||||
"restrictions": {
|
||||
"preamp_variety_list": [
|
||||
"openroadm_mw_mw_preamp_worstcase_ver5"
|
||||
],
|
||||
"booster_variety_list": [
|
||||
"openroadm_mw_mw_booster"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"SI": [
|
||||
{
|
||||
"f_min": 191.3e12,
|
||||
"baud_rate": 31.57e9,
|
||||
"f_max": 196.1e12,
|
||||
"spacing": 50e9,
|
||||
"power_dbm": 2,
|
||||
"power_range_db": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 35,
|
||||
"sys_margins": 2
|
||||
}
|
||||
],
|
||||
"Transceiver": [
|
||||
{
|
||||
"type_variety": "OpenROADM MSA ver. 5.0",
|
||||
"frequency": {
|
||||
"min": 191.35e12,
|
||||
"max": 196.1e12
|
||||
},
|
||||
"mode": [
|
||||
{
|
||||
"format": "100 Gbit/s, 27.95 Gbaud, DP-QPSK",
|
||||
"baud_rate": 27.95e9,
|
||||
"OSNR": 17,
|
||||
"bit_rate": 100e9,
|
||||
"roll_off": null,
|
||||
"tx_osnr": 33,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 18e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 30,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
},
|
||||
{
|
||||
"pdl": 6,
|
||||
"penalty_value": 4
|
||||
}
|
||||
],
|
||||
"min_spacing": 50e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "100 Gbit/s, 31.57 Gbaud, DP-QPSK",
|
||||
"baud_rate": 31.57e9,
|
||||
"OSNR": 12,
|
||||
"bit_rate": 100e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 36,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": -1e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 48e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 30,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
},
|
||||
{
|
||||
"pdl": 6,
|
||||
"penalty_value": 4
|
||||
}
|
||||
],
|
||||
"min_spacing": 50e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "200 Gbit/s, 31.57 Gbaud, DP-16QAM",
|
||||
"baud_rate": 31.57e9,
|
||||
"OSNR": 20.5,
|
||||
"bit_rate": 100e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 36,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": -1e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 24e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 30,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
},
|
||||
{
|
||||
"pdl": 6,
|
||||
"penalty_value": 4
|
||||
}
|
||||
],
|
||||
"min_spacing": 50e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "200 Gbit/s, DP-QPSK",
|
||||
"baud_rate": 63.1e9,
|
||||
"OSNR": 17,
|
||||
"bit_rate": 200e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 36,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": -1e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 24e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 25,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
}
|
||||
],
|
||||
"min_spacing": 87.5e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "300 Gbit/s, DP-8QAM",
|
||||
"baud_rate": 63.1e9,
|
||||
"OSNR": 21,
|
||||
"bit_rate": 300e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 36,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": -1e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 18e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 25,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
}
|
||||
],
|
||||
"min_spacing": 87.5e9,
|
||||
"cost": 1
|
||||
},
|
||||
{
|
||||
"format": "400 Gbit/s, DP-16QAM",
|
||||
"baud_rate": 63.1e9,
|
||||
"OSNR": 24,
|
||||
"bit_rate": 400e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 36,
|
||||
"penalties": [
|
||||
{
|
||||
"chromatic_dispersion": -1e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 4e3,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"chromatic_dispersion": 12e3,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pmd": 10,
|
||||
"penalty_value": 0
|
||||
},
|
||||
{
|
||||
"pmd": 20,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 1,
|
||||
"penalty_value": 0.5
|
||||
},
|
||||
{
|
||||
"pdl": 2,
|
||||
"penalty_value": 1
|
||||
},
|
||||
{
|
||||
"pdl": 4,
|
||||
"penalty_value": 2.5
|
||||
}
|
||||
],
|
||||
"min_spacing": 87.5e9,
|
||||
"cost": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
196
gnpy/example-data/fused_roadm_example_network.json
Normal file
196
gnpy/example-data/fused_roadm_example_network.json
Normal file
@@ -0,0 +1,196 @@
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"uid": "trx Site_A",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"city": "Site_A",
|
||||
"region": "",
|
||||
"latitude": 0,
|
||||
"longitude": 0
|
||||
}
|
||||
},
|
||||
"type": "Transceiver"
|
||||
},
|
||||
{
|
||||
"uid": "trx Site_C",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"city": "Site_C",
|
||||
"region": "",
|
||||
"latitude": 0,
|
||||
"longitude": 0
|
||||
}
|
||||
},
|
||||
"type": "Transceiver"
|
||||
},
|
||||
{
|
||||
"uid": "roadm Site_A",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"city": "Site_A",
|
||||
"region": "",
|
||||
"latitude": 0,
|
||||
"longitude": 0
|
||||
}
|
||||
},
|
||||
"type": "Roadm",
|
||||
"params": {
|
||||
"loss": 17
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "roadm Site_C",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"city": "Site_C",
|
||||
"region": "",
|
||||
"latitude": 0,
|
||||
"longitude": 0
|
||||
}
|
||||
},
|
||||
"type": "Roadm"
|
||||
},
|
||||
{
|
||||
"uid": "ingress fused spans in Site_B",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"city": "Site_B",
|
||||
"region": "",
|
||||
"latitude": 0,
|
||||
"longitude": 0
|
||||
}
|
||||
},
|
||||
"type": "Fused",
|
||||
"params": {
|
||||
"loss": 0.5
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "egress fused spans in Site_B",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"city": "Site_B",
|
||||
"region": "",
|
||||
"latitude": 0,
|
||||
"longitude": 0
|
||||
}
|
||||
},
|
||||
"type": "Fused"
|
||||
},
|
||||
{
|
||||
"uid": "fiber (Site_A \u2192 Site_B)-",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"latitude": 0.0,
|
||||
"longitude": 0.0
|
||||
}
|
||||
},
|
||||
"type": "Fiber",
|
||||
"type_variety": "SSMF",
|
||||
"params": {
|
||||
"length": 40.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "fiber (Site_B \u2192 Site_C)-",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"latitude": 0.0,
|
||||
"longitude": 0.0
|
||||
}
|
||||
},
|
||||
"type": "Fiber",
|
||||
"type_variety": "SSMF",
|
||||
"params": {
|
||||
"length": 50.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "fiber (Site_B \u2192 Site_A)-",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"latitude": 0.0,
|
||||
"longitude": 0.0
|
||||
}
|
||||
},
|
||||
"type": "Fiber",
|
||||
"type_variety": "SSMF",
|
||||
"params": {
|
||||
"length": 40.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "fiber (Site_C \u2192 Site_B)-",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"latitude": 0.0,
|
||||
"longitude": 0.0
|
||||
}
|
||||
},
|
||||
"type": "Fiber",
|
||||
"type_variety": "SSMF",
|
||||
"params": {
|
||||
"length": 50.0,
|
||||
"length_units": "km",
|
||||
"loss_coef": 0.2
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"from_node": "roadm Site_A",
|
||||
"to_node": "fiber (Site_A \u2192 Site_B)-"
|
||||
},
|
||||
{
|
||||
"from_node": "fiber (Site_B \u2192 Site_A)-",
|
||||
"to_node": "roadm Site_A"
|
||||
},
|
||||
{
|
||||
"from_node": "fiber (Site_A \u2192 Site_B)-",
|
||||
"to_node": "ingress fused spans in Site_B"
|
||||
},
|
||||
{
|
||||
"from_node": "ingress fused spans in Site_B",
|
||||
"to_node": "fiber (Site_B \u2192 Site_C)-"
|
||||
},
|
||||
{
|
||||
"from_node": "fiber (Site_C \u2192 Site_B)-",
|
||||
"to_node": "egress fused spans in Site_B"
|
||||
},
|
||||
{
|
||||
"from_node": "egress fused spans in Site_B",
|
||||
"to_node": "fiber (Site_B \u2192 Site_A)-"
|
||||
},
|
||||
{
|
||||
"from_node": "roadm Site_C",
|
||||
"to_node": "fiber (Site_C \u2192 Site_B)-"
|
||||
},
|
||||
{
|
||||
"from_node": "fiber (Site_B \u2192 Site_C)-",
|
||||
"to_node": "roadm Site_C"
|
||||
},
|
||||
{
|
||||
"from_node": "trx Site_A",
|
||||
"to_node": "roadm Site_A"
|
||||
},
|
||||
{
|
||||
"from_node": "roadm Site_A",
|
||||
"to_node": "trx Site_A"
|
||||
},
|
||||
{
|
||||
"from_node": "trx Site_C",
|
||||
"to_node": "roadm Site_C"
|
||||
},
|
||||
{
|
||||
"from_node": "roadm Site_C",
|
||||
"to_node": "trx Site_C"
|
||||
}
|
||||
]
|
||||
}
|
||||
12
gnpy/example-data/initial_spectrum1.json
Normal file
12
gnpy/example-data/initial_spectrum1.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"spectrum": [
|
||||
{
|
||||
"f_min": 191.35e12,
|
||||
"f_max": 195.1e12,
|
||||
"baud_rate": 32e9,
|
||||
"slot_width": 50e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40
|
||||
}
|
||||
]
|
||||
}
|
||||
23
gnpy/example-data/initial_spectrum2.json
Normal file
23
gnpy/example-data/initial_spectrum2.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"spectrum": [
|
||||
{
|
||||
"f_min": 191.4e12,
|
||||
"f_max": 193.1e12,
|
||||
"baud_rate": 32e9,
|
||||
"slot_width": 50e9,
|
||||
"delta_pdb": 0,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"label": "mode_1"
|
||||
},
|
||||
{
|
||||
"f_min": 193.1625e12,
|
||||
"f_max": 195e12,
|
||||
"baud_rate": 64e9,
|
||||
"slot_width": 75e9,
|
||||
"roll_off": 0.15,
|
||||
"tx_osnr": 40,
|
||||
"label": "mode_2"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
gnpy/example-data/juniperTopologyExampleV2J.xls
Normal file
BIN
gnpy/example-data/juniperTopologyExampleV2J.xls
Normal file
Binary file not shown.
1328
gnpy/example-data/meshTopologyExampleV2.json
Normal file
1328
gnpy/example-data/meshTopologyExampleV2.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
gnpy/example-data/meshTopologyExampleV2.xls
Normal file
BIN
gnpy/example-data/meshTopologyExampleV2.xls
Normal file
Binary file not shown.
268
gnpy/example-data/meshTopologyExampleV2_services.json
Normal file
268
gnpy/example-data/meshTopologyExampleV2_services.json
Normal file
@@ -0,0 +1,268 @@
|
||||
{
|
||||
"path-request": [
|
||||
{
|
||||
"request-id": "0",
|
||||
"source": "trx Lorient_KMA",
|
||||
"destination": "trx Vannes_KBE",
|
||||
"src-tp-id": "trx Lorient_KMA",
|
||||
"dst-tp-id": "trx Vannes_KBE",
|
||||
"bidirectional": false,
|
||||
"path-constraints": {
|
||||
"te-bandwidth": {
|
||||
"technology": "flexi-grid",
|
||||
"trx_type": "Voyager",
|
||||
"trx_mode": null,
|
||||
"effective-freq-slot": [
|
||||
{
|
||||
"N": null,
|
||||
"M": null
|
||||
}
|
||||
],
|
||||
"spacing": 50000000000.0,
|
||||
"max-nb-of-channel": 80,
|
||||
"output-power": 0.0012589254117941673,
|
||||
"path_bandwidth": 100000000000.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"request-id": "1",
|
||||
"source": "trx Brest_KLA",
|
||||
"destination": "trx Vannes_KBE",
|
||||
"src-tp-id": "trx Brest_KLA",
|
||||
"dst-tp-id": "trx Vannes_KBE",
|
||||
"bidirectional": false,
|
||||
"path-constraints": {
|
||||
"te-bandwidth": {
|
||||
"technology": "flexi-grid",
|
||||
"trx_type": "Voyager",
|
||||
"trx_mode": "mode 1",
|
||||
"effective-freq-slot": [
|
||||
{
|
||||
"N": null,
|
||||
"M": null
|
||||
}
|
||||
],
|
||||
"spacing": 50000000000.0,
|
||||
"max-nb-of-channel": null,
|
||||
"output-power": 0.0012589254117941673,
|
||||
"path_bandwidth": 200000000000.0
|
||||
}
|
||||
},
|
||||
"explicit-route-objects": {
|
||||
"route-object-include-exclude": [
|
||||
{
|
||||
"explicit-route-usage": "route-include-ero",
|
||||
"index": 0,
|
||||
"num-unnum-hop": {
|
||||
"node-id": "roadm Brest_KLA",
|
||||
"link-tp-id": "link-tp-id is not used",
|
||||
"hop-type": "LOOSE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"explicit-route-usage": "route-include-ero",
|
||||
"index": 1,
|
||||
"num-unnum-hop": {
|
||||
"node-id": "roadm Lannion_CAS",
|
||||
"link-tp-id": "link-tp-id is not used",
|
||||
"hop-type": "LOOSE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"explicit-route-usage": "route-include-ero",
|
||||
"index": 2,
|
||||
"num-unnum-hop": {
|
||||
"node-id": "roadm Lorient_KMA",
|
||||
"link-tp-id": "link-tp-id is not used",
|
||||
"hop-type": "LOOSE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"explicit-route-usage": "route-include-ero",
|
||||
"index": 3,
|
||||
"num-unnum-hop": {
|
||||
"node-id": "roadm Vannes_KBE",
|
||||
"link-tp-id": "link-tp-id is not used",
|
||||
"hop-type": "LOOSE"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"request-id": "3",
|
||||
"source": "trx Lannion_CAS",
|
||||
"destination": "trx Rennes_STA",
|
||||
"src-tp-id": "trx Lannion_CAS",
|
||||
"dst-tp-id": "trx Rennes_STA",
|
||||
"bidirectional": false,
|
||||
"path-constraints": {
|
||||
"te-bandwidth": {
|
||||
"technology": "flexi-grid",
|
||||
"trx_type": "vendorA_trx-type1",
|
||||
"trx_mode": "mode 1",
|
||||
"effective-freq-slot": [
|
||||
{
|
||||
"N": null,
|
||||
"M": null
|
||||
}
|
||||
],
|
||||
"spacing": 50000000000.0,
|
||||
"max-nb-of-channel": null,
|
||||
"output-power": null,
|
||||
"path_bandwidth": 60000000000.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"request-id": "4",
|
||||
"source": "trx Rennes_STA",
|
||||
"destination": "trx Lannion_CAS",
|
||||
"src-tp-id": "trx Rennes_STA",
|
||||
"dst-tp-id": "trx Lannion_CAS",
|
||||
"bidirectional": false,
|
||||
"path-constraints": {
|
||||
"te-bandwidth": {
|
||||
"technology": "flexi-grid",
|
||||
"trx_type": "vendorA_trx-type1",
|
||||
"trx_mode": null,
|
||||
"effective-freq-slot": [
|
||||
{
|
||||
"N": null,
|
||||
"M": null
|
||||
}
|
||||
],
|
||||
"spacing": 75000000000.0,
|
||||
"max-nb-of-channel": null,
|
||||
"output-power": 0.0019952623149688794,
|
||||
"path_bandwidth": 150000000000.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"request-id": "5",
|
||||
"source": "trx Rennes_STA",
|
||||
"destination": "trx Lannion_CAS",
|
||||
"src-tp-id": "trx Rennes_STA",
|
||||
"dst-tp-id": "trx Lannion_CAS",
|
||||
"bidirectional": false,
|
||||
"path-constraints": {
|
||||
"te-bandwidth": {
|
||||
"technology": "flexi-grid",
|
||||
"trx_type": "vendorA_trx-type1",
|
||||
"trx_mode": "mode 2",
|
||||
"effective-freq-slot": [
|
||||
{
|
||||
"N": null,
|
||||
"M": null
|
||||
}
|
||||
],
|
||||
"spacing": 75000000000.0,
|
||||
"max-nb-of-channel": 63,
|
||||
"output-power": 0.0019952623149688794,
|
||||
"path_bandwidth": 20000000000.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"request-id": "6",
|
||||
"source": "trx Lannion_CAS",
|
||||
"destination": "trx Lorient_KMA",
|
||||
"src-tp-id": "trx Lannion_CAS",
|
||||
"dst-tp-id": "trx Lorient_KMA",
|
||||
"bidirectional": false,
|
||||
"path-constraints": {
|
||||
"te-bandwidth": {
|
||||
"technology": "flexi-grid",
|
||||
"trx_type": "Voyager",
|
||||
"trx_mode": "mode 1",
|
||||
"effective-freq-slot": [
|
||||
{
|
||||
"N": null,
|
||||
"M": null
|
||||
}
|
||||
],
|
||||
"spacing": 50000000000.0,
|
||||
"max-nb-of-channel": 76,
|
||||
"output-power": 0.001,
|
||||
"path_bandwidth": 300000000000.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"request-id": "7",
|
||||
"source": "trx Lannion_CAS",
|
||||
"destination": "trx Lorient_KMA",
|
||||
"src-tp-id": "trx Lannion_CAS",
|
||||
"dst-tp-id": "trx Lorient_KMA",
|
||||
"bidirectional": false,
|
||||
"path-constraints": {
|
||||
"te-bandwidth": {
|
||||
"technology": "flexi-grid",
|
||||
"trx_type": "Voyager",
|
||||
"trx_mode": "mode 1",
|
||||
"effective-freq-slot": [
|
||||
{
|
||||
"N": null,
|
||||
"M": null
|
||||
}
|
||||
],
|
||||
"spacing": 50000000000.0,
|
||||
"max-nb-of-channel": 76,
|
||||
"output-power": 0.001,
|
||||
"path_bandwidth": 400000000000.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"request-id": "7b",
|
||||
"source": "trx Lannion_CAS",
|
||||
"destination": "trx Lorient_KMA",
|
||||
"src-tp-id": "trx Lannion_CAS",
|
||||
"dst-tp-id": "trx Lorient_KMA",
|
||||
"bidirectional": false,
|
||||
"path-constraints": {
|
||||
"te-bandwidth": {
|
||||
"technology": "flexi-grid",
|
||||
"trx_type": "Voyager",
|
||||
"trx_mode": "mode 1",
|
||||
"effective-freq-slot": [
|
||||
{
|
||||
"N": null,
|
||||
"M": null
|
||||
}
|
||||
],
|
||||
"spacing": 75000000000.0,
|
||||
"max-nb-of-channel": 50,
|
||||
"output-power": 0.001,
|
||||
"path_bandwidth": 400000000000.0
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"synchronization": [
|
||||
{
|
||||
"synchronization-id": "3",
|
||||
"svec": {
|
||||
"relaxable": "false",
|
||||
"disjointness": "node link",
|
||||
"request-id-number": [
|
||||
"3",
|
||||
"1"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"synchronization-id": "4",
|
||||
"svec": {
|
||||
"relaxable": "false",
|
||||
"disjointness": "node link",
|
||||
"request-id-number": [
|
||||
"4",
|
||||
"5"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
117
gnpy/example-data/raman_edfa_example_network.json
Normal file
117
gnpy/example-data/raman_edfa_example_network.json
Normal file
@@ -0,0 +1,117 @@
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"uid": "Site_A",
|
||||
"type": "Transceiver",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"latitude": 0,
|
||||
"longitude": 0,
|
||||
"city": "Site A",
|
||||
"region": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "Span1",
|
||||
"type": "RamanFiber",
|
||||
"type_variety": "SSMF",
|
||||
"operational": {
|
||||
"temperature": 283,
|
||||
"raman_pumps": [
|
||||
{
|
||||
"power": 224.403e-3,
|
||||
"frequency": 205e12,
|
||||
"propagation_direction": "counterprop"
|
||||
},
|
||||
{
|
||||
"power": 231.135e-3,
|
||||
"frequency": 201e12,
|
||||
"propagation_direction": "counterprop"
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"type_variety": "SSMF",
|
||||
"length": 80.0,
|
||||
"loss_coef": 0.2,
|
||||
"length_units": "km",
|
||||
"att_in": 0,
|
||||
"con_in": 0.5,
|
||||
"con_out": 0.5
|
||||
},
|
||||
"metadata": {
|
||||
"location": {
|
||||
"latitude": 1,
|
||||
"longitude": 0,
|
||||
"city": null,
|
||||
"region": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "Fused1",
|
||||
"type": "Fused",
|
||||
"params": {
|
||||
"loss": 0
|
||||
},
|
||||
"metadata": {
|
||||
"location": {
|
||||
"latitude": 1.5,
|
||||
"longitude": 0,
|
||||
"city": null,
|
||||
"region": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "Edfa1",
|
||||
"type": "Edfa",
|
||||
"type_variety": "std_low_gain",
|
||||
"operational": {
|
||||
"gain_target": 15.0,
|
||||
"delta_p": -2,
|
||||
"tilt_target": 0,
|
||||
"out_voa": 0
|
||||
},
|
||||
"metadata": {
|
||||
"location": {
|
||||
"latitude": 2,
|
||||
"longitude": 0,
|
||||
"city": null,
|
||||
"region": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"uid": "Site_B",
|
||||
"type": "Transceiver",
|
||||
"metadata": {
|
||||
"location": {
|
||||
"latitude": 2,
|
||||
"longitude": 0,
|
||||
"city": "Site B",
|
||||
"region": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"from_node": "Site_A",
|
||||
"to_node": "Span1"
|
||||
},
|
||||
{
|
||||
"from_node": "Span1",
|
||||
"to_node": "Fused1"
|
||||
},
|
||||
{
|
||||
"from_node": "Fused1",
|
||||
"to_node": "Edfa1"
|
||||
},
|
||||
{
|
||||
"from_node": "Edfa1",
|
||||
"to_node": "Site_B"
|
||||
}
|
||||
]
|
||||
}
|
||||
19
gnpy/example-data/sim_params.json
Normal file
19
gnpy/example-data/sim_params.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"raman_params": {
|
||||
"flag": true,
|
||||
"result_spatial_resolution": 10e3,
|
||||
"solver_spatial_resolution": 50
|
||||
},
|
||||
"nli_params": {
|
||||
"method": "ggn_spectrally_separated",
|
||||
"dispersion_tolerance": 1,
|
||||
"phase_shift_tolerance": 0.1,
|
||||
"computed_channels": [
|
||||
1,
|
||||
18,
|
||||
37,
|
||||
56,
|
||||
75
|
||||
]
|
||||
}
|
||||
}
|
||||
304
gnpy/example-data/std_medium_gain_advanced_config.json
Normal file
304
gnpy/example-data/std_medium_gain_advanced_config.json
Normal file
@@ -0,0 +1,304 @@
|
||||
{
|
||||
"nf_fit_coeff": [
|
||||
0.000168241,
|
||||
0.0469961,
|
||||
0.0359549,
|
||||
5.82851
|
||||
],
|
||||
"f_min": 191.35e12,
|
||||
"f_max": 196.1e12,
|
||||
"nf_ripple": [
|
||||
0.4372876328262819,
|
||||
0.4372876328262819,
|
||||
0.41270842850729195,
|
||||
0.38814205928193013,
|
||||
0.36358851509924695,
|
||||
0.3390191214858807,
|
||||
0.30474360397422756,
|
||||
0.27048596623174515,
|
||||
0.23624619427167134,
|
||||
0.202035284929368,
|
||||
0.1694483010211072,
|
||||
0.13687829834471027,
|
||||
0.1043252636301016,
|
||||
0.07184040799914815,
|
||||
0.061288823415841555,
|
||||
0.050742731588695494,
|
||||
0.04020212822983975,
|
||||
0.029667009055877668,
|
||||
0.01913736978785662,
|
||||
0.00861320615127981,
|
||||
-0.010157321677553965,
|
||||
-0.028982516728038848,
|
||||
-0.04779792991567815,
|
||||
-0.06660356886269536,
|
||||
-0.06256260169582961,
|
||||
-0.05832916277634124,
|
||||
-0.05409792133358102,
|
||||
-0.04990610405914272,
|
||||
-0.05078533294804249,
|
||||
-0.05166410580536087,
|
||||
-0.05254242298580185,
|
||||
-0.05342028484370278,
|
||||
-0.051742390657545205,
|
||||
-0.050039429413028365,
|
||||
-0.048337350303318156,
|
||||
-0.04663615264317309,
|
||||
-0.04493583574805963,
|
||||
-0.043236398934156144,
|
||||
-0.035622012697103154,
|
||||
-0.027999803010447587,
|
||||
-0.02038153550619876,
|
||||
-0.012779471908040341,
|
||||
-0.006436207679519103,
|
||||
-9.622162373026585e-05,
|
||||
0.006240488799898697,
|
||||
0.012573926129294415,
|
||||
0.021418708618354456,
|
||||
0.030289222542492025,
|
||||
0.03915515813685565,
|
||||
0.047899419704645264,
|
||||
0.04256372893215024,
|
||||
0.03723078993416436,
|
||||
0.03190060058247842,
|
||||
0.02657315875107553,
|
||||
0.021248462316134083,
|
||||
0.01605877647020772,
|
||||
0.02326948274513522,
|
||||
0.03047647598902483,
|
||||
0.037679759069084225,
|
||||
0.044883315610536455,
|
||||
0.052470799141237305,
|
||||
0.06005437964543287,
|
||||
0.0676340601339394,
|
||||
0.07521193198077789,
|
||||
0.08415906712621996,
|
||||
0.09310160456603413,
|
||||
0.1020395478432815,
|
||||
0.11079585523492333,
|
||||
0.1018180306253394,
|
||||
0.09284481475528361,
|
||||
0.0838762040768461,
|
||||
0.07482015390297145,
|
||||
0.05670549786742816,
|
||||
0.03860013139908377,
|
||||
0.020504047353947653,
|
||||
0.0024172385953583004,
|
||||
-0.015660302006048,
|
||||
-0.03372858157230583,
|
||||
-0.07037375788020579,
|
||||
-0.10709599992470213,
|
||||
-0.14379944379052215,
|
||||
-0.18048410390821285,
|
||||
-0.20911178784023846,
|
||||
-0.23772399031437283,
|
||||
-0.26632156113294336,
|
||||
-0.2949045115165272,
|
||||
-0.30206775396360075,
|
||||
-0.30915729645781326,
|
||||
-0.31624321721895354,
|
||||
-0.3233255190215882,
|
||||
-0.32037911876162584,
|
||||
-0.3172854168606314,
|
||||
-0.31419329378173544,
|
||||
-0.31110274831665313,
|
||||
-0.3110761646066259,
|
||||
-0.3110761646066259
|
||||
],
|
||||
"dgt": [
|
||||
1.0,
|
||||
1.017807767853702,
|
||||
1.0356155337864215,
|
||||
1.0534217504465226,
|
||||
1.0712204022764056,
|
||||
1.0895983485572227,
|
||||
1.108555289615659,
|
||||
1.1280891949729075,
|
||||
1.1476135933863398,
|
||||
1.1672278304018044,
|
||||
1.1869318618366975,
|
||||
1.2067249615595257,
|
||||
1.2264996957264114,
|
||||
1.2428104897182262,
|
||||
1.2556591482982988,
|
||||
1.2650555289898042,
|
||||
1.2744470198196236,
|
||||
1.2838336236692311,
|
||||
1.2932153453410835,
|
||||
1.3040618749785347,
|
||||
1.316383926863083,
|
||||
1.3301807335621048,
|
||||
1.3439818461440451,
|
||||
1.3598972673004606,
|
||||
1.3779439775587023,
|
||||
1.3981208704326855,
|
||||
1.418273806730323,
|
||||
1.4340878115214444,
|
||||
1.445565137158368,
|
||||
1.45273959485914,
|
||||
1.4599103316162523,
|
||||
1.4670307626366115,
|
||||
1.474100442252211,
|
||||
1.48111939735681,
|
||||
1.488134243479226,
|
||||
1.495145456062699,
|
||||
1.502153039909686,
|
||||
1.5097346239790443,
|
||||
1.5178910621476225,
|
||||
1.5266220576235803,
|
||||
1.5353620432989845,
|
||||
1.545374152761467,
|
||||
1.5566577309558969,
|
||||
1.569199764184379,
|
||||
1.5817353179379183,
|
||||
1.5986915141218316,
|
||||
1.6201194134191075,
|
||||
1.6460167077689267,
|
||||
1.6719047669939942,
|
||||
1.6918150918099673,
|
||||
1.7057507692361864,
|
||||
1.7137640932265894,
|
||||
1.7217732861435076,
|
||||
1.7297783508684146,
|
||||
1.737780757913635,
|
||||
1.7459181197626403,
|
||||
1.7541903672600494,
|
||||
1.7625959636196327,
|
||||
1.7709972329654864,
|
||||
1.7793941781790852,
|
||||
1.7877868031023945,
|
||||
1.7961751115773796,
|
||||
1.8045606557581335,
|
||||
1.8139629377087627,
|
||||
1.824381436842932,
|
||||
1.835814081380705,
|
||||
1.847275503201129,
|
||||
1.862235672444246,
|
||||
1.8806927939516411,
|
||||
1.9026104247588487,
|
||||
1.9245345552113182,
|
||||
1.9482128147680253,
|
||||
1.9736443063300082,
|
||||
2.0008103857988204,
|
||||
2.0279625371819305,
|
||||
2.055100772005235,
|
||||
2.082225099873648,
|
||||
2.1183028432496016,
|
||||
2.16337565384239,
|
||||
2.2174389328192197,
|
||||
2.271520771371253,
|
||||
2.322373696229342,
|
||||
2.3699990328716107,
|
||||
2.414398437185221,
|
||||
2.4587748041127506,
|
||||
2.499446286796604,
|
||||
2.5364027376452056,
|
||||
2.5696460593920065,
|
||||
2.602860350286428,
|
||||
2.630396440815385,
|
||||
2.6521732021128046,
|
||||
2.6681935771243177,
|
||||
2.6841217449620203,
|
||||
2.6947834587664494,
|
||||
2.705443819238505,
|
||||
2.714526681131686
|
||||
],
|
||||
"gain_ripple": [
|
||||
0.07704745697916238,
|
||||
0.06479749697916048,
|
||||
0.05257029697916238,
|
||||
0.040326236979161934,
|
||||
0.028098946979159933,
|
||||
0.01393231697916164,
|
||||
-0.0021726530208390216,
|
||||
-0.01819858302084043,
|
||||
-0.03218106302083967,
|
||||
-0.042428283020839785,
|
||||
-0.05095282302083959,
|
||||
-0.05947139302083926,
|
||||
-0.06968090302083851,
|
||||
-0.07844600302084004,
|
||||
-0.08407607302083875,
|
||||
-0.0865687230208394,
|
||||
-0.08906007302083907,
|
||||
-0.0913487130208388,
|
||||
-0.09343261302083761,
|
||||
-0.09717347302083823,
|
||||
-0.1027863830208382,
|
||||
-0.11089282302084058,
|
||||
-0.11963431302083904,
|
||||
-0.1279646530208396,
|
||||
-0.13525493302083902,
|
||||
-0.1409032730208395,
|
||||
-0.14591937302083835,
|
||||
-0.14823350302084037,
|
||||
-0.1484450830208388,
|
||||
-0.1455411330208385,
|
||||
-0.14160178302083892,
|
||||
-0.1353792530208402,
|
||||
-0.12789859302083784,
|
||||
-0.11916081302083725,
|
||||
-0.11041488302083735,
|
||||
-0.10103437302083762,
|
||||
-0.09101254302083817,
|
||||
-0.07868024302083754,
|
||||
-0.06468462302083822,
|
||||
-0.051112303020840244,
|
||||
-0.039618433020837784,
|
||||
-0.028748483020837767,
|
||||
-0.016475303020840215,
|
||||
-0.006936193020838033,
|
||||
-0.0015763130208377163,
|
||||
0.0007104669791608842,
|
||||
0.0040435869791615175,
|
||||
0.006965146979162284,
|
||||
0.00842583697916055,
|
||||
0.00874012697916271,
|
||||
0.00936596697916059,
|
||||
0.01030063697916006,
|
||||
0.011234826979162449,
|
||||
0.013321846979160057,
|
||||
0.01659282697915998,
|
||||
0.023488786979161347,
|
||||
0.03285456697916089,
|
||||
0.04072968697916224,
|
||||
0.04467697697916151,
|
||||
0.04551704697916037,
|
||||
0.04717897697916129,
|
||||
0.04946107697915991,
|
||||
0.05154489697916276,
|
||||
0.05447361697916264,
|
||||
0.05848224697916038,
|
||||
0.06916723697916183,
|
||||
0.08548825697916129,
|
||||
0.10802383697916085,
|
||||
0.13114358697916018,
|
||||
0.15216302697916007,
|
||||
0.17037189697916233,
|
||||
0.1767381569791624,
|
||||
0.1739275269791598,
|
||||
0.15945681697916214,
|
||||
0.14239527697916188,
|
||||
0.12276252697916235,
|
||||
0.10313984697916112,
|
||||
0.08731066697916035,
|
||||
0.07533675697916209,
|
||||
0.07114372697916238,
|
||||
0.07094413697916124,
|
||||
0.07091459697916136,
|
||||
0.0670723869791594,
|
||||
0.054956336979159914,
|
||||
0.038328296979159404,
|
||||
0.017572956979162058,
|
||||
-0.0028138630208403015,
|
||||
-0.016792253020838643,
|
||||
-0.0246928330208398,
|
||||
-0.018326963020840026,
|
||||
-0.0036199830208403228,
|
||||
0.02602813697916062,
|
||||
0.06245819697916133,
|
||||
0.09542181697916163,
|
||||
0.11822862697916037,
|
||||
0.1359703369791596
|
||||
]
|
||||
}
|
||||
35
gnpy/example-data/write_path_jsontocsv.py
Normal file
35
gnpy/example-data/write_path_jsontocsv.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
write_path_jsontocsv.py
|
||||
========================
|
||||
|
||||
Reads JSON path result file in accordance with the Yang model for requesting
|
||||
path computation and writes results to a CSV file.
|
||||
|
||||
See: draft-ietf-teas-yang-path-computation-01.txt
|
||||
"""
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from pathlib import Path
|
||||
from json import loads
|
||||
from gnpy.tools.json_io import load_equipment
|
||||
from gnpy.topology.request import jsontocsv
|
||||
|
||||
|
||||
parser = ArgumentParser(description='Converting JSON path results into a CSV')
|
||||
parser.add_argument('filename', type=Path)
|
||||
parser.add_argument('output_filename', type=Path)
|
||||
parser.add_argument('eqpt_filename', nargs='?', type=Path, default=Path(__file__).parent / 'eqpt_config.json')
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = parser.parse_args()
|
||||
|
||||
with open(args.output_filename, 'w', encoding='utf-8') as file:
|
||||
with open(args.filename, encoding='utf-8') as f:
|
||||
print(f'Reading {args.filename}')
|
||||
json_data = loads(f.read())
|
||||
equipment = load_equipment(args.eqpt_filename)
|
||||
print(f'Writing in {args.output_filename}')
|
||||
jsontocsv(json_data, equipment, file)
|
||||
5
gnpy/tools/__init__.py
Normal file
5
gnpy/tools/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
"""
|
||||
Processing of data via :py:mod:`.json_io`.
|
||||
Utilities for Excel conversion in :py:mod:`.convert` and :py:mod:`.service_sheet`.
|
||||
Example code in :py:mod:`.cli_examples` and :py:mod:`.plots`.
|
||||
"""
|
||||
505
gnpy/tools/cli_examples.py
Normal file
505
gnpy/tools/cli_examples.py
Normal file
@@ -0,0 +1,505 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
gnpy.tools.cli_examples
|
||||
=======================
|
||||
|
||||
Common code for CLI examples
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import logging
|
||||
import sys
|
||||
from math import ceil
|
||||
from numpy import linspace, mean
|
||||
from pathlib import Path
|
||||
|
||||
import gnpy.core.ansi_escapes as ansi_escapes
|
||||
from gnpy.core.elements import Transceiver, Fiber, RamanFiber
|
||||
from gnpy.core.equipment import trx_mode_params
|
||||
import gnpy.core.exceptions as exceptions
|
||||
from gnpy.core.network import add_missing_elements_in_network, design_network
|
||||
from gnpy.core.parameters import SimParams
|
||||
from gnpy.core.utils import db2lin, lin2db, automatic_nch, watt2dbm, dbm2watt
|
||||
from gnpy.topology.request import (ResultElement, jsontocsv, compute_path_dsjctn, requests_aggregation,
|
||||
BLOCKING_NOPATH, correct_json_route_list,
|
||||
deduplicate_disjunctions, compute_path_with_disjunction,
|
||||
PathRequest, compute_constrained_path, propagate)
|
||||
from gnpy.topology.spectrum_assignment import build_oms_list, pth_assign_spectrum
|
||||
from gnpy.tools.json_io import (load_equipment, load_network, load_json, load_requests, save_network,
|
||||
requests_from_json, disjunctions_from_json, save_json, load_initial_spectrum)
|
||||
from gnpy.tools.plots import plot_baseline, plot_results
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
_examples_dir = Path(__file__).parent.parent / 'example-data'
|
||||
_help_footer = '''
|
||||
This program is part of GNPy, https://github.com/TelecomInfraProject/oopt-gnpy
|
||||
|
||||
Learn more at https://gnpy.readthedocs.io/
|
||||
|
||||
'''
|
||||
_help_fname_json = 'FILE.json'
|
||||
_help_fname_json_csv = 'FILE.(json|csv)'
|
||||
|
||||
|
||||
def show_example_data_dir():
|
||||
print(f'{_examples_dir}/')
|
||||
|
||||
|
||||
def load_common_data(equipment_filename, topology_filename, simulation_filename, save_raw_network_filename):
|
||||
"""Load common configuration from JSON files"""
|
||||
|
||||
try:
|
||||
equipment = load_equipment(equipment_filename)
|
||||
network = load_network(topology_filename, equipment)
|
||||
if save_raw_network_filename is not None:
|
||||
save_network(network, save_raw_network_filename)
|
||||
print(f'{ansi_escapes.blue}Raw network (no optimizations) saved to {save_raw_network_filename}{ansi_escapes.reset}')
|
||||
if not simulation_filename:
|
||||
sim_params = {}
|
||||
if next((node for node in network if isinstance(node, RamanFiber)), None) is not None:
|
||||
print(f'{ansi_escapes.red}Invocation error:{ansi_escapes.reset} '
|
||||
f'RamanFiber requires passing simulation params via --sim-params')
|
||||
sys.exit(1)
|
||||
else:
|
||||
sim_params = load_json(simulation_filename)
|
||||
SimParams.set_params(sim_params)
|
||||
except exceptions.EquipmentConfigError as e:
|
||||
print(f'{ansi_escapes.red}Configuration error in the equipment library:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
except exceptions.NetworkTopologyError as e:
|
||||
print(f'{ansi_escapes.red}Invalid network definition:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
except exceptions.ParametersError as e:
|
||||
print(f'{ansi_escapes.red}Simulation parameters error:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
except exceptions.ConfigurationError as e:
|
||||
print(f'{ansi_escapes.red}Configuration error:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
except exceptions.ServiceError as e:
|
||||
print(f'{ansi_escapes.red}Service error:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
|
||||
return (equipment, network)
|
||||
|
||||
|
||||
def _setup_logging(args):
|
||||
logging.basicConfig(level={2: logging.DEBUG, 1: logging.INFO, 0: logging.WARNING}.get(args.verbose, logging.DEBUG))
|
||||
|
||||
|
||||
def _add_common_options(parser: argparse.ArgumentParser, network_default: Path):
|
||||
parser.add_argument('topology', nargs='?', type=Path, metavar='NETWORK-TOPOLOGY.(json|xls|xlsx)',
|
||||
default=network_default,
|
||||
help='Input network topology')
|
||||
parser.add_argument('-v', '--verbose', action='count', default=0,
|
||||
help='Increase verbosity (can be specified several times)')
|
||||
parser.add_argument('-e', '--equipment', type=Path, metavar=_help_fname_json,
|
||||
default=_examples_dir / 'eqpt_config.json', help='Equipment library')
|
||||
parser.add_argument('--sim-params', type=Path, metavar=_help_fname_json,
|
||||
default=None, help='Path to the JSON containing simulation parameters (required for Raman). '
|
||||
f'Example: {_examples_dir / "sim_params.json"}')
|
||||
parser.add_argument('--save-network', type=Path, metavar=_help_fname_json,
|
||||
help='Save the final network as a JSON file')
|
||||
parser.add_argument('--save-network-before-autodesign', type=Path, metavar=_help_fname_json,
|
||||
help='Dump the network into a JSON file prior to autodesign')
|
||||
parser.add_argument('--no-insert-edfas', action='store_true',
|
||||
help='Disable insertion of EDFAs after ROADMs and fibers '
|
||||
'as well as splitting of fibers by auto-design.')
|
||||
|
||||
|
||||
def transmission_main_example(args=None):
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Send a full spectrum load through the network from point A to point B',
|
||||
epilog=_help_footer,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
)
|
||||
_add_common_options(parser, network_default=_examples_dir / 'edfa_example_network.json')
|
||||
parser.add_argument('--show-channels', action='store_true', help='Show final per-channel OSNR and GSNR summary')
|
||||
parser.add_argument('-pl', '--plot', action='store_true')
|
||||
parser.add_argument('-l', '--list-nodes', action='store_true', help='list all transceiver nodes')
|
||||
parser.add_argument('-po', '--power', default=0, help='channel ref power in dBm')
|
||||
parser.add_argument('--spectrum', type=Path, help='user defined mixed rate spectrum JSON file')
|
||||
parser.add_argument('source', nargs='?', help='source node')
|
||||
parser.add_argument('destination', nargs='?', help='destination node')
|
||||
|
||||
args = parser.parse_args(args if args is not None else sys.argv[1:])
|
||||
_setup_logging(args)
|
||||
|
||||
(equipment, network) = load_common_data(args.equipment, args.topology, args.sim_params, args.save_network_before_autodesign)
|
||||
|
||||
if args.plot:
|
||||
plot_baseline(network)
|
||||
|
||||
transceivers = {n.uid: n for n in network.nodes() if isinstance(n, Transceiver)}
|
||||
|
||||
if not transceivers:
|
||||
sys.exit('Network has no transceivers!')
|
||||
if len(transceivers) < 2:
|
||||
sys.exit('Network has only one transceiver!')
|
||||
|
||||
if args.list_nodes:
|
||||
for uid in transceivers:
|
||||
print(uid)
|
||||
sys.exit()
|
||||
|
||||
# First try to find exact match if source/destination provided
|
||||
if args.source:
|
||||
source = transceivers.pop(args.source, None)
|
||||
valid_source = True if source else False
|
||||
else:
|
||||
source = None
|
||||
_logger.info('No source node specified: picking random transceiver')
|
||||
|
||||
if args.destination:
|
||||
destination = transceivers.pop(args.destination, None)
|
||||
valid_destination = True if destination else False
|
||||
else:
|
||||
destination = None
|
||||
_logger.info('No destination node specified: picking random transceiver')
|
||||
|
||||
# If no exact match try to find partial match
|
||||
if args.source and not source:
|
||||
# TODO code a more advanced regex to find nodes match
|
||||
source = next((transceivers.pop(uid) for uid in transceivers
|
||||
if args.source.lower() in uid.lower()), None)
|
||||
|
||||
if args.destination and not destination:
|
||||
# TODO code a more advanced regex to find nodes match
|
||||
destination = next((transceivers.pop(uid) for uid in transceivers
|
||||
if args.destination.lower() in uid.lower()), None)
|
||||
|
||||
# If no partial match or no source/destination provided pick random
|
||||
if not source:
|
||||
source = list(transceivers.values())[0]
|
||||
del transceivers[source.uid]
|
||||
|
||||
if not destination:
|
||||
destination = list(transceivers.values())[0]
|
||||
|
||||
_logger.info(f'source = {args.source!r}')
|
||||
_logger.info(f'destination = {args.destination!r}')
|
||||
|
||||
params = {}
|
||||
params['request_id'] = 0
|
||||
params['trx_type'] = ''
|
||||
params['trx_mode'] = ''
|
||||
params['source'] = source.uid
|
||||
params['destination'] = destination.uid
|
||||
params['bidir'] = False
|
||||
params['nodes_list'] = [destination.uid]
|
||||
params['loose_list'] = ['strict']
|
||||
params['format'] = ''
|
||||
params['path_bandwidth'] = 0
|
||||
params['effective_freq_slot'] = None
|
||||
trx_params = trx_mode_params(equipment)
|
||||
trx_params['power'] = dbm2watt(equipment['SI']['default'].power_dbm)
|
||||
trx_params['tx_power'] = dbm2watt(equipment['SI']['default'].power_dbm)
|
||||
if args.power:
|
||||
trx_params['power'] = dbm2watt(float(args.power))
|
||||
trx_params['tx_power'] = dbm2watt(float(args.power))
|
||||
params.update(trx_params)
|
||||
initial_spectrum = None
|
||||
params['nb_channel'] = automatic_nch(trx_params['f_min'], trx_params['f_max'], trx_params['spacing'])
|
||||
# use ref_req to hold reference channel used for design and req for the propagation
|
||||
# and req to hold channels to be propagated
|
||||
# apply power sweep on the design and on the channels
|
||||
ref_req = PathRequest(**params)
|
||||
pref_ch_db = watt2dbm(ref_req.power)
|
||||
if args.spectrum:
|
||||
# use the spectrum defined by user for the propagation.
|
||||
# the nb of channel for design remains the one of the reference channel
|
||||
initial_spectrum = load_initial_spectrum(args.spectrum)
|
||||
params['nb_channel'] = len(initial_spectrum)
|
||||
print('User input for spectrum used for propagation instead of SI')
|
||||
req = PathRequest(**params)
|
||||
p_ch_db = watt2dbm(req.power)
|
||||
req.initial_spectrum = initial_spectrum
|
||||
print(f'There are {req.nb_channel} channels propagating')
|
||||
power_mode = equipment['Span']['default'].power_mode
|
||||
print('\n'.join([f'Power mode is set to {power_mode}',
|
||||
'=> it can be modified in eqpt_config.json - Span']))
|
||||
if not args.no_insert_edfas:
|
||||
try:
|
||||
add_missing_elements_in_network(network, equipment)
|
||||
except exceptions.NetworkTopologyError as e:
|
||||
print(f'{ansi_escapes.red}Invalid network definition:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
except exceptions.ConfigurationError as e:
|
||||
print(f'{ansi_escapes.red}Configuration error:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
|
||||
path = compute_constrained_path(network, req)
|
||||
spans = [s.params.length for s in path if isinstance(s, RamanFiber) or isinstance(s, Fiber)]
|
||||
power_range = [0]
|
||||
if power_mode:
|
||||
# power cannot be changed in gain mode
|
||||
try:
|
||||
p_start, p_stop, p_step = equipment['SI']['default'].power_range_db
|
||||
p_num = abs(int(round((p_stop - p_start) / p_step))) + 1 if p_step != 0 else 1
|
||||
power_range = list(linspace(p_start, p_stop, p_num))
|
||||
except TypeError:
|
||||
print('invalid power range definition in eqpt_config, should be power_range_db: [lower, upper, step]')
|
||||
# initial network is designed using req.power. that is that any missing information (amp gain or delta_p) is filled
|
||||
# using this req.power, previous to any sweep requested later on.
|
||||
try:
|
||||
design_network(ref_req, network, equipment, set_connector_losses=True, verbose=True)
|
||||
except exceptions.NetworkTopologyError as e:
|
||||
print(f'{ansi_escapes.red}Invalid network definition:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
except exceptions.ConfigurationError as e:
|
||||
print(f'{ansi_escapes.red}Configuration error:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
|
||||
print(f'\nThere are {len(spans)} fiber spans over {sum(spans)/1000:.0f} km between {source.uid} '
|
||||
f'and {destination.uid}')
|
||||
print(f'\nNow propagating between {source.uid} and {destination.uid}:')
|
||||
for dp_db in power_range:
|
||||
ref_req.power = dbm2watt(pref_ch_db + dp_db)
|
||||
req.power = dbm2watt(p_ch_db + dp_db)
|
||||
design_network(ref_req, network, equipment, set_connector_losses=False, verbose=False)
|
||||
# if initial spectrum did not contain any power, now we need to use this one.
|
||||
# note the initial power defines a differential wrt req.power so that if req.power is set to 2mW (3dBm)
|
||||
# and initial spectrum was set to 0, this sets a initial per channel delta power to -3dB, so that
|
||||
# whatever the equalization, -3 dB is applied on all channels (ie initial power in initial spectrum pre-empts
|
||||
# "--power" option)
|
||||
if power_mode:
|
||||
print(f'\nPropagating with input power = {ansi_escapes.cyan}{watt2dbm(req.power):.2f} '
|
||||
+ f'dBm{ansi_escapes.reset}:')
|
||||
else:
|
||||
print(f'\nPropagating in {ansi_escapes.cyan}gain mode{ansi_escapes.reset}: power cannot be set manually')
|
||||
infos = propagate(path, req, equipment)
|
||||
if len(power_range) == 1:
|
||||
for elem in path:
|
||||
print(elem)
|
||||
if power_mode:
|
||||
print(f'\nTransmission result for input power = {lin2db(req.power*1e3):.2f} dBm:')
|
||||
else:
|
||||
print(f'\nTransmission results:')
|
||||
print(f' Final GSNR (0.1 nm): {ansi_escapes.cyan}{mean(destination.snr_01nm):.02f} dB{ansi_escapes.reset}')
|
||||
else:
|
||||
print(path[-1])
|
||||
|
||||
if args.save_network is not None:
|
||||
save_network(network, args.save_network)
|
||||
print(f'{ansi_escapes.blue}Network (after autodesign) saved to {args.save_network}{ansi_escapes.reset}')
|
||||
|
||||
if args.show_channels:
|
||||
print('\nThe GSNR per channel at the end of the line is:')
|
||||
print(
|
||||
'{:>5}{:>26}{:>26}{:>28}{:>28}{:>28}' .format(
|
||||
'Ch. #',
|
||||
'Channel frequency (THz)',
|
||||
'Channel power (dBm)',
|
||||
'OSNR ASE (signal bw, dB)',
|
||||
'SNR NLI (signal bw, dB)',
|
||||
'GSNR (signal bw, dB)'))
|
||||
for final_carrier, ch_osnr, ch_snr_nl, ch_snr in zip(
|
||||
infos.carriers, path[-1].osnr_ase, path[-1].osnr_nli, path[-1].snr):
|
||||
ch_freq = final_carrier.frequency * 1e-12
|
||||
ch_power = lin2db(final_carrier.power.signal * 1e3)
|
||||
print(
|
||||
'{:5}{:26.5f}{:26.2f}{:28.2f}{:28.2f}{:28.2f}' .format(
|
||||
final_carrier.channel_number, round(
|
||||
ch_freq, 5), round(
|
||||
ch_power, 2), round(
|
||||
ch_osnr, 2), round(
|
||||
ch_snr_nl, 2), round(
|
||||
ch_snr, 2)))
|
||||
|
||||
if not args.source:
|
||||
print(f'\n(No source node specified: picked {source.uid})')
|
||||
elif not valid_source:
|
||||
print(f'\n(Invalid source node {args.source!r} replaced with {source.uid})')
|
||||
|
||||
if not args.destination:
|
||||
print(f'\n(No destination node specified: picked {destination.uid})')
|
||||
elif not valid_destination:
|
||||
print(f'\n(Invalid destination node {args.destination!r} replaced with {destination.uid})')
|
||||
|
||||
if args.plot:
|
||||
plot_results(network, path, source, destination)
|
||||
|
||||
|
||||
def _path_result_json(pathresult):
|
||||
return {'response': [n.json for n in pathresult]}
|
||||
|
||||
|
||||
def path_requests_run(args=None):
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Compute performance for a list of services provided in a json file or an excel sheet',
|
||||
epilog=_help_footer,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
)
|
||||
_add_common_options(parser, network_default=_examples_dir / 'meshTopologyExampleV2.xls')
|
||||
parser.add_argument('service_filename', nargs='?', type=Path, metavar='SERVICES-REQUESTS.(json|xls|xlsx)',
|
||||
default=_examples_dir / 'meshTopologyExampleV2.xls',
|
||||
help='Input service file')
|
||||
parser.add_argument('-bi', '--bidir', action='store_true',
|
||||
help='considers that all demands are bidir')
|
||||
parser.add_argument('-o', '--output', type=Path, metavar=_help_fname_json_csv,
|
||||
help='Store satisifed requests into a JSON or CSV file')
|
||||
|
||||
args = parser.parse_args(args if args is not None else sys.argv[1:])
|
||||
_setup_logging(args)
|
||||
|
||||
_logger.info(f'Computing path requests {args.service_filename.name} into JSON format')
|
||||
|
||||
(equipment, network) = load_common_data(args.equipment, args.topology, args.sim_params, args.save_network_before_autodesign)
|
||||
|
||||
# Build the network once using the default power defined in SI in eqpt config
|
||||
# TODO power density: db2linp(ower_dbm": 0)/power_dbm": 0 * nb channels as defined by
|
||||
# spacing, f_min and f_max
|
||||
if not args.no_insert_edfas:
|
||||
try:
|
||||
add_missing_elements_in_network(network, equipment)
|
||||
except exceptions.NetworkTopologyError as e:
|
||||
print(f'{ansi_escapes.red}Invalid network definition:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
except exceptions.ConfigurationError as e:
|
||||
print(f'{ansi_escapes.red}Configuration error:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
|
||||
params = {
|
||||
'request_id': 'reference',
|
||||
'trx_type': '',
|
||||
'trx_mode': '',
|
||||
'source': None,
|
||||
'destination': None,
|
||||
'bidir': False,
|
||||
'nodes_list': [],
|
||||
'loose_list': [],
|
||||
'format': '',
|
||||
'path_bandwidth': 0,
|
||||
'effective_freq_slot': None,
|
||||
'nb_channel': automatic_nch(equipment['SI']['default'].f_min, equipment['SI']['default'].f_max,
|
||||
equipment['SI']['default'].spacing),
|
||||
'power': dbm2watt(equipment['SI']['default'].power_dbm),
|
||||
'tx_power': dbm2watt(equipment['SI']['default'].power_dbm)
|
||||
}
|
||||
trx_params = trx_mode_params(equipment)
|
||||
params.update(trx_params)
|
||||
reference_channel = PathRequest(**params)
|
||||
try:
|
||||
design_network(reference_channel, network, equipment, verbose=True)
|
||||
except exceptions.NetworkTopologyError as e:
|
||||
print(f'{ansi_escapes.red}Invalid network definition:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
except exceptions.ConfigurationError as e:
|
||||
print(f'{ansi_escapes.red}Configuration error:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
|
||||
if args.save_network is not None:
|
||||
save_network(network, args.save_network)
|
||||
print(f'{ansi_escapes.blue}Network (after autodesign) saved to {args.save_network}{ansi_escapes.reset}')
|
||||
oms_list = build_oms_list(network, equipment)
|
||||
|
||||
try:
|
||||
data = load_requests(args.service_filename, equipment, bidir=args.bidir,
|
||||
network=network, network_filename=args.topology)
|
||||
rqs = requests_from_json(data, equipment)
|
||||
except exceptions.ServiceError as e:
|
||||
print(f'{ansi_escapes.red}Service error:{ansi_escapes.reset} {e}')
|
||||
sys.exit(1)
|
||||
# check that request ids are unique. Non unique ids, may
|
||||
# mess the computation: better to stop the computation
|
||||
all_ids = [r.request_id for r in rqs]
|
||||
if len(all_ids) != len(set(all_ids)):
|
||||
for item in list(set(all_ids)):
|
||||
all_ids.remove(item)
|
||||
msg = f'Requests id {all_ids} are not unique'
|
||||
_logger.critical(msg)
|
||||
sys.exit()
|
||||
rqs = correct_json_route_list(network, rqs)
|
||||
|
||||
# pths = compute_path(network, equipment, rqs)
|
||||
dsjn = disjunctions_from_json(data)
|
||||
|
||||
print(f'{ansi_escapes.blue}List of disjunctions{ansi_escapes.reset}')
|
||||
print(dsjn)
|
||||
# need to warn or correct in case of wrong disjunction form
|
||||
# disjunction must not be repeated with same or different ids
|
||||
dsjn = deduplicate_disjunctions(dsjn)
|
||||
|
||||
# Aggregate demands with same exact constraints
|
||||
print(f'{ansi_escapes.blue}Aggregating similar requests{ansi_escapes.reset}')
|
||||
|
||||
rqs, dsjn = requests_aggregation(rqs, dsjn)
|
||||
# TODO export novel set of aggregated demands in a json file
|
||||
|
||||
print(f'{ansi_escapes.blue}The following services have been requested:{ansi_escapes.reset}')
|
||||
print(rqs)
|
||||
|
||||
print(f'{ansi_escapes.blue}Computing all paths with constraints{ansi_escapes.reset}')
|
||||
try:
|
||||
pths = compute_path_dsjctn(network, equipment, rqs, dsjn)
|
||||
except exceptions.DisjunctionError as this_e:
|
||||
print(f'{ansi_escapes.red}Disjunction error:{ansi_escapes.reset} {this_e}')
|
||||
sys.exit(1)
|
||||
|
||||
print(f'{ansi_escapes.blue}Propagating on selected path{ansi_escapes.reset}')
|
||||
propagatedpths, reversed_pths, reversed_propagatedpths = compute_path_with_disjunction(network, equipment, rqs, pths)
|
||||
# Note that deepcopy used in compute_path_with_disjunction returns
|
||||
# a list of nodes which are not belonging to network (they are copies of the node objects).
|
||||
# so there can not be propagation on these nodes.
|
||||
|
||||
pth_assign_spectrum(pths, rqs, oms_list, reversed_pths)
|
||||
|
||||
print(f'{ansi_escapes.blue}Result summary{ansi_escapes.reset}')
|
||||
header = ['req id', ' demand', ' GSNR@bandwidth A-Z (Z-A)', ' GSNR@0.1nm A-Z (Z-A)',
|
||||
' Receiver minOSNR', ' mode', ' Gbit/s', ' nb of tsp pairs',
|
||||
'N,M or blocking reason']
|
||||
data = []
|
||||
data.append(header)
|
||||
for i, this_p in enumerate(propagatedpths):
|
||||
rev_pth = reversed_propagatedpths[i]
|
||||
if rev_pth and this_p:
|
||||
psnrb = f'{round(mean(this_p[-1].snr),2)} ({round(mean(rev_pth[-1].snr),2)})'
|
||||
psnr = f'{round(mean(this_p[-1].snr_01nm), 2)}' +\
|
||||
f' ({round(mean(rev_pth[-1].snr_01nm),2)})'
|
||||
elif this_p:
|
||||
psnrb = f'{round(mean(this_p[-1].snr),2)}'
|
||||
psnr = f'{round(mean(this_p[-1].snr_01nm),2)}'
|
||||
|
||||
try:
|
||||
if rqs[i].blocking_reason in BLOCKING_NOPATH:
|
||||
line = [f'{rqs[i].request_id}', f' {rqs[i].source} to {rqs[i].destination} :',
|
||||
f'-', f'-', f'-', f'{rqs[i].tsp_mode}', f'{round(rqs[i].path_bandwidth * 1e-9,2)}',
|
||||
f'-', f'{rqs[i].blocking_reason}']
|
||||
else:
|
||||
line = [f'{rqs[i].request_id}', f' {rqs[i].source} to {rqs[i].destination} : ', psnrb,
|
||||
psnr, f'-', f'{rqs[i].tsp_mode}', f'{round(rqs[i].path_bandwidth * 1e-9, 2)}',
|
||||
f'-', f'{rqs[i].blocking_reason}']
|
||||
except AttributeError:
|
||||
line = [f'{rqs[i].request_id}', f' {rqs[i].source} to {rqs[i].destination} : ', psnrb,
|
||||
psnr, f'{rqs[i].OSNR + equipment["SI"]["default"].sys_margins}',
|
||||
f'{rqs[i].tsp_mode}', f'{round(rqs[i].path_bandwidth * 1e-9,2)}',
|
||||
f'{ceil(rqs[i].path_bandwidth / rqs[i].bit_rate) }', f'({rqs[i].N},{rqs[i].M})']
|
||||
data.append(line)
|
||||
|
||||
col_width = max(len(word) for row in data for word in row[2:]) # padding
|
||||
firstcol_width = max(len(row[0]) for row in data) # padding
|
||||
secondcol_width = max(len(row[1]) for row in data) # padding
|
||||
for row in data:
|
||||
firstcol = ''.join(row[0].ljust(firstcol_width))
|
||||
secondcol = ''.join(row[1].ljust(secondcol_width))
|
||||
remainingcols = ''.join(word.center(col_width, ' ') for word in row[2:])
|
||||
print(f'{firstcol} {secondcol} {remainingcols}')
|
||||
print(f'{ansi_escapes.yellow}Result summary shows mean GSNR and OSNR (average over all channels){ansi_escapes.reset}')
|
||||
|
||||
if args.output:
|
||||
result = []
|
||||
# assumes that list of rqs and list of propgatedpths have same order
|
||||
for i, pth in enumerate(propagatedpths):
|
||||
result.append(ResultElement(rqs[i], pth, reversed_propagatedpths[i]))
|
||||
temp = _path_result_json(result)
|
||||
if args.output.suffix.lower() == '.json':
|
||||
save_json(temp, args.output)
|
||||
print(f'{ansi_escapes.blue}Saved JSON to {args.output}{ansi_escapes.reset}')
|
||||
elif args.output.suffix.lower() == '.csv':
|
||||
with open(args.output, "w", encoding='utf-8') as fcsv:
|
||||
jsontocsv(temp, equipment, fcsv)
|
||||
print(f'{ansi_escapes.blue}Saved CSV to {args.output}{ansi_escapes.reset}')
|
||||
else:
|
||||
print(f'{ansi_escapes.red}Cannot save output: neither JSON nor CSV file{ansi_escapes.reset}')
|
||||
sys.exit(1)
|
||||
872
gnpy/tools/convert.py
Executable file
872
gnpy/tools/convert.py
Executable file
@@ -0,0 +1,872 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
gnpy.tools.convert
|
||||
==================
|
||||
|
||||
This module contains utilities for converting between XLS and JSON.
|
||||
|
||||
The input XLS file must contain sheets named "Nodes" and "Links".
|
||||
It may optionally contain a sheet named "Eqpt".
|
||||
|
||||
In the "Nodes" sheet, only the "City" column is mandatory. The column "Type"
|
||||
can be determined automatically given the topology (e.g., if degree 2, ILA;
|
||||
otherwise, ROADM.) Incorrectly specified types (e.g., ILA for node of
|
||||
degree ≠ 2) will be automatically corrected.
|
||||
|
||||
In the "Links" sheet, only the first three columns ("Node A", "Node Z" and
|
||||
"east Distance (km)") are mandatory. Missing "west" information is copied from
|
||||
the "east" information so that it is possible to input undirected data.
|
||||
"""
|
||||
|
||||
from xlrd import open_workbook
|
||||
from logging import getLogger
|
||||
from argparse import ArgumentParser
|
||||
from collections import namedtuple, Counter, defaultdict
|
||||
from itertools import chain
|
||||
from json import dumps
|
||||
from pathlib import Path
|
||||
from copy import copy
|
||||
|
||||
from gnpy.core.utils import silent_remove
|
||||
from gnpy.core.exceptions import NetworkTopologyError
|
||||
from gnpy.core.elements import Edfa, Fused, Fiber
|
||||
|
||||
|
||||
_logger = getLogger(__name__)
|
||||
|
||||
|
||||
def all_rows(sh, start=0):
|
||||
return (sh.row(x) for x in range(start, sh.nrows))
|
||||
|
||||
|
||||
class Node(object):
|
||||
def __init__(self, **kwargs):
|
||||
super(Node, self).__init__()
|
||||
self.update_attr(kwargs)
|
||||
|
||||
def update_attr(self, kwargs):
|
||||
clean_kwargs = {k: v for k, v in kwargs.items() if v != ''}
|
||||
for k, v in self.default_values.items():
|
||||
v = clean_kwargs.get(k, v)
|
||||
setattr(self, k, v)
|
||||
|
||||
default_values = {
|
||||
'city': '',
|
||||
'state': '',
|
||||
'country': '',
|
||||
'region': '',
|
||||
'latitude': 0,
|
||||
'longitude': 0,
|
||||
'node_type': 'ILA',
|
||||
'booster_restriction': '',
|
||||
'preamp_restriction': ''
|
||||
}
|
||||
|
||||
|
||||
class Link(object):
|
||||
"""attribtes from west parse_ept_headers dict
|
||||
+node_a, node_z, west_fiber_con_in, east_fiber_con_in
|
||||
"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(Link, self).__init__()
|
||||
self.update_attr(kwargs)
|
||||
self.distance_units = 'km'
|
||||
|
||||
def update_attr(self, kwargs):
|
||||
clean_kwargs = {k: v for k, v in kwargs.items() if v != ''}
|
||||
for k, v in self.default_values.items():
|
||||
v = clean_kwargs.get(k, v)
|
||||
setattr(self, k, v)
|
||||
k = 'west' + k.split('east')[-1]
|
||||
v = clean_kwargs.get(k, v)
|
||||
setattr(self, k, v)
|
||||
|
||||
def __eq__(self, link):
|
||||
return (self.from_city == link.from_city and self.to_city == link.to_city) \
|
||||
or (self.from_city == link.to_city and self.to_city == link.from_city)
|
||||
|
||||
default_values = {
|
||||
'from_city': '',
|
||||
'to_city': '',
|
||||
'east_distance': 80,
|
||||
'east_fiber': 'SSMF',
|
||||
'east_lineic': 0.2,
|
||||
'east_con_in': None,
|
||||
'east_con_out': None,
|
||||
'east_pmd': 0.1,
|
||||
'east_cable': ''
|
||||
}
|
||||
|
||||
|
||||
class Eqpt(object):
|
||||
def __init__(self, **kwargs):
|
||||
super(Eqpt, self).__init__()
|
||||
self.update_attr(kwargs)
|
||||
|
||||
def update_attr(self, kwargs):
|
||||
clean_kwargs = {k: v for k, v in kwargs.items() if v != ''}
|
||||
for k, v in self.default_values.items():
|
||||
v_east = clean_kwargs.get(k, v)
|
||||
setattr(self, k, v_east)
|
||||
k = 'west' + k.split('east')[-1]
|
||||
v_west = clean_kwargs.get(k, v)
|
||||
setattr(self, k, v_west)
|
||||
|
||||
default_values = {
|
||||
'from_city': '',
|
||||
'to_city': '',
|
||||
'east_amp_type': '',
|
||||
'east_att_in': 0,
|
||||
'east_amp_gain': None,
|
||||
'east_amp_dp': None,
|
||||
'east_tilt_vs_wavelength': 0,
|
||||
'east_att_out': None
|
||||
}
|
||||
|
||||
|
||||
class Roadm(object):
|
||||
def __init__(self, **kwargs):
|
||||
super(Roadm, self).__init__()
|
||||
self.update_attr(kwargs)
|
||||
|
||||
def update_attr(self, kwargs):
|
||||
clean_kwargs = {k: v for k, v in kwargs.items() if v != ''}
|
||||
for k, v in self.default_values.items():
|
||||
v = clean_kwargs.get(k, v)
|
||||
setattr(self, k, v)
|
||||
|
||||
default_values = {'from_node': '',
|
||||
'to_node': '',
|
||||
'target_pch_out_db': None
|
||||
}
|
||||
|
||||
|
||||
def read_header(my_sheet, line, slice_):
|
||||
""" return the list of headers !:= ''
|
||||
header_i = [(header, header_column_index), ...]
|
||||
in a {line, slice1_x, slice_y} range
|
||||
"""
|
||||
Param_header = namedtuple('Param_header', 'header colindex')
|
||||
try:
|
||||
header = [x.value.strip() for x in my_sheet.row_slice(line, slice_[0], slice_[1])]
|
||||
header_i = [Param_header(header, i + slice_[0]) for i, header in enumerate(header) if header != '']
|
||||
except Exception:
|
||||
header_i = []
|
||||
if header_i != [] and header_i[-1].colindex != slice_[1]:
|
||||
header_i.append(Param_header('', slice_[1]))
|
||||
return header_i
|
||||
|
||||
|
||||
def read_slice(my_sheet, line, slice_, header):
|
||||
"""return the slice range of a given header
|
||||
in a defined range {line, slice_x, slice_y}"""
|
||||
header_i = read_header(my_sheet, line, slice_)
|
||||
slice_range = (-1, -1)
|
||||
if header_i != []:
|
||||
try:
|
||||
slice_range = next((h.colindex, header_i[i + 1].colindex)
|
||||
for i, h in enumerate(header_i) if header in h.header)
|
||||
except Exception:
|
||||
pass
|
||||
return slice_range
|
||||
|
||||
|
||||
def parse_headers(my_sheet, input_headers_dict, headers, start_line, slice_in):
|
||||
"""return a dict of header_slice
|
||||
key = column index
|
||||
value = header name"""
|
||||
|
||||
for h0 in input_headers_dict:
|
||||
slice_out = read_slice(my_sheet, start_line, slice_in, h0)
|
||||
iteration = 1
|
||||
while slice_out == (-1, -1) and iteration < 10:
|
||||
# try next lines
|
||||
slice_out = read_slice(my_sheet, start_line + iteration, slice_in, h0)
|
||||
iteration += 1
|
||||
if slice_out == (-1, -1):
|
||||
msg = f'missing header {h0}'
|
||||
if h0 in ('east', 'Node A', 'Node Z', 'City'):
|
||||
raise NetworkTopologyError(msg)
|
||||
else:
|
||||
_logger.warning(msg)
|
||||
elif not isinstance(input_headers_dict[h0], dict):
|
||||
headers[slice_out[0]] = input_headers_dict[h0]
|
||||
else:
|
||||
headers = parse_headers(my_sheet, input_headers_dict[h0], headers, start_line + 1, slice_out)
|
||||
if headers == {}:
|
||||
msg = 'CRITICAL ERROR: could not find any header to read _ ABORT'
|
||||
raise NetworkTopologyError(msg)
|
||||
return headers
|
||||
|
||||
|
||||
def parse_row(row, headers):
|
||||
return {f: r.value for f, r in
|
||||
zip([label for label in headers.values()], [row[i] for i in headers])}
|
||||
|
||||
|
||||
def parse_sheet(my_sheet, input_headers_dict, header_line, start_line, column):
|
||||
headers = parse_headers(my_sheet, input_headers_dict, {}, header_line, (0, column))
|
||||
for row in all_rows(my_sheet, start=start_line):
|
||||
yield parse_row(row[0: column], headers)
|
||||
|
||||
|
||||
def _format_items(items):
|
||||
return '\n'.join(f' - {item}' for item in items)
|
||||
|
||||
|
||||
def sanity_check(nodes, links, nodes_by_city, links_by_city, eqpts_by_city):
|
||||
|
||||
duplicate_links = []
|
||||
for l1 in links:
|
||||
for l2 in links:
|
||||
if l1 is not l2 and l1 == l2 and l2 not in duplicate_links:
|
||||
_logger.warning(f'\nWARNING\n \
|
||||
link {l1.from_city}-{l1.to_city} is duplicate \
|
||||
\nthe 1st duplicate link will be removed but you should check Links sheet input')
|
||||
duplicate_links.append(l1)
|
||||
if duplicate_links:
|
||||
msg = 'XLS error: ' \
|
||||
+ f'links {_format_items([(d.from_city, d.to_city) for d in duplicate_links])} are duplicate'
|
||||
raise NetworkTopologyError(msg)
|
||||
unreferenced_nodes = [n for n in nodes_by_city if n not in links_by_city]
|
||||
if unreferenced_nodes:
|
||||
msg = 'XLS error: The following nodes are not ' \
|
||||
+ 'referenced from the Links sheet. ' \
|
||||
+ 'If unused, remove them from the Nodes sheet:\n' \
|
||||
+ _format_items(unreferenced_nodes)
|
||||
raise NetworkTopologyError(msg)
|
||||
# no need to check "Links" for invalid nodes because that's already in parse_excel()
|
||||
wrong_eqpt_from = [n for n in eqpts_by_city if n not in nodes_by_city]
|
||||
wrong_eqpt_to = [n.to_city for destinations in eqpts_by_city.values()
|
||||
for n in destinations if n.to_city not in nodes_by_city]
|
||||
wrong_eqpt = wrong_eqpt_from + wrong_eqpt_to
|
||||
if wrong_eqpt:
|
||||
msg = 'XLS error: ' \
|
||||
+ 'The Eqpt sheet refers to nodes that ' \
|
||||
+ 'are not defined in the Nodes sheet:\n'\
|
||||
+ _format_items(wrong_eqpt)
|
||||
raise NetworkTopologyError(msg)
|
||||
# Now check links that are not listed in Links sheet, and duplicates
|
||||
bad_eqpt = []
|
||||
possible_links = [f'{e.from_city}|{e.to_city}' for e in links] + [f'{e.to_city}|{e.from_city}' for e in links]
|
||||
possible_eqpt = []
|
||||
duplicate_eqpt = []
|
||||
duplicate_ila = []
|
||||
for city, eqpts in eqpts_by_city.items():
|
||||
for eqpt in eqpts:
|
||||
# Check that each node_A-node_Z exists in links
|
||||
nodea_nodez = f'{eqpt.from_city}|{eqpt.to_city}'
|
||||
nodez_nodea = f'{eqpt.to_city}|{eqpt.from_city}'
|
||||
if nodea_nodez not in possible_links \
|
||||
or nodez_nodea not in possible_links:
|
||||
bad_eqpt.append([eqpt.from_city, eqpt.to_city])
|
||||
else:
|
||||
# Check that there are no duplicate lines in the Eqpt sheet
|
||||
if nodea_nodez in possible_eqpt:
|
||||
duplicate_eqpt.append([eqpt.from_city, eqpt.to_city])
|
||||
else:
|
||||
possible_eqpt.append(nodea_nodez)
|
||||
# check that there are no two lines defining an ILA with different directions
|
||||
if nodes_by_city[city].node_type == 'ILA' and len(eqpts) > 1:
|
||||
duplicate_ila.append(city)
|
||||
if bad_eqpt:
|
||||
msg = 'XLS error: ' \
|
||||
+ 'The Eqpt sheet references links that ' \
|
||||
+ 'are not defined in the Links sheet:\n' \
|
||||
+ _format_items(f'{item[0]} -> {item[1]}' for item in bad_eqpt)
|
||||
raise NetworkTopologyError(msg)
|
||||
if duplicate_eqpt:
|
||||
msg = 'XLS error: Duplicate lines in Eqpt sheet:' \
|
||||
+ _format_items(f'{item[0]} -> {item[1]}' for item in duplicate_eqpt)
|
||||
raise NetworkTopologyError(msg)
|
||||
if duplicate_ila:
|
||||
msg = 'XLS error: Duplicate ILA eqpt definition in Eqpt sheet:' \
|
||||
+ _format_items(duplicate_ila)
|
||||
raise NetworkTopologyError(msg)
|
||||
|
||||
for city, link in links_by_city.items():
|
||||
if nodes_by_city[city].node_type.lower() == 'ila' and len(link) != 2:
|
||||
# wrong input: ILA sites can only be Degree 2
|
||||
# => correct to make it a ROADM and remove entry in links_by_city
|
||||
_logger.warning(f'invalid node type ({nodes_by_city[city].node_type}) '
|
||||
+ f'specified in {city}, replaced by ROADM')
|
||||
nodes_by_city[city].node_type = 'ROADM'
|
||||
for n in nodes:
|
||||
if n.city == city:
|
||||
n.node_type = 'ROADM'
|
||||
return nodes, links
|
||||
|
||||
|
||||
def create_roadm_element(node, roadms_by_city):
|
||||
""" create the json element for a roadm node, including the different cases:
|
||||
- if there are restrictions
|
||||
- if there are per degree target power defined on a direction
|
||||
direction is defined by the booster name, so that booster must also be created in eqpt sheet
|
||||
if the direction is defined in roadm
|
||||
"""
|
||||
roadm = {'uid': f'roadm {node.city}'}
|
||||
if node.preamp_restriction != '' or node.booster_restriction != '':
|
||||
roadm['params'] = {
|
||||
'restrictions': {
|
||||
'preamp_variety_list': silent_remove(node.preamp_restriction.split(' | '), ''),
|
||||
'booster_variety_list': silent_remove(node.booster_restriction.split(' | '), '')}
|
||||
}
|
||||
if node.city in roadms_by_city.keys():
|
||||
if 'params' not in roadm.keys():
|
||||
roadm['params'] = {}
|
||||
roadm['params']['per_degree_pch_out_db'] = {}
|
||||
for elem in roadms_by_city[node.city]:
|
||||
to_node = f'east edfa in {node.city} to {elem.to_node}'
|
||||
if elem.target_pch_out_db is not None:
|
||||
roadm['params']['per_degree_pch_out_db'][to_node] = elem.target_pch_out_db
|
||||
roadm['metadata'] = {'location': {'city': node.city,
|
||||
'region': node.region,
|
||||
'latitude': node.latitude,
|
||||
'longitude': node.longitude}}
|
||||
roadm['type'] = 'Roadm'
|
||||
return roadm
|
||||
|
||||
|
||||
def create_east_eqpt_element(node):
|
||||
""" create amplifiers json elements for the east direction.
|
||||
this includes the case where the case of a fused element defined instead of an
|
||||
ILA in eqpt sheet
|
||||
"""
|
||||
eqpt = {'uid': f'east edfa in {node.from_city} to {node.to_city}',
|
||||
'metadata': {'location': {'city': nodes_by_city[node.from_city].city,
|
||||
'region': nodes_by_city[node.from_city].region,
|
||||
'latitude': nodes_by_city[node.from_city].latitude,
|
||||
'longitude': nodes_by_city[node.from_city].longitude}}}
|
||||
if node.east_amp_type.lower() != '' and node.east_amp_type.lower() != 'fused':
|
||||
eqpt['type'] = 'Edfa'
|
||||
eqpt['type_variety'] = f'{node.east_amp_type}'
|
||||
eqpt['operational'] = {'gain_target': node.east_amp_gain,
|
||||
'delta_p': node.east_amp_dp,
|
||||
'tilt_target': node.east_tilt_vs_wavelength,
|
||||
'out_voa': node.east_att_out}
|
||||
elif node.east_amp_type.lower() == '':
|
||||
eqpt['type'] = 'Edfa'
|
||||
eqpt['operational'] = {'gain_target': node.east_amp_gain,
|
||||
'delta_p': node.east_amp_dp,
|
||||
'tilt_target': node.east_tilt_vs_wavelength,
|
||||
'out_voa': node.east_att_out}
|
||||
elif node.east_amp_type.lower() == 'fused':
|
||||
# fused edfa variety is a hack to indicate that there should not be
|
||||
# booster amplifier out the roadm.
|
||||
# If user specifies ILA in Nodes sheet and fused in Eqpt sheet, then assumes that
|
||||
# this is a fused nodes.
|
||||
eqpt['type'] = 'Fused'
|
||||
eqpt['params'] = {'loss': 0}
|
||||
return eqpt
|
||||
|
||||
|
||||
def create_west_eqpt_element(node):
|
||||
""" create amplifiers json elements for the west direction.
|
||||
this includes the case where the case of a fused element defined instead of an
|
||||
ILA in eqpt sheet
|
||||
"""
|
||||
eqpt = {'uid': f'west edfa in {node.from_city} to {node.to_city}',
|
||||
'metadata': {'location': {'city': nodes_by_city[node.from_city].city,
|
||||
'region': nodes_by_city[node.from_city].region,
|
||||
'latitude': nodes_by_city[node.from_city].latitude,
|
||||
'longitude': nodes_by_city[node.from_city].longitude}},
|
||||
'type': 'Edfa'}
|
||||
if node.west_amp_type.lower() != '' and node.west_amp_type.lower() != 'fused':
|
||||
eqpt['type_variety'] = f'{node.west_amp_type}'
|
||||
eqpt['operational'] = {'gain_target': node.west_amp_gain,
|
||||
'delta_p': node.west_amp_dp,
|
||||
'tilt_target': node.west_tilt_vs_wavelength,
|
||||
'out_voa': node.west_att_out}
|
||||
elif node.west_amp_type.lower() == '':
|
||||
eqpt['operational'] = {'gain_target': node.west_amp_gain,
|
||||
'delta_p': node.west_amp_dp,
|
||||
'tilt_target': node.west_tilt_vs_wavelength,
|
||||
'out_voa': node.west_att_out}
|
||||
elif node.west_amp_type.lower() == 'fused':
|
||||
eqpt['type'] = 'Fused'
|
||||
eqpt['params'] = {'loss': 0}
|
||||
return eqpt
|
||||
|
||||
def xls_to_json_data(input_filename, filter_region=[]):
|
||||
nodes, links, eqpts, roadms = parse_excel(input_filename)
|
||||
if filter_region:
|
||||
nodes = [n for n in nodes if n.region.lower() in filter_region]
|
||||
cities = {n.city for n in nodes}
|
||||
links = [lnk for lnk in links if lnk.from_city in cities and
|
||||
lnk.to_city in cities]
|
||||
cities = {lnk.from_city for lnk in links} | {lnk.to_city for lnk in links}
|
||||
nodes = [n for n in nodes if n.city in cities]
|
||||
|
||||
global nodes_by_city
|
||||
nodes_by_city = {n.city: n for n in nodes}
|
||||
|
||||
global links_by_city
|
||||
links_by_city = defaultdict(list)
|
||||
for link in links:
|
||||
links_by_city[link.from_city].append(link)
|
||||
links_by_city[link.to_city].append(link)
|
||||
|
||||
global eqpts_by_city
|
||||
eqpts_by_city = defaultdict(list)
|
||||
for eqpt in eqpts:
|
||||
eqpts_by_city[eqpt.from_city].append(eqpt)
|
||||
|
||||
roadms_by_city = defaultdict(list)
|
||||
for roadm in roadms:
|
||||
roadms_by_city[roadm.from_node].append(roadm)
|
||||
|
||||
nodes, links = sanity_check(nodes, links, nodes_by_city, links_by_city, eqpts_by_city)
|
||||
|
||||
return {
|
||||
'elements':
|
||||
[{'uid': f'trx {x.city}',
|
||||
'metadata': {'location': {'city': x.city,
|
||||
'region': x.region,
|
||||
'latitude': x.latitude,
|
||||
'longitude': x.longitude}},
|
||||
'type': 'Transceiver'}
|
||||
for x in nodes_by_city.values() if x.node_type.lower() == 'roadm'] +
|
||||
[create_roadm_element(x, roadms_by_city)
|
||||
for x in nodes_by_city.values() if x.node_type.lower() == 'roadm'] +
|
||||
[{'uid': f'west fused spans in {x.city}',
|
||||
'metadata': {'location': {'city': x.city,
|
||||
'region': x.region,
|
||||
'latitude': x.latitude,
|
||||
'longitude': x.longitude}},
|
||||
'type': 'Fused'}
|
||||
for x in nodes_by_city.values() if x.node_type.lower() == 'fused'] +
|
||||
[{'uid': f'east fused spans in {x.city}',
|
||||
'metadata': {'location': {'city': x.city,
|
||||
'region': x.region,
|
||||
'latitude': x.latitude,
|
||||
'longitude': x.longitude}},
|
||||
'type': 'Fused'}
|
||||
for x in nodes_by_city.values() if x.node_type.lower() == 'fused'] +
|
||||
[{'uid': f'fiber ({x.from_city} \u2192 {x.to_city})-{x.east_cable}',
|
||||
'metadata': {'location': midpoint(nodes_by_city[x.from_city],
|
||||
nodes_by_city[x.to_city])},
|
||||
'type': 'Fiber',
|
||||
'type_variety': x.east_fiber,
|
||||
'params': {'length': round(x.east_distance, 3),
|
||||
'length_units': x.distance_units,
|
||||
'loss_coef': x.east_lineic,
|
||||
'con_in': x.east_con_in,
|
||||
'con_out': x.east_con_out}
|
||||
}
|
||||
for x in links] +
|
||||
[{'uid': f'fiber ({x.to_city} \u2192 {x.from_city})-{x.west_cable}',
|
||||
'metadata': {'location': midpoint(nodes_by_city[x.from_city],
|
||||
nodes_by_city[x.to_city])},
|
||||
'type': 'Fiber',
|
||||
'type_variety': x.west_fiber,
|
||||
'params': {'length': round(x.west_distance, 3),
|
||||
'length_units': x.distance_units,
|
||||
'loss_coef': x.west_lineic,
|
||||
'con_in': x.west_con_in,
|
||||
'con_out': x.west_con_out}
|
||||
} for x in links] +
|
||||
[{'uid': f'west edfa in {x.city}',
|
||||
'metadata': {'location': {'city': x.city,
|
||||
'region': x.region,
|
||||
'latitude': x.latitude,
|
||||
'longitude': x.longitude}},
|
||||
'type': 'Edfa',
|
||||
'operational': {'gain_target': None,
|
||||
'tilt_target': 0}
|
||||
} for x in nodes_by_city.values() if x.node_type.lower() == 'ila' and x.city not in eqpts_by_city] +
|
||||
[{'uid': f'east edfa in {x.city}',
|
||||
'metadata': {'location': {'city': x.city,
|
||||
'region': x.region,
|
||||
'latitude': x.latitude,
|
||||
'longitude': x.longitude}},
|
||||
'type': 'Edfa',
|
||||
'operational': {'gain_target': None,
|
||||
'tilt_target': 0}
|
||||
} for x in nodes_by_city.values() if x.node_type.lower() == 'ila' and x.city not in eqpts_by_city] +
|
||||
[create_east_eqpt_element(e) for e in eqpts] +
|
||||
[create_west_eqpt_element(e) for e in eqpts],
|
||||
'connections':
|
||||
list(chain.from_iterable([eqpt_connection_by_city(n.city)
|
||||
for n in nodes]))
|
||||
+
|
||||
list(chain.from_iterable(zip(
|
||||
[{'from_node': f'trx {x.city}',
|
||||
'to_node': f'roadm {x.city}'}
|
||||
for x in nodes_by_city.values() if x.node_type.lower() == 'roadm'],
|
||||
[{'from_node': f'roadm {x.city}',
|
||||
'to_node': f'trx {x.city}'}
|
||||
for x in nodes_by_city.values() if x.node_type.lower() == 'roadm'])))
|
||||
}
|
||||
|
||||
|
||||
def convert_file(input_filename, filter_region=[], output_json_file_name=None):
|
||||
data = xls_to_json_data(input_filename, filter_region)
|
||||
if output_json_file_name is None:
|
||||
output_json_file_name = input_filename.with_suffix('.json')
|
||||
with open(output_json_file_name, 'w', encoding='utf-8') as edfa_json_file:
|
||||
edfa_json_file.write(dumps(data, indent=2, ensure_ascii=False))
|
||||
edfa_json_file.write('\n') # add end of file newline because json dumps does not.
|
||||
return output_json_file_name
|
||||
|
||||
|
||||
def corresp_names(input_filename, network):
|
||||
""" a function that builds the correspondance between names given in the excel,
|
||||
and names used in the json, and created by the autodesign.
|
||||
All names are listed
|
||||
"""
|
||||
nodes, links, eqpts, roadms = parse_excel(input_filename)
|
||||
fused = [n.uid for n in network.nodes() if isinstance(n, Fused)]
|
||||
ila = [n.uid for n in network.nodes() if isinstance(n, Edfa)]
|
||||
|
||||
corresp_roadm = {x.city: [f'roadm {x.city}'] for x in nodes
|
||||
if x.node_type.lower() == 'roadm'}
|
||||
corresp_fused = {x.city: [f'west fused spans in {x.city}', f'east fused spans in {x.city}']
|
||||
for x in nodes if x.node_type.lower() == 'fused' and
|
||||
f'west fused spans in {x.city}' in fused and
|
||||
f'east fused spans in {x.city}' in fused}
|
||||
|
||||
# add the special cases when an ila is changed into a fused
|
||||
for my_e in eqpts:
|
||||
name = f'east edfa in {my_e.from_city} to {my_e.to_city}'
|
||||
if my_e.east_amp_type.lower() == 'fused' and name in fused:
|
||||
if my_e.from_city in corresp_fused.keys():
|
||||
corresp_fused[my_e.from_city].append(name)
|
||||
else:
|
||||
corresp_fused[my_e.from_city] = [name]
|
||||
name = f'west edfa in {my_e.from_city} to {my_e.to_city}'
|
||||
if my_e.west_amp_type.lower() == 'fused' and name in fused:
|
||||
if my_e.from_city in corresp_fused.keys():
|
||||
corresp_fused[my_e.from_city].append(name)
|
||||
else:
|
||||
corresp_fused[my_e.from_city] = [name]
|
||||
# build corresp ila based on eqpt sheet
|
||||
# start with east direction
|
||||
corresp_ila = {e.from_city: [f'east edfa in {e.from_city} to {e.to_city}']
|
||||
for e in eqpts if f'east edfa in {e.from_city} to {e.to_city}' in ila}
|
||||
# west direction, append name or create a new item in dict
|
||||
for my_e in eqpts:
|
||||
name = f'west edfa in {my_e.from_city} to {my_e.to_city}'
|
||||
if name in ila:
|
||||
if my_e.from_city in corresp_ila.keys():
|
||||
corresp_ila[my_e.from_city].append(name)
|
||||
else:
|
||||
corresp_ila[my_e.from_city] = [name]
|
||||
# complete with potential autodesign names: amplifiers
|
||||
for my_l in links:
|
||||
name = f'Edfa0_fiber ({my_l.to_city} \u2192 {my_l.from_city})-{my_l.west_cable}'
|
||||
if name in ila:
|
||||
if my_l.from_city in corresp_ila.keys():
|
||||
# "east edfa in Stbrieuc to Rennes_STA" is equivalent name as
|
||||
# "Edfa0_fiber (Lannion_CAS → Stbrieuc)-F056"
|
||||
# "west edfa in Stbrieuc to Rennes_STA" is equivalent name as
|
||||
# "Edfa0_fiber (Rennes_STA → Stbrieuc)-F057"
|
||||
# does not filter names: all types (except boosters) are created.
|
||||
# in case fibers are splitted the name here is a prefix
|
||||
corresp_ila[my_l.from_city].append(name)
|
||||
else:
|
||||
corresp_ila[my_l.from_city] = [name]
|
||||
name = f'Edfa0_fiber ({my_l.from_city} \u2192 {my_l.to_city})-{my_l.east_cable}'
|
||||
if name in ila:
|
||||
if my_l.to_city in corresp_ila.keys():
|
||||
corresp_ila[my_l.to_city].append(name)
|
||||
else:
|
||||
corresp_ila[my_l.to_city] = [name]
|
||||
# merge fused with ila:
|
||||
for key, val in corresp_fused.items():
|
||||
if key in corresp_ila.keys():
|
||||
corresp_ila[key].extend(val)
|
||||
else:
|
||||
corresp_ila[key] = val
|
||||
# no need of roadm booster
|
||||
return corresp_roadm, corresp_fused, corresp_ila
|
||||
|
||||
|
||||
def parse_excel(input_filename):
|
||||
link_headers = {
|
||||
'Node A': 'from_city',
|
||||
'Node Z': 'to_city',
|
||||
'east': {
|
||||
'Distance (km)': 'east_distance',
|
||||
'Fiber type': 'east_fiber',
|
||||
'lineic att': 'east_lineic',
|
||||
'Con_in': 'east_con_in',
|
||||
'Con_out': 'east_con_out',
|
||||
'PMD': 'east_pmd',
|
||||
'Cable id': 'east_cable'
|
||||
},
|
||||
'west': {
|
||||
'Distance (km)': 'west_distance',
|
||||
'Fiber type': 'west_fiber',
|
||||
'lineic att': 'west_lineic',
|
||||
'Con_in': 'west_con_in',
|
||||
'Con_out': 'west_con_out',
|
||||
'PMD': 'west_pmd',
|
||||
'Cable id': 'west_cable'
|
||||
}
|
||||
}
|
||||
node_headers = {
|
||||
'City': 'city',
|
||||
'State': 'state',
|
||||
'Country': 'country',
|
||||
'Region': 'region',
|
||||
'Latitude': 'latitude',
|
||||
'Longitude': 'longitude',
|
||||
'Type': 'node_type',
|
||||
'Booster_restriction': 'booster_restriction',
|
||||
'Preamp_restriction': 'preamp_restriction'
|
||||
}
|
||||
eqpt_headers = {
|
||||
'Node A': 'from_city',
|
||||
'Node Z': 'to_city',
|
||||
'east': {
|
||||
'amp type': 'east_amp_type',
|
||||
'att_in': 'east_att_in',
|
||||
'amp gain': 'east_amp_gain',
|
||||
'delta p': 'east_amp_dp',
|
||||
'tilt': 'east_tilt',
|
||||
'att_out': 'east_att_out'
|
||||
},
|
||||
'west': {
|
||||
'amp type': 'west_amp_type',
|
||||
'att_in': 'west_att_in',
|
||||
'amp gain': 'west_amp_gain',
|
||||
'delta p': 'west_amp_dp',
|
||||
'tilt': 'west_tilt',
|
||||
'att_out': 'west_att_out'
|
||||
}
|
||||
}
|
||||
roadm_headers = {'Node A': 'from_node',
|
||||
'Node Z': 'to_node',
|
||||
'per degree target power (dBm)': 'target_pch_out_db'
|
||||
}
|
||||
|
||||
with open_workbook(input_filename) as wb:
|
||||
nodes_sheet = wb.sheet_by_name('Nodes')
|
||||
links_sheet = wb.sheet_by_name('Links')
|
||||
try:
|
||||
eqpt_sheet = wb.sheet_by_name('Eqpt')
|
||||
except Exception:
|
||||
# eqpt_sheet is optional
|
||||
eqpt_sheet = None
|
||||
try:
|
||||
roadm_sheet = wb.sheet_by_name('Roadms')
|
||||
except Exception:
|
||||
# roadm_sheet is optional
|
||||
roadm_sheet = None
|
||||
|
||||
nodes = []
|
||||
for node in parse_sheet(nodes_sheet, node_headers, NODES_LINE, NODES_LINE + 1, NODES_COLUMN):
|
||||
nodes.append(Node(**node))
|
||||
expected_node_types = {'ROADM', 'ILA', 'FUSED'}
|
||||
for n in nodes:
|
||||
if n.node_type not in expected_node_types:
|
||||
n.node_type = 'ILA'
|
||||
|
||||
links = []
|
||||
for link in parse_sheet(links_sheet, link_headers, LINKS_LINE, LINKS_LINE + 2, LINKS_COLUMN):
|
||||
links.append(Link(**link))
|
||||
|
||||
eqpts = []
|
||||
if eqpt_sheet is not None:
|
||||
for eqpt in parse_sheet(eqpt_sheet, eqpt_headers, EQPTS_LINE, EQPTS_LINE + 2, EQPTS_COLUMN):
|
||||
eqpts.append(Eqpt(**eqpt))
|
||||
|
||||
roadms = []
|
||||
if roadm_sheet is not None:
|
||||
for roadm in parse_sheet(roadm_sheet, roadm_headers, ROADMS_LINE, ROADMS_LINE+2, ROADMS_COLUMN):
|
||||
roadms.append(Roadm(**roadm))
|
||||
|
||||
# sanity check
|
||||
all_cities = Counter(n.city for n in nodes)
|
||||
if len(all_cities) != len(nodes):
|
||||
msg = f'Duplicate city: {all_cities}'
|
||||
raise NetworkTopologyError(msg)
|
||||
bad_links = []
|
||||
for lnk in links:
|
||||
if lnk.from_city not in all_cities or lnk.to_city not in all_cities:
|
||||
bad_links.append([lnk.from_city, lnk.to_city])
|
||||
|
||||
if bad_links:
|
||||
msg = 'XLS error: ' \
|
||||
+ 'The Links sheet references nodes that ' \
|
||||
+ 'are not defined in the Nodes sheet:\n' \
|
||||
+ _format_items(f'{item[0]} -> {item[1]}' for item in bad_links)
|
||||
raise NetworkTopologyError(msg)
|
||||
|
||||
return nodes, links, eqpts, roadms
|
||||
|
||||
|
||||
def eqpt_connection_by_city(city_name):
|
||||
other_cities = fiber_dest_from_source(city_name)
|
||||
subdata = []
|
||||
if nodes_by_city[city_name].node_type.lower() in {'ila', 'fused'}:
|
||||
# Then len(other_cities) == 2
|
||||
direction = ['west', 'east']
|
||||
for i in range(2):
|
||||
from_ = fiber_link(other_cities[i], city_name)
|
||||
in_ = eqpt_in_city_to_city(city_name, other_cities[0], direction[i])
|
||||
to_ = fiber_link(city_name, other_cities[1 - i])
|
||||
subdata += connect_eqpt(from_, in_, to_)
|
||||
elif nodes_by_city[city_name].node_type.lower() == 'roadm':
|
||||
for other_city in other_cities:
|
||||
from_ = f'roadm {city_name}'
|
||||
in_ = eqpt_in_city_to_city(city_name, other_city)
|
||||
to_ = fiber_link(city_name, other_city)
|
||||
subdata += connect_eqpt(from_, in_, to_)
|
||||
|
||||
from_ = fiber_link(other_city, city_name)
|
||||
in_ = eqpt_in_city_to_city(city_name, other_city, "west")
|
||||
to_ = f'roadm {city_name}'
|
||||
subdata += connect_eqpt(from_, in_, to_)
|
||||
return subdata
|
||||
|
||||
|
||||
def connect_eqpt(from_, in_, to_):
|
||||
connections = []
|
||||
if in_ != '':
|
||||
connections = [{'from_node': from_, 'to_node': in_},
|
||||
{'from_node': in_, 'to_node': to_}]
|
||||
else:
|
||||
connections = [{'from_node': from_, 'to_node': to_}]
|
||||
return connections
|
||||
|
||||
|
||||
def eqpt_in_city_to_city(in_city, to_city, direction='east'):
|
||||
rev_direction = 'west' if direction == 'east' else 'east'
|
||||
return_eqpt = ''
|
||||
if in_city in eqpts_by_city:
|
||||
for e in eqpts_by_city[in_city]:
|
||||
if nodes_by_city[in_city].node_type.lower() == 'roadm':
|
||||
if e.to_city == to_city:
|
||||
return_eqpt = f'{direction} edfa in {e.from_city} to {e.to_city}'
|
||||
elif nodes_by_city[in_city].node_type.lower() == 'ila':
|
||||
if e.to_city != to_city:
|
||||
direction = rev_direction
|
||||
return_eqpt = f'{direction} edfa in {e.from_city} to {e.to_city}'
|
||||
elif nodes_by_city[in_city].node_type.lower() == 'ila':
|
||||
return_eqpt = f'{direction} edfa in {in_city}'
|
||||
if nodes_by_city[in_city].node_type.lower() == 'fused':
|
||||
return_eqpt = f'{direction} fused spans in {in_city}'
|
||||
return return_eqpt
|
||||
|
||||
|
||||
def corresp_next_node(network, corresp_ila, corresp_roadm):
|
||||
""" for each name in corresp dictionnaries find the next node in network and its name
|
||||
given by user in excel. for meshTopology_exampleV2.xls:
|
||||
user ILA name Stbrieuc covers the two direction. convert.py creates 2 different ILA
|
||||
with possible names (depending on the direction and if the eqpt was defined in eqpt
|
||||
sheet)
|
||||
- east edfa in Stbrieuc to Rennes_STA
|
||||
- west edfa in Stbrieuc to Rennes_STA
|
||||
- Edfa0_fiber (Lannion_CAS → Stbrieuc)-F056
|
||||
- Edfa0_fiber (Rennes_STA → Stbrieuc)-F057
|
||||
next_nodes finds the user defined name of next node to be able to map the path constraints
|
||||
- east edfa in Stbrieuc to Rennes_STA next node = Rennes_STA
|
||||
- west edfa in Stbrieuc to Rennes_STA next node Lannion_CAS
|
||||
|
||||
Edfa0_fiber (Lannion_CAS → Stbrieuc)-F056 and Edfa0_fiber (Rennes_STA → Stbrieuc)-F057
|
||||
do not exist
|
||||
the function supports fiber splitting, fused nodes and shall only be called if
|
||||
excel format is used for both network and service
|
||||
"""
|
||||
next_node = {}
|
||||
# consolidate tables and create next_node table
|
||||
for ila_key, ila_list in corresp_ila.items():
|
||||
temp = copy(ila_list)
|
||||
for ila_elem in ila_list:
|
||||
# find the node with ila_elem string _in_ the node uid. 'in' is used instead of
|
||||
# '==' to find composed nodes due to fiber splitting in autodesign.
|
||||
# eg if elem_ila is 'Edfa0_fiber (Lannion_CAS → Stbrieuc)-F056',
|
||||
# node uid 'Edfa0_fiber (Lannion_CAS → Stbrieuc)-F056_(1/2)' is possible
|
||||
correct_ila_name = next(n.uid for n in network.nodes() if ila_elem in n.uid)
|
||||
temp.remove(ila_elem)
|
||||
temp.append(correct_ila_name)
|
||||
ila_nd = next(n for n in network.nodes() if ila_elem in n.uid)
|
||||
next_nd = next(network.successors(ila_nd))
|
||||
# search for the next ILA or ROADM
|
||||
while isinstance(next_nd, (Fiber, Fused)):
|
||||
next_nd = next(network.successors(next_nd))
|
||||
# if next_nd is a ROADM, add the first found correspondance
|
||||
for key, val in corresp_roadm.items():
|
||||
# val is a list of possible names associated with key
|
||||
if next_nd.uid in val:
|
||||
next_node[correct_ila_name] = key
|
||||
break
|
||||
# if next_nd was not already added in the dict with the previous loop,
|
||||
# add the first found correspondance in ila names
|
||||
if correct_ila_name not in next_node.keys():
|
||||
for key, val in corresp_ila.items():
|
||||
# in case of splitted fibers the ila name might not be exact match
|
||||
if [e for e in val if e in next_nd.uid]:
|
||||
next_node[correct_ila_name] = key
|
||||
break
|
||||
|
||||
corresp_ila[ila_key] = temp
|
||||
return corresp_ila, next_node
|
||||
|
||||
|
||||
def fiber_dest_from_source(city_name):
|
||||
destinations = []
|
||||
links_from_city = links_by_city[city_name]
|
||||
for l in links_from_city:
|
||||
if l.from_city == city_name:
|
||||
destinations.append(l.to_city)
|
||||
else:
|
||||
destinations.append(l.from_city)
|
||||
return destinations
|
||||
|
||||
|
||||
def fiber_link(from_city, to_city):
|
||||
source_dest = (from_city, to_city)
|
||||
links = links_by_city[from_city]
|
||||
link = next(l for l in links if l.from_city in source_dest and l.to_city in source_dest)
|
||||
if link.from_city == from_city:
|
||||
fiber = f'fiber ({link.from_city} \u2192 {link.to_city})-{link.east_cable}'
|
||||
else:
|
||||
fiber = f'fiber ({link.to_city} \u2192 {link.from_city})-{link.west_cable}'
|
||||
return fiber
|
||||
|
||||
|
||||
def midpoint(city_a, city_b):
|
||||
lats = city_a.latitude, city_b.latitude
|
||||
longs = city_a.longitude, city_b.longitude
|
||||
try:
|
||||
result = {
|
||||
'latitude': sum(lats) / 2,
|
||||
'longitude': sum(longs) / 2
|
||||
}
|
||||
except TypeError:
|
||||
result = {
|
||||
'latitude': 0,
|
||||
'longitude': 0
|
||||
}
|
||||
return result
|
||||
|
||||
# TODO get column size automatically from tupple size
|
||||
|
||||
|
||||
NODES_COLUMN = 10
|
||||
NODES_LINE = 4
|
||||
LINKS_COLUMN = 16
|
||||
LINKS_LINE = 3
|
||||
EQPTS_LINE = 3
|
||||
EQPTS_COLUMN = 14
|
||||
ROADMS_LINE = 3
|
||||
ROADMS_COLUMN = 3
|
||||
|
||||
|
||||
def _do_convert():
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('workbook', type=Path)
|
||||
parser.add_argument('-f', '--filter-region', action='append', default=[])
|
||||
parser.add_argument('--output', type=Path, help='Name of the generated JSON file')
|
||||
args = parser.parse_args()
|
||||
res = convert_file(args.workbook, args.filter_region, args.output)
|
||||
print(f'XLS -> JSON saved to {res}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
_do_convert()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user