openPMD/openPMD-viewer

Can't access hdf5 files with openPMD on an external hard_drive

Closed this issue · 3 comments

When I try to access my h5 files with openpmd (specifically on an external harddrive) I get an error (see below). I don;t have this issue on the C:/ drive but obviously the files can be memory intensive.

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-4-9e837cfe409f> in <module>
----> 1 ts_2d = LpaDiagnostics('./example-2d/hdf5/')
      2 # ts_2d = LpaDiagnostics('./hdf5/')

~\Anaconda3\lib\site-packages\openpmd_viewer\addons\pic\lpa_diagnostics.py in __init__(self, path_to_dir, check_all_files)
     47         """
     48         OpenPMDTimeSeries.__init__( self, path_to_dir,
---> 49                                     check_all_files=check_all_files )
     50 
     51     def get_mean_gamma( self, t=None, iteration=None, species=None,

~\Anaconda3\lib\site-packages\openpmd_viewer\openpmd_timeseries\main.py in __init__(self, path_to_dir, check_all_files)
     63         """
     64         # Extract the files and the iterations
---> 65         self.h5_files, self.iterations = list_h5_files(path_to_dir)
     66 
     67         # Check that there are HDF5 files in this directory

~\Anaconda3\lib\site-packages\openpmd_viewer\openpmd_timeseries\utilities.py in list_h5_files(path_to_dir)
     73     """
     74     # Find all the files in the provided directory
---> 75     all_files = os.listdir(path_to_dir)
     76 
     77     # Select the hdf5 files

FileNotFoundError: [WinError 3] The system cannot find the path specified: './example-2d/hdf5/'

The LpaDiagnostics class inherits from the OpenPMDTimeSeries class, and therefore it also has the methods get_field, get_particle and slider. For instance:

Sorry for the late reply!

Quick question: Are you sure that the path that you provide is the correct one?
Could you do

!pwd
!ls ./example-2d/hdf5/

from your Jupyter notebook, just to check that the path is correct?

OK, good to know. Thanks for letting me know.
Should I close this issue for now?