Navigation

  • index
  • modules |
  • next |
  • previous |
  • pninexus 3.0.3 documentation »
  • API documentation »
  • File related functions

File related functions¶

The pninexus.nexus package adds some useful wrapper functions around the native HDF5 functions.

pninexus.nexus.create_file(path, flags=AccessFlags.EXCLUSIVE, fcpl=FileCreationList(), fapl=FileAccessList())¶

A thin wrapper function around pninexus.h5cpp.file.create() HDF5 function. It not only creates the file but also creates the required attributes no the root group of the file. Using this function ensures that a file created with it will pass a test with is_nexus_file().

Parameters
  • path (str) – path to the file

  • flags (pninexus.h5cpp.file.AccessFlags) – HDF5 flags used to open the file

  • lcpl (pninexus.h5cpp.property.FileCreationList) – optional file creation list

  • lapl (pninexus.h5cpp.property.FileAccessList) – optional file access list

pninexus.nexus.open_file(path, flags=AccessFlags.READONLY, fapl=FileAccessList())¶

A thin wrapper function around pninexus.h5cpp.file.open().

Parameters
  • path (str) – path to the file

  • flags (pninexus.h5cpp.file.AccessFlags) – access flags used to open the file

  • lapl (pninexus.h5cpp.property.FileAccessList) – optional file access property list

pninexus.nexus.is_nexus_file(path)¶

Checks if the file referenced by path is a NeXus file. This function is more restrictive than pninexus.h5cpp.file.is_hdf5_file(). It not only checks whether or not the file is an HDF5 file but also whether all required attributes are set at the root group of the HDF5 file.

Parameters

path (str) – path to the file on the file system

Previous topic

pninexus.h5cpp.node

Next topic

Factory classes

Quick search

Versions

  • v:latest
  • v:stable
  • v3.0.3
  • v3.0.2
  • v3.0.1
  • v3.0.0
  • v2.0.0
  • v1.3.4

Navigation

  • index
  • modules |
  • next |
  • previous |
  • pninexus 3.0.3 documentation »
  • API documentation »
  • File related functions
© Copyright 2015, DESY. Created using Sphinx 3.4.3.