Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
lfmformat.py
Go to the documentation of this file.
1#!/usr/bin/python3
2
3import pytools as pt
4import numpy as np
5import sys
6
7infile = sys.argv[1]
8
9f = pt.vlsvfile.VlsvReader(infile)
10
11coords = f.get_ionosphere_node_coords()
12print(np.shape(coords))
13lat = np.arctan2(coords[:,2], np.sqrt(coords[:,1]*coords[:,1] + coords[:,0]*coords[:,0]))
14lon = np.arctan2(coords[:,1], coords[:,0])
15phi = f.read_ionosphere_variable("ig_potential");
16
17for i in range(len(lat)):
18 if np.cos(lon[i]) > 0.02:
19 print(str(lat[i]) + " " + str(lon[i]) + " " + str(phi[i]) + " " + str(phi[i] / np.cos(lon[i])))