Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDF to HDF5 Example not Working? #5

Open
ax3l opened this issue Mar 1, 2019 · 13 comments
Open

GDF to HDF5 Example not Working? #5

ax3l opened this issue Mar 1, 2019 · 13 comments
Assignees
Labels
question Further information is requested

Comments

@ax3l
Copy link
Member

ax3l commented Mar 1, 2019

Hi @KseniaBastrakova,

@ChristopherMayes tries to use the example script and it seems not to work. Can you please assist him? I can confirm the error he reports when trying the examples.

Thanks, Axel

 $python gdf_to_hdf.py examples/example_1.gdf examples/example_1.h5
Destination .hdf directory not specified. Defaulting to examples/example_1.hdf
Converting .gdf to .hdf file
unknown datatype of value
name= b'\x00\x00\x00\x00x\x00\xc5\xb9\xfe\x7f\x00\x00'
type= 32766
size= 2051
unknown datatype of value
name= b'\x00\x00\x00\x00x\x00\xc5\xb9\xfe\x7f\x00\x00'
type= 32766
size= 2051
Traceback (most recent call last):
  File "gdf_to_hdf.py", line 589, in <module>
    main(file_names)
  File "gdf_to_hdf.py", line 584, in main
    converter(gdf_path, hdf_path)
  File "gdf_to_hdf.py", line 577, in converter
    gdf_to_hdf(gdf_file, hdf_file)
  File "gdf_to_hdf.py", line 551, in gdf_to_hdf
    gdf_file_to_hdf_file(gdf_file, hdf_file)
  File "gdf_to_hdf.py", line 487, in gdf_file_to_hdf_file
    add_positionOffset(subparticles_group, size)
  File "gdf_to_hdf.py", line 431, in add_positionOffset
    positionOffset_group = particles_group.require_group('positionOffset')
AttributeError: 'NoneType' object has no attribute 'require_group'
@ax3l ax3l added the question Further information is requested label Mar 1, 2019
@ax3l
Copy link
Member Author

ax3l commented Mar 1, 2019

@ChristopherMayes whats the version of h5py you are using? python -c "import h5py; print(h5py.__version__)"

My software environment:

  • HDF 1.8.15
  • h5py 2.7.1
  • 64bit Linux (Debian 9)
  • Python 3.6.7

@KseniaBastrakova
Copy link
Collaborator

Thanks for bug report. I could reproduce it. Working on a fix.

@ChristopherMayes
Copy link

I have:
HDF5: 1.10.4
h5py: 2.9.0
macOS Mojave (latest)
python 3.6.8

@KseniaBastrakova
Copy link
Collaborator

Fixed

@ChristopherMayes
Copy link

It runs, but does not create the output file (test.h5):
python gdf_to_hdf.py examples/example_1.gdf test.h5

Also, I had to add .py to the name of the script. The README has:
python gdf_to_hdf examples/example_1.gdf examples/example_1.h5

@KseniaBastrakova
Copy link
Collaborator

KseniaBastrakova commented Mar 1, 2019

oops) now, it should work

@ax3l

This comment has been minimized.

@ChristopherMayes
Copy link

Okay, looks like it works now. And, it works on my own gpt files.

However, it doesn't look like the units are right for momentum. What units are they supposed to be? From what I can tell, momentum/x is being set to gamma*beta_x, which is dimensionless.

MKS units should be kgm/s, with a proper factor to convert p_x = massc_lightgammabeta_x

@ax3l ax3l changed the title Example not Working? GDF to HDF5 Example not Working? Mar 2, 2019
@ax3l
Copy link
Member Author

ax3l commented Mar 2, 2019

How are the origin units in the GDF file again? Are they CGS, Lorentz-Heaviside CGS or something different? Looks like we add proper dimension meta data but don't scale unitSI accordingly yet.

@ChristopherMayes
Copy link

GPT normally records relativistic gamma and beta vector components, labeled:
G Bx By Bz

Proper momentum/x would be:
mass cLight G Bx

For an electron, m_e c = 2.73092449 *10^-22 kg * m / s

@ax3l
Copy link
Member Author

ax3l commented Mar 2, 2019

Excellent, that's just what we have to put in unitSI.

@KseniaBastrakova for particles, the particleName/ group seems to be still missing when I run the GDF to HDF5 converter. Can you please run the validator after adding it to verify?

During convert, we can either keep unitSI to 1.0 and convert each momentum with each given mass, since we copy the data anyway, or we sort out by same-mass to create individual particle species and put m_species c in the unitSI.

@KseniaBastrakova
Copy link
Collaborator

Thanks for bug report. I could reproduce it. Working on a fix.

@KseniaBastrakova
Copy link
Collaborator

Fixed. I added m_species c in the unitSI. And for parclename/ i implemented classification into electrons, protons and electrons. (As advice by @BeyondEspresso)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants