When I run a simple yt code, I run into the error message"ValueError: byte must be in range(0, 256) "
It was happen at "yt\data_objects\static_output.py", line 249, in unique_identifier,name_as_bytes =bytearray(map(ord, self.parameter_filename)), and then I went to the source code to see what happen. Although I tried to find the problem, I had no idea why the array would become so large.
I used ramses to produce the outputfile,info_00001.txt.
Here is my code:
import numpy as np
import matplotlib.pyplot as plt
# loading the snapshot
ds = yt.load("info_00001.txt") ##it is ramses output
ad = ds.all_data()
# reading particle positions and velocities into numpy arrays
pos = ad['particle_position']
vel = ad['particle_velocity']
# visualizing particle positions (ugly way)
plt.scatter(pos[:,0], pos[:,1], s=0.001)
# writing particle positions to a csv file, which can be read
# into datashader
f = open('pos.csv', 'w')
for i in pos:
f.write('%f,%f,%f\n' % (i, i, i))