dt = 0.2530

nlt = 2000

c = 2.5298
n0 = 0.625
rmassi = 100.0

ncx = 512
ncy = 2048

pbdx = 2.0
pbdy = 1.0

# map from code coordinate system to magnetotail coordiante system
# create labels
labels = {'bx':'B_z / B_0', 'by':'B_x / B_0', 'bz':'B_y / B_0',\
          'azint':'A_y / (B_0 d_i)',\
          'ex':'c E_z / (v_\mathrm{A} B_0)',\
          'ey':'c E_x / (v_\mathrm{A} B_0)',\
          'ez':'c E_y / (v_\mathrm{A} B_0)',\
          'epar':'c E_{\parallel} / (v_\mathrm{A} B_0)',\
          'cux':'J_z / (e n_0 v_\mathrm{A})',\
          'cuy':'J_x / (e n_0 v_\mathrm{A})',\
          'cuz':'J_y / (e n_0 v_\mathrm{A})',\
          'cuix':'J_{iz} / (e n_0 v_\mathrm{A})',\
          'cuiy':'J_{ix} / (e n_0 v_\mathrm{A})',\
          'cuiz':'J_{iy} / (e n_0 v_\mathrm{A})',\
          'cuex':'J_{ez} / (e n_0 v_\mathrm{A})',\
          'cuey':'J_{ex} / (e n_0 v_\mathrm{A})',\
          'cuez':'J_{ey} / (e n_0 v_\mathrm{A})',\
          'uix': 'u_{iz} / v_\mathrm{A}',\
          'uiy': 'u_{ix} / v_\mathrm{A}',\
          'uiz': 'u_{iy} / v_\mathrm{A}',\
          'uex': 'u_{ez} / v_\mathrm{A}',\
          'uey': 'u_{ex} / v_\mathrm{A}',\
          'uez': 'u_{ey} / v_\mathrm{A}',\
          'pixx': 'p_{i, zz} / (n_0 m_i v_\mathrm{A}^2)',\
          'piyy': 'p_{i, xx} / (n_0 m_i v_\mathrm{A}^2)',\
          'pizz': 'p_{i, yy} / (n_0 m_i v_\mathrm{A}^2)',\
          'pixy': 'p_{i, xz} / (n_0 m_i v_\mathrm{A}^2)',\
          'piyz': 'p_{i, xy} / (n_0 m_i v_\mathrm{A}^2)',\
          'pizx': 'p_{i, yz} / (n_0 m_i v_\mathrm{A}^2)',\
          'pexx': 'p_{e, zz} / (n_0 m_i v_\mathrm{A}^2)',\
          'peyy': 'p_{e, xx} / (n_0 m_i v_\mathrm{A}^2)',\
          'pezz': 'p_{e, yy} / (n_0 m_i v_\mathrm{A}^2)',\
          'pexy': 'p_{e, xz} / (n_0 m_i v_\mathrm{A}^2)',\
          'peyz': 'p_{e, xy} / (n_0 m_i v_\mathrm{A}^2)',\
          'pezx': 'p_{e, yz} / (n_0 m_i v_\mathrm{A}^2)',\
          'TrPi':r'\frac{1}{2}\mathrm{Tr}(\mathbf{P}_i) /(n_0 m_i v_\mathrm{A}^2)',\
          'TrPe':r'\frac{1}{2}\mathrm{Tr}(\mathbf{P}_e) /(n_0 m_i v_\mathrm{A}^2)',\
          'jedote':'\mathbf{J}_e\cdot\mathbf{E} / (n_0 m_i v_\mathrm{A}^2 \omega_{ci})',\
          'jidote':'\mathbf{J}_i\cdot\mathbf{E} / (n_0 m_i v_\mathrm{A}^2 \omega_{ci})',\
          'jdote':'\mathbf{J}\cdot\mathbf{E} / (n_0 m_i v_\mathrm{A}^2 \omega_{ci})',\
          'Ti':'T_i /(m_i v_\mathrm{A}^2)',\
          'Te':'T_e /(m_i v_\mathrm{A}^2)',\
          'Sx':'S_z / (n_0 m_i v_\mathrm{A}^3)',\
          'Sy':'S_x / (n_0 m_i v_\mathrm{A}^3)',\
          'Sz':'S_y / (n_0 m_i v_\mathrm{A}^3)',\
          'divpvi':r'(\nabla \cdot \mathbf{P}_i) \cdot \mathbf{v}_i', # / (n_0 m_i v_\mathrm{A}^2 \omega_{ci})
          'divpve':r'(\nabla \cdot \mathbf{P}_e) \cdot \mathbf{v}_e', # / (n_0 m_i v_\mathrm{A}^2 \omega_{ci})
          'ski':r'\mathbf{J}_i\cdot\mathbf{E} -(\nabla \cdot \mathbf{P}_i) \cdot \mathbf{v}_i', # / (n_0 m_i v_\mathrm{A}^2 \omega_{ci})
          'ske':r'\mathbf{J}_e\cdot\mathbf{E} -(\nabla \cdot \mathbf{P}_e) \cdot \mathbf{v}_e', # / (n_0 m_i v_\mathrm{A}^2 \omega_{ci})'}
          'enthalpy_flux_ix':'H_{iz} / (n_0 m_i v_\mathrm{A}^3)',\
          'enthalpy_flux_iy':'H_{ix} / (n_0 m_i v_\mathrm{A}^3)',\
          'enthalpy_flux_ex':'H_{ez} / (n_0 m_i v_\mathrm{A}^3)',\
          'enthalpy_flux_ey':'H_{ex} / (n_0 m_i v_\mathrm{A}^3)',\
          'kene_flux_ix':'K_i v_{iz} / (n_0 m_i v_\mathrm{A}^3)',\
          'kene_flux_iy':'K_i v_{ix} / (n_0 m_i v_\mathrm{A}^3)',\
          'kene_flux_ex':'K_e v_{ez} / (n_0 m_i v_\mathrm{A}^3)',\
          'kene_flux_ey':'K_e v_{ex} / (n_0 m_i v_\mathrm{A}^3)',\
          'kene_i':'K_i / (n_0 m_i v_\mathrm{A}^2)',\
          'kene_e':'K_e / (n_0 m_i v_\mathrm{A}^2)',\
          'qix':'Q_{iz} / (n_0 m_i v_\mathrm{A}^3)',\
          'qiy':'Q_{ix} / (n_0 m_i v_\mathrm{A}^3)',\
          'qiz':'Q_{iy} / (n_0 m_i v_\mathrm{A}^3)',\
          'qex':'Q_{ez} / (n_0 m_i v_\mathrm{A}^3)',\
          'qey':'Q_{ex} / (n_0 m_i v_\mathrm{A}^3)',\
          'qez':'Q_{ey} / (n_0 m_i v_\mathrm{A}^3)'}
# units = ion-based units / code units
eunits = 1.0 / (c * (n0 * rmassi)**0.5)
cuunits = (n0 / rmassi)**0.5
ddunits = n0
vunits = 1.0 / (n0 * rmassi)**0.5
tunits = 1.0 / (c * rmassi)
lunits = c * (rmassi / n0)**0.5
punits = n0 * vunits**2  # rmassi has been considered in the code
tempunits = vunits**2  # rmassi has been considered in the code
sunits = 1.0 / (n0 * rmassi)**0.5
divpvunits = punits / lunits * vunits
qunits = n0 * vunits**3  # rmassi has been considered in the code
units = {'time':tunits, 'length':lunits,\
    'bx':1, 'by':1, 'bz':1,\
    'azint':1,\
    'ex':eunits, 'ey':eunits, 'ez':eunits,\
    'cux':cuunits, 'cuy':cuunits, 'cuz':cuunits,\
    'cuix':cuunits, 'cuiy':cuunits, 'cuiz':cuunits,\
    'cuex':cuunits, 'cuey':cuunits, 'cuez':cuunits,\
    'ddi':ddunits, 'dde':ddunits,\
    'uix':vunits, 'uiy':vunits, 'uiz':vunits,\
    'uex':vunits, 'uey':vunits, 'uez':vunits,\
    'pixx':punits, 'piyy':punits, 'pizz':punits,\
    'pixy':punits, 'piyz':punits, 'pizx':punits,\
    'pexx':punits, 'peyy':punits, 'pezz':punits,\
    'pexy':punits, 'peyz':punits, 'pezx':punits,\
    'TrPi':punits, 'TrPe':punits,\
    'Ti':tempunits, 'Te':tempunits,\
    'Sx':sunits, 'Sy':sunits, 'Sz':sunits,\
    'divpvi':divpvunits, 'divpve':divpvunits,\
    'qix':qunits, 'qiy':qunits, 'qiz':qunits,\
    'qex':qunits, 'qey':qunits, 'qez':qunits}
# colormaps
cl_dict = {'bx':'bwr', 'by':'bwr', 'bz':'bwr',\
    'azint':'cubehelix_r',\
    'ex':'bwr', 'ey':'bwr', 'ez':'cubehelix_r',\
    'epar':'bwr',
    'cux':'bwr', 'cuy':'bwr', 'cuz':'cubehelix_r',\
    'cuix':'bwr', 'cuiy':'bwr', 'cuiz':'cubehelix_r',\
    'cuex':'bwr', 'cuey':'bwr', 'cuez':'cubehelix_r',\
    'uix':'bwr', 'uiy':'bwr', 'uiz':'cubehelix_r',\
    'uex':'bwr', 'uey':'bwr', 'uez':'cubehelix_r',\
    'pixx':'cubehelix_r', 'piyy':'cubehelix_r', 'pizz':'cubehelix_r',\
    'pixy':'bwr', 'piyz':'cubehelix_r', 'pizx':'cubehelix_r',\
    'pexx':'cubehelix_r', 'peyy':'cubehelix_r', 'pezz':'cubehelix_r',\
    'pexy':'bwr', 'peyz':'cubehelix_r', 'pezx':'cubehelix_r',\
    'TrPi':'cubehelix_r', 'TrPe':'cubehelix_r',\
    'jedote':'bwr', 'jidote':'bwr', 'jdote':'bwr',\
    'azint':'rainbow', 'Ti':'cubehelix_r', 'Te':'cubehelix_r',\
    'Sx':'bwr', 'Sy':'bwr', 'Sz':'bwr',\
    'divpvi':'bwr', 'divpve':'bwr',\
    'ski':'bwr', 'ske':'bwr',\
    'enthalpy_flux_ix':'bwr', 'enthalpy_flux_ex':'bwr',\
    'enthalpy_flux_iy':'bwr', 'enthalpy_flux_ey':'bwr',\
    'kene_flux_ix':'bwr', 'kene_flux_ex':'bwr',\
    'kene_flux_iy':'bwr', 'kene_flux_ey':'bwr',\
    'kene_i':'cubehelix_r', 'kene_e':'cubehelix_r',\
    'qix':'bwr', 'qiy':'bwr', 'qiz':'bwr',\
    'qex':'bwr', 'qey':'bwr', 'qez':'bwr'}
