Merge branch 'master' into flux-tubes
This commit is contained in:
commit
9b3fcb3fe1
@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
||||
|
||||
setuptools.setup(
|
||||
name="amunpy",
|
||||
version="0.9.7",
|
||||
version="0.9.8",
|
||||
author="Grzegorz Kowal",
|
||||
author_email="grzegorz@amuncode.org",
|
||||
description="Python Interface for the AMUN code's snapshots",
|
||||
|
@ -21,6 +21,6 @@ __all__ = [ 'AmunXML', 'AmunH5', 'WriteVTK', \
|
||||
|
||||
__author__ = "Grzegorz Kowal"
|
||||
__copyright__ = "Copyright 2018-2022 Grzegorz Kowal <grzegorz@amuncode.org>"
|
||||
__version__ = "0.9.7"
|
||||
__version__ = "0.9.8"
|
||||
__maintainer__ = "Grzegorz Kowal"
|
||||
__email__ = "grzegorz@amuncode.org"
|
||||
|
@ -177,14 +177,18 @@ class Amun:
|
||||
"""
|
||||
Add derived variables.
|
||||
"""
|
||||
denflag = 'dens' in self.variables
|
||||
preflag = 'pres' in self.variables
|
||||
velflag = all(v in self.variables for v in ['velx','vely','velz'])
|
||||
magflag = all(v in self.variables for v in ['magx','magy','magz'])
|
||||
self.variables['refinement level'] = 'mlev'
|
||||
if 'dens' in self.variables:
|
||||
if denflag:
|
||||
self.variables['density'] = 'dens'
|
||||
self.variables['logarithm of density'] = 'logd'
|
||||
if 'pres' in self.variables or self.attributes['eos'] == 'iso':
|
||||
if preflag or self.attributes['eos'] == 'iso':
|
||||
self.variables['pressure'] = 'pres'
|
||||
self.variables['logarithm of pressure'] = 'logp'
|
||||
if all(v in self.variables for v in ['velx','vely','velz']):
|
||||
if velflag:
|
||||
self.variables['velocity'] = 'vvec'
|
||||
self.variables['velocity magnitude'] = 'velo'
|
||||
self.variables['x-velocity'] = 'velx'
|
||||
@ -196,7 +200,7 @@ class Amun:
|
||||
self.variables['z-vorticity'] = 'vorz'
|
||||
self.variables['vorticity'] = 'wvec'
|
||||
self.variables['vorticity magnitude'] = 'vort'
|
||||
if all(v in self.variables for v in ['magx','magy','magz']):
|
||||
if magflag:
|
||||
self.variables['magnetic field'] = 'bvec'
|
||||
self.variables['magnetic field magnitude'] = 'magn'
|
||||
self.variables['x-magnetic field'] = 'magx'
|
||||
@ -210,28 +214,25 @@ class Amun:
|
||||
self.variables['current density magnitude'] = 'curr'
|
||||
if 'bpsi' in self.variables:
|
||||
self.variables['magnetic divergence potential'] = 'bpsi'
|
||||
if 'pres' in self.variables and 'adiabatic_index' in self.attributes:
|
||||
if preflag and 'adiabatic_index' in self.attributes:
|
||||
self.variables['internal energy'] = 'eint'
|
||||
if all(v in self.variables for v in ['dens', 'pres']):
|
||||
if denflag and preflag:
|
||||
self.variables['temperature'] = 'temp'
|
||||
if self.attributes['eqsys'] in [ 'hd', 'mhd' ] \
|
||||
and all(v in self.variables for v in ['dens','velx','vely','velz']):
|
||||
if self.attributes['eqsys'] in ['hd','mhd'] and denflag and velflag:
|
||||
self.variables['kinetic energy'] = 'ekin'
|
||||
if self.attributes['eqsys'] in [ 'mhd', 'srmhd' ] \
|
||||
and all(v in self.variables for v in ['magx','magy','magz']):
|
||||
if self.attributes['eqsys'] in ['mhd','srmhd'] and magflag:
|
||||
self.variables['magnetic energy'] = 'emag'
|
||||
self.variables['magnetic pressure'] = 'emag'
|
||||
if all(v in self.variables for v in ['velx','vely','velz', 'magx','magy','magz']) in self.variables:
|
||||
if velflag and magflag:
|
||||
self.variables['electric field'] = 'evec'
|
||||
self.variables['electric field magnitude'] = 'elec'
|
||||
self.variables['x-electric field'] = 'elex'
|
||||
self.variables['y-electric field'] = 'eley'
|
||||
self.variables['z-electric field'] = 'elez'
|
||||
if self.attributes['eqsys'] in [ 'srhd', 'srmhd' ] \
|
||||
and all(v in self.variables for v in ['velx','vely','velz']):
|
||||
if self.attributes['eqsys'] in ['srhd','srmhd'] and velflag:
|
||||
self.variables['Lorentz factor'] = 'lore'
|
||||
|
||||
delete_datasets = [ 'dens', 'pres', 'velx', 'vely', 'velz', 'magx','magy','magz', 'bpsi' ]
|
||||
delete_datasets = ['dens','pres','velx','vely','velz','magx','magy','magz','bpsi']
|
||||
for v in delete_datasets:
|
||||
if v in self.variables:
|
||||
del self.variables[v]
|
||||
|
Loading…
x
Reference in New Issue
Block a user