This Python script generates a Dense Wavelength Division Multiplexing (DWDM) table and provides utilities for frequency and wavelength conversions based on the ITU grid. It supports custom configurations, including center frequency, slice width, and granularity.
- Generate a DWDM table with
n, frequency, wavelength, and ITU channel mappings. - Convert
nto frequency andmto bandwidth. - Convert frequency to
nand width tom. - Mark frequencies with their corresponding ITU channel (if available).
- Save results to a CSV file.
- Python 3.6 or later
- Clone the repository:
git clone https://github.com/devfilipe/wdm.git
- Navigate to the project directory:
cd wdm
The script provides several command-line options:
| Argument | Description |
|---|---|
--generate-table |
Generate the DWDM table and save it to a CSV file. |
--center-freq |
Center frequency in THz (default: 193.1). |
--min-freq |
Minimum frequency in THz (default: 191.150). |
--max-freq |
Maximum frequency in THz (default: 196.300). |
--slice-width |
Slice width in GHz (default: 6.25 GHz). |
--granularity |
Granularity in GHz (default: 12.5 GHz). |
--to-freq-width |
Convert n to frequency and m to width. |
--to-n-m |
Convert frequency to n and width to m. |
--output-file |
Output file name (default: output.csv). |
To generate a DWDM table and save it as output.csv:
python wdm.py --generate-table --output-file output.csvTo calculate frequency and bandwidth for a given n and m:
python wdm.py --to-freq-width 10 4To calculate n and m from a frequency and width:
python wdm.py --to-n-m 193.1 50The generated CSV file contains the following columns:
- n: Index relative to the center frequency.
- Frequency (GHz): Frequency in GHz.
- Wavelength (nm): Wavelength in nanometers.
- m=1 to m=12: Frequency ranges based on
mvalues. - ITU Channel: ITU channel name or
N/Aif no match is found.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Feel free to submit issues or pull requests.