Reading

nmrPype.nmrio.read.read(filename)

Read a NMRPipe file.

For standard multi-file 3D/4D NMRPipe data sets, filename should be a filemask (for example “/ft/test%03d.ft3”) with a “%” formatter. If only one file of a 3D/4D data set is provided only that 2D slice of the data is read (for example “/ft/test001.ft3” results in a 2D data set being read).

NMRPipe data streams stored as files (one file 3D/4D data sets made using xyz2pipe) can be read by providing the file name of the stream. The entire data set is read into memory.

An in memory binary stream (io.BytesIO) or bytes buffer containing an NMRPipe dataset can also be read.

Parameters:

filename (str | pathlib.Path | bytes | io.BytesIO) – Filename or filemask of NMRPipe file(s) to read. Binary io.BytesIO stream (e.g. open(filename, “rb”)) or bytes buffer can also be provided

Returns:

  • dic (dict) – Dictionary of NMRPipe parameters.

  • data (ndarray) – Array of NMR data.

See also

read_lowmem

NMRPipe file reading with minimal memory usage.

write

Write a NMRPipe data to file(s).

nmrPype.nmrio.read.read_1D(filename)

Read a 1D NMRPipe file.

See read() for documentation.

nmrPype.nmrio.read.read_2D(filename)

Read a 2D NMRPipe file or NMRPipe data stream.

See read() for documentation.

nmrPype.nmrio.read.read_3D(filemask)

Read a 3D NMRPipe file.

See read() for documentation.

nmrPype.nmrio.read.read_4D(filemask)

Read a 3D NMRPipe file.

See read() for documentation.

Notes

This function should not be used to read NMRPipe data streams stored in a single file (one file 3D/4D data sets made using xyz2pipe), read_2D() should be used.

nmrPype.nmrio.read.read_lowmem(filename)

Read a NMRPipe file with minimal memory usage.

See read() for Parameters and information.

Returns:

  • dic (dict) – Dictionary of NMRPipe parameters.

  • data (array_like) – Low memory object which can access NMR data on demand.

See also

read

Read NMRPipe files.

write_lowmem

Write NMRPipe files using minimal amounts of memory.

nmrPype.nmrio.read.read_lowmem_2D(filename)

Read a 2D NMRPipe file or NMRPipe data stream using minimal memory.

See read_lowmem() for documentation

nmrPype.nmrio.read.read_lowmem_3D(filemask)

Read a 3D NMRPipe file using minimal memory.

See read_lowmem() for documentation

nmrPype.nmrio.read.read_lowmem_4D(filemask)

Read a NMRPipe file using minimal memory.

See read_lowmem() for documentation

Notes

This function should not be used to read NMRPipe data streams stored in a single file (one file 3D/4D data sets made using xyz2pipe), read_lowmem_2D() should be used.

nmrPype.nmrio.read.read_lowmem_stream(filename)

Read a NMRPipe data stream using minimal memory.

See read_lowmem() for documentation.

nmrPype.nmrio.read.read_stream(filename)

Read a NMRPipe data stream (one file 3D or 4D files).

See read() for documentation.