- edited description
- changed title to Data loading not compatibel with current default ramses
Data loading not compatibel with current default ramses
The files can’t be read due to having different formats. Problems the I ran into so far:
- The sink csv file has a 2-line header which is not handled.
- hydro_file_descriptor doesn’t have nvar in the beginning.
Comments (23)
-
reporter -
repo owner I'll take a look at loading files from the default
ramses
as soon as I get the chance. I apologise for this, but it has not been tested extensively on different versions of Ramses.I do see that it should however work, at least, with the default version of Ramses.
Thanks for reporting this
-
repo owner Hi again, would you be able to share with me the output file you are trying to read?
thanks!
-
reporter You can find the output here:
-
repo owner I’ve made some changes and I can now read the output but I’m getting some strange values inside my data structure, i.e. lots of NaNs.
This is what i get for the minimum and maximum values of the variables I’m managed to read in, ignoring the NaNs (i ignored the clump files for now). Can you tell me if they look reasonable to you?
The variables are: Name Type Group Unit Min Max cpu scalar amr [ ] 1.0 144.0 density scalar hydro [g/cm3] -2.590814480592104e-19 9.403217825405057e-20 dx scalar amr [au ] 12.589485263213746 201.43176421141993 dx_part scalar part [au ] 5.8114895568847656e+32 5.8114895568847656e+32 grav_acceleration vector grav [cm/s2] 0.0 0.0 grav_potential scalar grav [ ] 0.0 0.0 leaf scalar amr [ ] 1.0 1.0 level scalar amr [ ] 8.0 12.0 log_m scalar hydro [Msun ] -13.251771966089663 -5.888175219500674 log_r scalar amr [au ] 2.241658588151784 4.6481987685857415 log_rho scalar hydro [g/cm3] -26.390320249938537 -19.026723503349547 mass scalar hydro [Msun ] -2.589355650963699e-06 1.2936737933490275e-06 part_birth_time scalar part [ ] 0.007665897820163144 0.007665897820163144 part_family scalar part [ ] 3.0 3.0 part_identity scalar part [ ] -1.0 -1.0 part_levelp scalar part [ ] 8.0 8.0 part_mass scalar part [ ] 2.005908491097295e-08 2.005908491097295e-08 part_position vector part [ ] 44657.926383668935 44657.926383668935 part_tag scalar part [ ] 0.0 0.0 part_velocity vector part [cm/s ] 247824.19621764988 247824.19621764988 pressure scalar hydro [ ] 0.0 0.0 r scalar amr [au ] 174.4450249362059 44483.48135873273 velocity vector hydro [cm/s ] 10228.8857423029 226038493.70295852 x scalar amr [au ] -25758.086848535324 25758.086848535324 y scalar amr [au ] -25732.907878008897 25732.907878008893 z scalar amr [au ] -25732.907878008897 25732.907878008893
The negative density (-2.59e-19) is somewhat strange… I might still have a problem with reading in the values.
-
reporter -
repo owner I can make a map of the AMR level around the sink particle but i’m having problems with the densities…
The structure of the mesh looks reasonable, which tells me that usually the amr grid and the hydro variables have been read in properly. I will compare with
amr2cell
to see if there are also negative densities there -
repo owner ok thanks for the values from
pynbody
! -
reporter It should look something like this (made with amr2map)
-
repo owner I think i fixed it but it seems my picture is flipped upside down…
This is the image
and this is using contours that make a smoother picture
-
reporter Looks good! That the point of view is different doesn’t really matter.
-
repo owner I pushed the fixes and updated the
pip
package (should now be version 1.0.3). You might need to update yourpip
package if you installedosyris
that way before.Could you give it a go and tell me if it works for you? This is the script I used to make the figure above:
import osyris out14 = osyris.RamsesData(14, scale="pc", center="sink:1", verbose=True) # for the filled countours osyris.plot_slice(mydata.log_rho, direction="z", dx=0.02, resolution=512, fname="density_00014_contours.pdf") # for the classical image osyris.plot_slice(image=mydata.log_rho, direction="z", dx=0.02, resolution=512, interpolation="nearest", fname="density_00014_image.pdf")
You can also leave out the
fname
argument and plot directly if you are in an interactiveipython
console or ajupyter
notebook. -
reporter It’s working, thanks!
It doesn’t load your tutorial data anymore though. You might want to update that.
-
repo owner good point!
-
repo owner - changed status to resolved
Reading files from the default version of Ramses now works with version 1.0.3 on
pip
. See https://github.com/nvaytet/osyris/commit/f891d566845785a98dc2444c1169cd7c0771e023 -
repo owner Hi again, with
osyris
you can also slice at any orientation, not just along x, y, and z axes. In particular, you can use the average angular momentum vector around sink particles, to show either a disk around your sink (`top` view), or an outflow (`side` view):osyris.plot_slice(mydata.log_rho, direction="auto:top", dx=0.02, resolution=512, fname="top.pdf") osyris.plot_slice(mydata.log_rho, direction="auto:side", dx=0.02, resolution=512, fname="top.pdf")
-
reporter I know. That’s one of the reasons I wanted to try it out. It appears to be not so trivial in my case though.
What should I do if I have questions rather than bug reports?
-
repo owner Either email me, or I could add you to our slack workspace that I share with people from ENS Lyon & CEA Saclay who work on ramses
-
repo owner Hi again, i’m still not entirely convinced the velocity vectors look right. They all seem to be pointing in the same direction, not really pointing towards or away from the sink in a symmetrical way, as is usually the case around sink particles.
-
reporter That’s because the sink is moving. If you substract the sink velocity and plot this relative velocity, it looks more like you would expect.
-
reporter Sending you an email proved to be more difficult than I thought. Could you give me a working email adres? The one on your homepage gave me a delivery error in danish:)
-
repo owner oh, sorry i forgot about this.
Yes my university of Copenhagen email is no longer active because I know work in a different place.
You can use my personal address: neil.m.vaytet@gmail.com
-
repo owner Ah yes indeed:
mydata = osyris.RamsesData(nout=14, scale="au", center="sink:1", dx=2000, dy=2000, dz=2000) mydata.vector_field(name="vel_minus_sink",label="vel_minus_sink", values_x=mydata.velocity.x.values-mydata.sinks["vx"][0]*mydata.info["unit_l"]/mydata.info["unit_t"], values_y=mydata.velocity.y.values-mydata.sinks["vy"][0]*mydata.info["unit_l"]/mydata.info["unit_t"], values_z=mydata.velocity.z.values-mydata.sinks["vz"][0]*mydata.info["unit_l"]/mydata.info["unit_t"]) osyris.plot_slice(mydata.norm_dens, direction="z", vec=mydata.vel_minus_sink)
- Log in to comment