Merge branch 'master' into reconnection

This commit is contained in:
Grzegorz Kowal 2022-10-06 13:10:59 -03:00
commit 2dcea97ee4
3 changed files with 13 additions and 5 deletions

View File

@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setuptools.setup( setuptools.setup(
name="amunpy", name="amunpy",
version="0.9.6", version="0.9.7",
author="Grzegorz Kowal", author="Grzegorz Kowal",
author_email="grzegorz@amuncode.org", author_email="grzegorz@amuncode.org",
description="Python Interface for the AMUN code's snapshots", description="Python Interface for the AMUN code's snapshots",

View File

@ -21,6 +21,6 @@ __all__ = [ 'AmunXML', 'AmunH5', 'WriteVTK', \
__author__ = "Grzegorz Kowal" __author__ = "Grzegorz Kowal"
__copyright__ = "Copyright 2018-2022 Grzegorz Kowal <grzegorz@amuncode.org>" __copyright__ = "Copyright 2018-2022 Grzegorz Kowal <grzegorz@amuncode.org>"
__version__ = "0.9.6" __version__ = "0.9.7"
__maintainer__ = "Grzegorz Kowal" __maintainer__ = "Grzegorz Kowal"
__email__ = "grzegorz@amuncode.org" __email__ = "grzegorz@amuncode.org"

View File

@ -181,8 +181,8 @@ class Amun:
if 'dens' in self.variables: if 'dens' in self.variables:
self.variables['density'] = 'dens' self.variables['density'] = 'dens'
self.variables['logarithm of density'] = 'logd' self.variables['logarithm of density'] = 'logd'
if 'pres' in self.variables: if 'pres' in self.variables or self.attributes['eos'] == 'iso':
self.variables['pressure'] = 'dens' self.variables['pressure'] = 'pres'
self.variables['logarithm of pressure'] = 'logp' self.variables['logarithm of pressure'] = 'logp'
if all(v in self.variables for v in ['velx','vely','velz']): if all(v in self.variables for v in ['velx','vely','velz']):
self.variables['velocity'] = 'vvec' self.variables['velocity'] = 'vvec'
@ -258,7 +258,15 @@ class Amun:
dset[p,...] = self.chunks[chunk_number]['levels'][p] dset[p,...] = self.chunks[chunk_number]['levels'][p]
elif dataset == 'logd': elif dataset == 'logd':
dset = numpy.log10(self.__read_binary_data__('dens', chunk_number)) dset = numpy.log10(self.__read_binary_data__('dens', chunk_number))
elif dataset == 'pres':
if self.attributes['eos'] == 'iso':
dset = self.__read_binary_data__('dens', chunk_number) * self.attributes['sound_speed']**2
else:
dset = self.__read_binary_data__('pres', chunk_number)
elif dataset == 'logp': elif dataset == 'logp':
if self.attributes['eos'] == 'iso':
dset = numpy.log10(self.__read_binary_data__('dens', chunk_number) * self.attributes['sound_speed']**2)
else:
dset = numpy.log10(self.__read_binary_data__('pres', chunk_number)) dset = numpy.log10(self.__read_binary_data__('pres', chunk_number))
elif dataset == 'velo': elif dataset == 'velo':
tmp = self.__read_binary_data__('velx', chunk_number) tmp = self.__read_binary_data__('velx', chunk_number)