rsfbpic/rsdata/read_field_hdf.py
def read_vector(path_to_file, field_name, field_coord, n_dump_str):
    """
    Read one component of a vector field from an HDF5 file.

    Assume 3 components (r,t,z) with openPMD conventions
    Assume 2D mesh of values (ie quasi-3D rz)
    Args:
        path_to_file: location of a specific HDF5 file
        field_name:   name of field in the HDF5 file
        field_coord:  field coordinate ('r','t', or 'z')
        n_dump_str:   dump number (as a string)
    Returns:
        field:     specified component of the field data
   """
    file = h5py.File(path_to_file,'r')
    data = file.get('data/')
    step = data.get(n_dump_str)
    all_fields = step.get('fields')
    my_field = all_fields.get(field_name)
    field_h5 = my_field.get(field_coord)
    field = field_h5[0,:,:]

    return field

    Read one component of a vector field from an HDF5 file.

    Assume 3 components (r,t,z) with openPMD conventions
    Assume 2D mesh of values (ie quasi-3D rz)
    Args:
        path_to_file: location of a specific HDF5 file
        field_name:   name of field in the HDF5 file
        field_coord:  field coordinate ('r','t', or 'z')
        n_dump_str:   dump number (as a string)
    Returns:
        field:     specified component of the field data
   
Read one component of a vector field from an HDF5 file.
Assume 3 components (r,t,z) with openPMD conventions
Assume 2D mesh of values
Read one component of a vector field from an HDF5 file . Assume 3 components ( r t z ) with openPMD conventions Assume 2D mesh of values
def read_vector(path_to_file, field_name, field_coord, n_dump_str):
    file = h5py.File(path_to_file,'r')
    data = file.get('data/')
    step = data.get(n_dump_str)
    all_fields = step.get('fields')
    my_field = all_fields.get(field_name)
    field_h5 = my_field.get(field_coord)
    field = field_h5[0,:,:]
    return field
def read_vector ( path_to_file , field_name , field_coord , n_dump_str ) : file = h5py . File ( path_to_file , 'r' ) data = file . get ( 'data/' ) step = data . get ( n_dump_str ) all_fields = step . get ( 'fields' ) my_field = all_fields . get ( field_name ) field_h5 = my_field . get ( field_coord ) field = field_h5 [ 0 , : , : ] return field
Read one component of a vector field from an HDF5 file.
Read one component of a vector field from an HDF5 file .
"""
    Read one component of a vector field from an HDF5 file.

    Assume 3 components (r,t,z) with openPMD conventions
    Assume 2D mesh of values (ie quasi-3D rz)
    Args:
        path_to_file: location of a specific HDF5 file
        field_name:   name of field in the HDF5 file
        field_coord:  field coordinate ('r','t', or 'z')
        n_dump_str:   dump number (as a string)
    Returns:
        field:     specified component of the field data
   """
specified component of the field data
specified component of the field data
field
path_to_file
location of a specific HDF5 file
location of a specific HDF5 file
field_name
name of field in the HDF5 file
name of field in the HDF5 file
field_coord
field coordinate ('r','t', or 'z')
field coordinate ( ' r ' ' t ' or ' z ' )
n_dump_str
dump number (as a string)
dump number ( as a string )