ASSERTION ERROR ACCESSING RAMSES FIELDS

Hi, I am working on data from ramses and I have the following output files from my simulations: amr grav hydro part and info.txt However, when I try to make projection plots, I am obtaining the error: FutureWarning: Conversion of the second argument of issubdtype from `float`
to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
yt : [INFO ] 2018-01-19 16:31:46,982 Parameters: current_time = 0.254337758876396
yt : [INFO ] 2018-01-19 16:31:46,982 Parameters: domain_dimensions = [32 32 32]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: domain_left_edge = [0. 0. 0.]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: domain_right_edge = [1. 1. 1.]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: cosmological_simulation = 0
Traceback (most recent call last):
File "pyt.py", line 11, in <module>
p = yt.ProjectionPlot(ds, "x", "density")
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py", line 1441, in __init__
validate_mesh_fields(test_data_source, fields)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py", line 132, in validate_mesh_fields
canonical_fields = data_source._determine_fields(fields)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/data_objects/data_containers.py", line 1127, in _determine_fields
finfo = self.ds._get_field_info("unknown", fname)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/data_objects/static_output.py", line 711, in _get_field_info
self.index
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/data_objects/static_output.py", line 504, in index
self, dataset_type=self.dataset_type)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/frontends/ramses/data_structures.py", line 357, in __init__
super(RAMSESIndex, self).__init__(ds, dataset_type)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/geometry/geometry_handler.py", line 50, in __init__
self._setup_geometry()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/geometry/oct_geometry_handler.py", line 25, in _setup_geometry
self._initialize_oct_handler()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/frontends/ramses/data_structures.py", line 361, in _initialize_oct_handler
for i in range(self.dataset['ncpu'])]
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/frontends/ramses/data_structures.py", line 361, in <listcomp>
for i in range(self.dataset['ncpu'])]
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/frontends/ramses/data_structures.py", line 67, in __init__
self._read_amr_header()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/frontends/ramses/data_structures.py", line 191, in _read_amr_header
hvals.update(fpu.read_attrs(f, header))
File "/Users/samhitha/Documents/yt-conda/lib/python3.6/site-packages/yt/utilities/fortran_utils.py", line 86, in read_attrs
assert(s1 == s2)
AssertionError
I tried specifying the fields externally using: ds =
yt.load("/Users/xxxx/SIM001/output_00002/info_00002.txt",fields=["density", "velocity_x", "velocity_y", "velocity_z", "thermal_pressure", "var6", "var7"])
p = yt.ProjectionPlot(ds, "x", "density") PS: Rebooting the system didn't work in my case. Any help is greatly appreciated.

This is happening because the size of the AMR header is not the size we are expecting given the field list you passed into yt.load. Are you sure that the field list you are using is in the correct order? Is there any chance you can share a tarball containing the RAMSES output that triggers this error? We've recently had some substantial improvements for reading RAMSES data in the development version of yt. You might try installing yt from the git master branch and see if you get a more helpful error message or if the error goes away. -Nathan On Fri, Jan 19, 2018 at 12:23 PM, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Hi,
I am working on data from ramses and I have the following output files from my simulations: amr grav hydro part and info.txt
However, when I try to make projection plots, I am obtaining the error:
FutureWarning: Conversion of the second argument of issubdtype from
`float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
yt : [INFO ] 2018-01-19 16:31:46,982 Parameters: current_time = 0.254337758876396
yt : [INFO ] 2018-01-19 16:31:46,982 Parameters: domain_dimensions = [32 32 32]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: domain_left_edge = [0. 0. 0.]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: domain_right_edge = [1. 1. 1.]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: cosmological_simulation = 0
Traceback (most recent call last):
File "pyt.py", line 11, in <module>
p = yt.ProjectionPlot(ds, "x", "density")
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/visualization/plot_window.py", line 1441, in __init__
validate_mesh_fields(test_data_source, fields)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/visualization/plot_window.py", line 132, in validate_mesh_fields
canonical_fields = data_source._determine_fields(fields)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/data_objects/data_containers.py", line 1127, in _determine_fields
finfo = self.ds._get_field_info("unknown", fname)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/data_objects/static_output.py", line 711, in _get_field_info
self.index
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/data_objects/static_output.py", line 504, in index
self, dataset_type=self.dataset_type)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/frontends/ramses/data_structures.py", line 357, in __init__
super(RAMSESIndex, self).__init__(ds, dataset_type)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/geometry/geometry_handler.py", line 50, in __init__
self._setup_geometry()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/geometry/oct_geometry_handler.py", line 25, in _setup_geometry
self._initialize_oct_handler()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/frontends/ramses/data_structures.py", line 361, in _initialize_oct_handler
for i in range(self.dataset['ncpu'])]
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/frontends/ramses/data_structures.py", line 361, in <listcomp>
for i in range(self.dataset['ncpu'])]
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/frontends/ramses/data_structures.py", line 67, in __init__
self._read_amr_header()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/frontends/ramses/data_structures.py", line 191, in _read_amr_header
hvals.update(fpu.read_attrs(f, header))
File "/Users/samhitha/Documents/yt-conda/lib/python3.6/site- packages/yt/utilities/fortran_utils.py", line 86, in read_attrs
assert(s1 == s2)
AssertionError
I tried specifying the fields externally using:
ds = yt.load("/Users/xxxx/SIM001/output_00002/info_00002.txt",fields=["density",
"velocity_x", "velocity_y", "velocity_z", "thermal_pressure", "var6", "var7"])
p = yt.ProjectionPlot(ds, "x", "density")
PS: Rebooting the system didn't work in my case. Any help is greatly appreciated.
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org

Hi, I tried using the development version of yt from github, but it still seems to be giving the same error. Also, would you want me to send the fortran files in patch or the .outxxxx files? On Fri, 19 Jan 2018 at 10:02 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
This is happening because the size of the AMR header is not the size we are expecting given the field list you passed into yt.load.
Are you sure that the field list you are using is in the correct order?
Is there any chance you can share a tarball containing the RAMSES output that triggers this error?
We've recently had some substantial improvements for reading RAMSES data in the development version of yt. You might try installing yt from the git master branch and see if you get a more helpful error message or if the error goes away.
-Nathan
On Fri, Jan 19, 2018 at 12:23 PM, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Hi,
I am working on data from ramses and I have the following output files from my simulations: amr grav hydro part and info.txt
However, when I try to make projection plots, I am obtaining the error:
FutureWarning: Conversion of the second argument of issubdtype from
`float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
yt : [INFO ] 2018-01-19 16:31:46,982 Parameters: current_time = 0.254337758876396
yt : [INFO ] 2018-01-19 16:31:46,982 Parameters: domain_dimensions = [32 32 32]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: domain_left_edge = [0. 0. 0.]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: domain_right_edge = [1. 1. 1.]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: cosmological_simulation = 0
Traceback (most recent call last):
File "pyt.py", line 11, in <module>
p = yt.ProjectionPlot(ds, "x", "density")
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py", line 1441, in __init__
validate_mesh_fields(test_data_source, fields)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py", line 132, in validate_mesh_fields
canonical_fields = data_source._determine_fields(fields)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/data_objects/data_containers.py", line 1127, in _determine_fields
finfo = self.ds._get_field_info("unknown", fname)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/data_objects/static_output.py", line 711, in _get_field_info
self.index
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/data_objects/static_output.py", line 504, in index
self, dataset_type=self.dataset_type)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/frontends/ramses/data_structures.py", line 357, in __init__
super(RAMSESIndex, self).__init__(ds, dataset_type)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/geometry/geometry_handler.py", line 50, in __init__
self._setup_geometry()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/geometry/oct_geometry_handler.py", line 25, in _setup_geometry
self._initialize_oct_handler()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/frontends/ramses/data_structures.py", line 361, in _initialize_oct_handler
for i in range(self.dataset['ncpu'])]
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/frontends/ramses/data_structures.py", line 361, in <listcomp>
for i in range(self.dataset['ncpu'])]
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/frontends/ramses/data_structures.py", line 67, in __init__
self._read_amr_header()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site-packages/yt/frontends/ramses/data_structures.py", line 191, in _read_amr_header
hvals.update(fpu.read_attrs(f, header))
File "/Users/samhitha/Documents/yt-conda/lib/python3.6/site-packages/yt/utilities/fortran_utils.py", line 86, in read_attrs
assert(s1 == s2)
AssertionError
I tried specifying the fields externally using:
ds =
yt.load("/Users/xxxx/SIM001/output_00002/info_00002.txt",fields=["density", "velocity_x", "velocity_y", "velocity_z", "thermal_pressure", "var6", "var7"])
p = yt.ProjectionPlot(ds, "x", "density")
PS: Rebooting the system didn't work in my case. Any help is greatly appreciated.
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org

Hi again, the attached zip folder has one of my outputs. Thanks output_00002.zip <https://drive.google.com/file/d/1LR8dx4LzdbaAET6vvib32XGH8n75_q8t/view?usp=d...> On Mon, Jan 22, 2018 at 9:58 AM, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Hi,
I tried using the development version of yt from github, but it still seems to be giving the same error. Also, would you want me to send the fortran files in patch or the .outxxxx files?
On Fri, 19 Jan 2018 at 10:02 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
This is happening because the size of the AMR header is not the size we are expecting given the field list you passed into yt.load.
Are you sure that the field list you are using is in the correct order?
Is there any chance you can share a tarball containing the RAMSES output that triggers this error?
We've recently had some substantial improvements for reading RAMSES data in the development version of yt. You might try installing yt from the git master branch and see if you get a more helpful error message or if the error goes away.
-Nathan
On Fri, Jan 19, 2018 at 12:23 PM, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Hi,
I am working on data from ramses and I have the following output files from my simulations: amr grav hydro part and info.txt
However, when I try to make projection plots, I am obtaining the error:
FutureWarning: Conversion of the second argument of issubdtype from
`float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
yt : [INFO ] 2018-01-19 16:31:46,982 Parameters: current_time = 0.254337758876396
yt : [INFO ] 2018-01-19 16:31:46,982 Parameters: domain_dimensions = [32 32 32]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: domain_left_edge = [0. 0. 0.]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: domain_right_edge = [1. 1. 1.]
yt : [INFO ] 2018-01-19 16:31:46,983 Parameters: cosmological_simulation = 0
Traceback (most recent call last):
File "pyt.py", line 11, in <module>
p = yt.ProjectionPlot(ds, "x", "density")
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/visualization/plot_window.py", line 1441, in __init__
validate_mesh_fields(test_data_source, fields)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/visualization/plot_window.py", line 132, in validate_mesh_fields
canonical_fields = data_source._determine_fields(fields)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/data_objects/data_containers.py", line 1127, in _determine_fields
finfo = self.ds._get_field_info("unknown", fname)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/data_objects/static_output.py", line 711, in _get_field_info
self.index
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/data_objects/static_output.py", line 504, in index
self, dataset_type=self.dataset_type)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/frontends/ramses/data_structures.py", line 357, in __init__
super(RAMSESIndex, self).__init__(ds, dataset_type)
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/geometry/geometry_handler.py", line 50, in __init__
self._setup_geometry()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/geometry/oct_geometry_handler.py", line 25, in _setup_geometry
self._initialize_oct_handler()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/frontends/ramses/data_structures.py", line 361, in _initialize_oct_handler
for i in range(self.dataset['ncpu'])]
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/frontends/ramses/data_structures.py", line 361, in <listcomp>
for i in range(self.dataset['ncpu'])]
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/frontends/ramses/data_structures.py", line 67, in __init__
self._read_amr_header()
File "/Users/xxxx/Documents/yt-conda/lib/python3.6/site- packages/yt/frontends/ramses/data_structures.py", line 191, in _read_amr_header
hvals.update(fpu.read_attrs(f, header))
File "/Users/samhitha/Documents/yt-conda/lib/python3.6/site- packages/yt/utilities/fortran_utils.py", line 86, in read_attrs
assert(s1 == s2)
AssertionError
I tried specifying the fields externally using:
ds = yt.load("/Users/xxxx/SIM001/output_00002/info_00002.txt",fields=["density",
"velocity_x", "velocity_y", "velocity_z", "thermal_pressure", "var6", "var7"])
p = yt.ProjectionPlot(ds, "x", "density")
PS: Rebooting the system didn't work in my case. Any help is greatly appreciated.
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org

Hi, From what I see, it looks like the header of your simulation is not canonical. In particular, it looks like it's not dumping `mass_sph` into the `amr_xxxxx.outyyyyy` files. One way to fix this is to change the file `amr_output.f90`into (look at line ~265). In your case, it seems like you're missing the line `write(ilun) mass_sph`. open(unit=ilun,file=fileloc,form='unformatted') ! Write grid variables write(ilun)ncpu write(ilun)ndim write(ilun)nx,ny,nz write(ilun)nlevelmax write(ilun)ngridmax write(ilun)nboundary write(ilun)ngrid_current write(ilun)boxlen ! Write time variables write(ilun)noutput,iout,ifout write(ilun)tout(1:noutput) write(ilun)aout(1:noutput) write(ilun)t write(ilun)dtold(1:nlevelmax) write(ilun)dtnew(1:nlevelmax) write(ilun)nstep,nstep_coarse write(ilun)einit,mass_tot_0,rho_tot write(ilun)omega_m,omega_l,omega_k,omega_b,h0,aexp_ini,boxlen_ini write(ilun)aexp,hexp,aexp_old,epot_tot_int,epot_tot_old write(ilun)mass_sph ! Write levels variables write(ilun)headl(1:ncpu,1:nlevelmax) write(ilun)taill(1:ncpu,1:nlevelmax) write(ilun)numbl(1:ncpu,1:nlevelmax) The other way round is to add support for your case to yt, but for this we would need more information about your RAMSES version : do you use a patch, if so, what's the source code (amr_output.f90 is enough) and which version of RAMSES are you using ? Corentin

Hi, Thanks a ton for your responses. Apparently, it was the mass_sph parameter creating the issue and fixing it in yt has resolved it! On Mon, Jan 22, 2018 at 7:12 PM, Corentin CADIOU <contact@cphyc.me> wrote:
Hi,
From what I see, it looks like the header of your simulation is not canonical. In particular, it looks like it's not dumping `mass_sph` into the `amr_xxxxx.outyyyyy` files.
One way to fix this is to change the file `amr_output.f90`into (look at line ~265). In your case, it seems like you're missing the line `write(ilun) mass_sph`.
open(unit=ilun,file=fileloc,form='unformatted') ! Write grid variables write(ilun)ncpu write(ilun)ndim write(ilun)nx,ny,nz write(ilun)nlevelmax write(ilun)ngridmax write(ilun)nboundary write(ilun)ngrid_current write(ilun)boxlen ! Write time variables write(ilun)noutput,iout,ifout write(ilun)tout(1:noutput) write(ilun)aout(1:noutput) write(ilun)t write(ilun)dtold(1:nlevelmax) write(ilun)dtnew(1:nlevelmax) write(ilun)nstep,nstep_coarse write(ilun)einit,mass_tot_0,rho_tot write(ilun)omega_m,omega_l,omega_k,omega_b,h0,aexp_ini,boxlen_ini write(ilun)aexp,hexp,aexp_old,epot_tot_int,epot_tot_old write(ilun)mass_sph ! Write levels variables write(ilun)headl(1:ncpu,1:nlevelmax) write(ilun)taill(1:ncpu,1:nlevelmax) write(ilun)numbl(1:ncpu,1:nlevelmax)
The other way round is to add support for your case to yt, but for this we would need more information about your RAMSES version : do you use a patch, if so, what's the source code (amr_output.f90 is enough) and which version of RAMSES are you using ?
Corentin _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
participants (3)
-
Corentin CADIOU
-
Nathan Goldbaum
-
Vadlamani Samhitha