-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample_heatmaps.py
More file actions
68 lines (55 loc) · 2.24 KB
/
Copy pathExample_heatmaps.py
File metadata and controls
68 lines (55 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 13 16:49:17 2023
@author: Dean Thomas
"""
import os.path
from deltaB import loop_heatmapworld_ms, plot_heatmapworld_ms, \
loop_heatmapworld_iono, plot_heatmapworld_iono, \
loop_heatmapworld_gap, plot_heatmapworld_gap
#################################################################
#
# Example script for generating Bn (B north) heatmaps that show how
# Bn varies over the surface of the earth. Results are provided
# for the magnetosphere based on BATS-R-US data and for the gap region
# and the ionosphere based on RIM data.
#
#################################################################
# info tells the script where the data files are stored and where
# to save plots and calculated data
data_dir = '/Volumes/PhysicsHDv2/runs'
info = {
"model": "SWMF",
"run_name": "DIPTSUR2",
"rCurrents": 4.0,
"rIonosphere": 1.01725,
"file_type": "out",
"dir_run": os.path.join(data_dir, "DIPTSUR2"),
"dir_plots": os.path.join(data_dir, "DIPTSUR2.plots"),
"dir_derived": os.path.join(data_dir, "DIPTSUR2.derived"),
}
if __name__ == "__main__":
# Max/min of scale used in heatmaps
VMIN = -1500.
VMAX = 1500.
# We will plot the magnitude of the B field in a lat/long grid
# Define the grid size
NLAT = 9
NLONG = 12
# The times for the files that we will process to create heatmaps
TIMES = ((2019, 9, 2, 6, 30, 0),)
# Get a list of BATSRUS and RIM files, info parameters define location
# (dir_run) and file types. See definition of info = {...} above.
from magnetopost import util as util
util.setup(info)
# Calculate the delta B sums to get Bn contributions from
# various current systems in the magnetosphere, gap region, and
# the ionosphere over a lat-long grid
loop_heatmapworld_ms( info, TIMES, NLAT, NLONG )
loop_heatmapworld_iono( info, TIMES, NLAT, NLONG )
loop_heatmapworld_gap( info, TIMES, NLAT, NLONG )
# Create heatmaps plots of Bn over earth
plot_heatmapworld_ms( info, TIMES, VMIN, VMAX, NLAT, NLONG )
plot_heatmapworld_iono( info, TIMES, VMIN, VMAX, NLAT, NLONG )
plot_heatmapworld_gap( info, TIMES, VMIN, VMAX, NLAT, NLONG )