NCDF, NC (AMBER NetCDF trajectory)¶
AMBER binary trajectories are automatically recognised by the file extension “.ncdf”. The NCDF module uses
scipy.io.netcdf and therefore
scipy must be installed.
Units are assumed to be the following default AMBER units:
Currently, if other units are detected, MDAnalysis will raise a
NCDF files are always written out in ångström and picoseconds.
Although scale_factors can be read from NCDF files, they are not kept or used when writing NCDF files out.
Writing with the netCDF4 module and potential issues
scipy.io.netcdfis very fast at reading NetCDF files, it is slow at writing them out. The netCDF4 package is fast at writing (but slow at reading). This requires the compiled netcdf library to be installed. MDAnalysis tries to use
netCDF4for writing if it is available, but will fall back to
scipy.io.netcdfif it is not.
AMBER users might have a hard time getting netCDF4 to work with a conda-based installation (as discussed in Issue #506) because of the way that AMBER itself handles netcdf. In this scenario, MDAnalysis will simply switch to the scipy package. If you encounter this error and wish to use the the faster
netCDF4writer, the only solution is to unload the AMBER environment.