- Notifications
You must be signed in to change notification settings - Fork2
Calculation of geomagnetically induced currents in the Dutch powergrid
License
outfrenk/Dutch_GIC
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Calculation of geomagnetically induced currents in the Dutch powergrid. Details about the calculations can be found inside the code. The 'ods' and 'csv' files in the network folder contain the information about the Dutch (+German/Belgian) powergrid.
Clone the git repository
> git clone https://github.com/outfrenk/Dutch_GIC
Go to the (new) Dutch_GIC directory
>cd Dutch_GIC
Install the package
> pip install.
The raw data used during research can also be found in the data folder
An example of how to run the code (dutchgic.py) can be found in the 'usage class GIC' jupyter notebook or for a complete jupyter notebook in 'Class_GIC_notebook.ipynb' in the notebooks folder. The logbook.log in the logbook folder contains details about running the code.
To import the code, use the command:
> from Dutch_GIC.dutchgic import GIC
You can test the code using pytest as well.
However, change the string in test_code.py in the tests folder (in function test_init()) to the location where you store your csv files (spreadsheetcables.csv and spreadsheettrafo.csv) before running.
Then run
> pytest
This class depends on a couple of packages:
- numpy
- re
- os
- pandas
- logging
- multiprocessing
- threading
- scipy
- urllib
- datetime
- matplotlib
- pySECS (instructions and download athttps://github.com/greglucas/pySECS)
The functions all have a dependency on each other; some can be run alone, others need to be run with the function who called them. These dependent functions are indicated by @. If the function only push data towards a subfunction → is used. When a function pushes data towards a subfunction, but this subfunction pushes data back as well ↔ is used.
If we would run the functionrunall(), it would run the following functions:
standard_download()
a.→download_data()
b.↔find_quiet_data()
iteratestation()
a.→newplotspace()
magnetic_interpolation()
a. →magnetic_time()@
aa.↔mag_interpolate()@ NEEDS pySECS package here!
BtoE()
a.↔check_sampling()
b.↔Parzen()
c.↔filt()
d.↔transferfunction()
e.→writing_electric()@
calculate_GIC()
a.↔check_sampling()
b.→GICfunction()@
ba.↔ObtainJ()@ ↔calcE()@
plot_GIC()
a.↔check_sampling()
make_video()
There is also a GIC_index function (developed by Marshall et al., 2011). This function needs magnetic values frommagnetic_interpolation() to work. It usescheck_sampling() in the process.
You can send me a message to my emailadress