# README
CSV2B3D
CSV to B3D V4 converter written in Go. B3D is a binary format for Powerworld (TM) Simulator used to store time- and spatially-varying geoelectric field data. This assumes that latitude and longitude points are set on a uniform grid ranging between -180 and + 180 degrees. Non-uniform grids are currently not supported.
For more information on the B3D file format, refer to the PowerWorld (TM) documentation:
https://www.powerworld.com/knowledge-base/b3d-file-format
Running
To Build: go build csv2b3d.go
To Run: csv2b3d <csvfile> <b3dfile>
Batch Conversion: For an example of a PowerShell 7.x script to process a folder
of input CSV files in parallel, see Csv2B3d.ps1
Expected CSV Format
The input CSV file is expected to have a header line and data lines in the following order:
- Latitude (-180 to +180 degrees)
- Longitude (-180 to +180 degrees)
- West-East component of electric field
- South-North component of electric field
Example Input:
Lat(Deg),Lon(Deg),Ee(V/km),En(V/km)
0.0,0.0,-0.9956,0.9267
0.0,1.0,-0.1526,0.7598
0.0,2.0,-0.5288,0.3514
0.0,3.0,-0.0806,0.2324
0.0,4.0,-0.5321,0.2654
0.0,5.0,-0.7197,0.3807
0.0,6.0,-0.8127,0.3258
License
This code is provided under a BSD license as part of the Multi-Infrastructure Control and Optimization Toolkit (MICOT) project, LA-CC-13-108.