36 Commits

Author SHA1 Message Date
f0ca778eb6 PYTHON: Fix subroutines to read integrals.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-03-11 11:53:06 -03:00
9a53103f14 PYTHON: Determine the maximum level from the blocks.
In some situations, the block refinement didn't reach the maximum level
available. There is no need to rescale all block to this level then.
Also the memory consumption in such case is significantly reduced.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-02-23 08:51:07 -03:00
76d7cf8826 IO, DRIVER, PYTHON: Fix domain block dimensions with job restart.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-02-21 15:58:38 -03:00
0ceca17a95 PYTHON: Add refinement 'level' to be read as dataset.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-02-18 11:27:47 -03:00
81b94a8009 PYTHON: Remove wrong condition in amun_compatible().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-02-18 11:11:16 -03:00
001748ff92 PYTHON: Support older snapshots with 'rdims'.
The new snapshots store 'domain_base_dims' instead.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-02-18 11:04:55 -03:00
eccc933c20 PYTHON: Check if the shrink parameter is correct.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-02-18 10:53:47 -03:00
e16fd94df7 PYTHON: Generate block dimensions using ndims and ncells.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-02-05 12:04:48 -02:00
d4059b8075 PYTHON: Read 'domain_base_dims' instead of 'rdims'.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-02-03 22:33:14 -02:00
a489837d63 Update copyright info.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2019-01-28 09:06:57 -02:00
a9123e466a PYTHON: Make sure indices are integers in rebin().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-11-07 12:10:28 -02:00
5b28e11182 PYTHON: Rewrite subroutine amun_dataset().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-11-06 12:45:07 -02:00
43e5b0b5f2 PYTHON: Rename amun_coordinates() to amun_coordinate().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-11-06 12:35:30 -02:00
5fa42b71cc PYTHON: Reorganize amun.py.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-11-06 12:34:39 -02:00
8eb5a2550a PYTHON: Add subroutine amun_coordinates() to retrive coordinate items.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-11-06 12:08:53 -02:00
d8b7e73b9f PYTHON: Rewrite amun_attribute().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-11-06 12:02:56 -02:00
25bbb78c63 PYTHON: Use amun_compatible() in all subroutines.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-11-06 11:37:29 -02:00
cbe94a21b6 PYTHON: Add amun_compatible() function.
This function returns True or False if the file is an HDF5 file
written in the AMUN code format.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-11-06 11:34:02 -02:00
444b78450e PYTHON: Add two subroutines to read integral (.dat) files.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-03-31 12:01:40 -03:00
d85d30ea28 PYTHON: Simplify variable conditions for temperature.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-02-01 10:32:09 -02:00
ee913e1a10 PYTHON: Add shrink parameter to amun_dataset().
The shrink parameter is an integer factor which is the power of 2 in the
range from 1 to the minimum dimension of the block size. For example, if
shrink = 2 than the output array will be halfed in each direction.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-30 17:28:20 -02:00
4602835b1c PYTHON: Add the magnitude of current density to derived datasets.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 11:05:38 -02:00
a9e15906d4 PYTHON: Add vorticity magnitude to derived datasets.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 11:02:58 -02:00
bfacf336eb PYTHON: Add the divergence of magnetic field to derived datasets.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 10:51:06 -02:00
24310ff8e2 PYTHON: Add the divergence of velocity to derived datasets.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 10:49:31 -02:00
a1c077e13e PYTHON: Add temperature to derived datasets.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 10:16:11 -02:00
4f614c2b8f PYTHON: Add Lorentz factor to derived datasets.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 10:10:15 -02:00
849fe3e88e PYTHON: Add velocity and magnetic field magnitudes.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 10:06:33 -02:00
938945a117 PYTHON: Add optional progress bar while reading a dataset.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 09:59:06 -02:00
6f76ec90fa PYTHON: Simplify repeat operation.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 09:40:54 -02:00
4e87e40689 PYTHON: Forgot to actually calculate the magnetic energy.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 09:33:41 -02:00
cab5d19d86 PYTHON: Add magnetic energy for MHD/SRMHD and total energy.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 09:30:39 -02:00
1d9f6e973b PYTHON: Add internal energy to derived variables.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 09:23:50 -02:00
6ed09fa33a PYTHON: Add kinetic energy to derived variables (only for HD or MHD).
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 09:16:08 -02:00
3be56b34db PYTHON: Read dataset with the ghost zones.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-18 09:03:27 -02:00
27f7e9038e Add the initial Python module to read data from AMUN's files.
So far only reading of HDF5 files is supported. Also only attributes and
datasets can be read. Datasets are rescaled to the efficient resolution
simply by replicating cell values.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2018-01-16 13:29:32 -02:00