Functions for reading and writing Sparky (.ucsf) files.
This modules is imported as nmrglue.sparky and can be called as such.
| read(filename) | Read a Sparky file. |
| write(filename, dic, data[, overwrite]) | Write a Sparky file. |
| read_lowmem(filename) | Read a Sparky file using minimal memory. |
| write_lowmem(filename, dic, data[, overwrite]) | Write a Sparky using minimum amounts of memory (tile by tile) |
| make_uc(dic, data[, dim]) | Create a unit conversion object. |
| guess_udic(dic, data) | Guess parameter of universal dictionary from dic,data pair. |
| create_dic(udic[, datetimeobj, user]) | Create a Sparky parameter dictionary from universal dictionary. |
| datetime2dic(datetimeobj, dic) | Add datetime object to dictionary |
| dic2datetime(dic) | Create a datetime object from a Sparky dictionary |
Information on the Sparky file format can be found online at:
These functions are typically not used directly by users. Developers who want fine control over Sparky files may be interested in these functions.
| create_data(data) | Create a Sparky data array (recast into float32 array) |
| create_axisdic(adic, tlen, dlen) | Make an Sparky axis dictionary from a universal axis dictionary. |
| calc_tshape(shape[, kbyte_max]) | Calculate a tile shape from data shape. |
| read_2D(filename) | Read a 2D sparky file. See read() for documentation. |
| write_2D(filename, dic, data[, overwrite]) | Write a 2D Sparky file. See write() for documentation. |
| read_3D(filename) | Read a 3D Sparky file. See read() for documentation. |
| write_3D(filename, dic, data[, overwrite]) | Write a 3D Sparky file. See write() for documentation. |
| read_lowmem_2D(filename) | Read a 2D Sparky file using minimal memory. See read_lowmem(). |
| read_lowmem_3D(filename) | Read a 3D sparky file using minimal memory. See read_lowmem(). |
| get_tilen(f, n_tile, tw_tuple) | Read a tile from a Sparky file object. |
| get_tile(f, num_points) | Read the next tile from a Sparky file object. |
| put_tile(f, tile) | Put a tile to a Sparky file object. |
| get_data(f) | Read all data from sparky file object. |
| put_data(f, data) | Put data to a Sparky file object. |
| find_tilen_2d(data, ntile, (lentY, lentX)) | Return a tile from a 2D NMR data set. |
| tile_data2d(data, (lentY, lentX)) | Tile 2D data into a 1D array. |
| untile_data2D(data, (lentY, lentX), (lenY, lenX)) | Rearrange 2D Tiled/Sparky formatted data into standard format. |
| find_tilen_3d(data, ntile, (lentZ, lentY, lentX)) | Return a single tile from a 3D NMR data set. |
| tile_data3d(data, (lentZ, lentY, lentX)) | Tile 3D data into a 1D numpy array |
| untile_data3D(data, (lentZ, lentY, lentX), ...) | Rearrange 3D tiled/Sparky formatted data into standard format. |
| get_fileheader(f) | Get fileheader from file and return a list. |
| put_fileheader(f, fl) | Write fileheader list to file (180-bytes). |
| fileheader2dic(header) | Convert a fileheader list into a Sparky parameter dictionary. |
| dic2fileheader(dic) | Convert a Sparky parameter dictionary into a fileheader list. |
| get_axisheader(f) | Get an axisheader from file and return a list. |
| put_axisheader(f, al) | Write an axisheader list to file (128-bytes written). |
| axisheader2dic(header) | Convert an axisheader list into Sparky parameter axis dictionary. |
| dic2axisheader(dic) | Convert a Sparky parameter axis diction into a axisherder list. |