CSDM Implementations

EasyNMR

CSDM is the native data model of EasyNMR. EasyNMR supports import of many other file formats, which are internally transformed into CSDM.

SIMPSON implementation

SIMPSON uses its own file format, which is specific to NMR. We have built in converters for CSDM while maintaining the original file format, so most of the CSDM features are supported in SIMPSON, however with the following limitations The implementation is done through a Tcl library csdm-1.0 that may be loaded into SIMPSON. The library relies on various libraries from tcllib, which must also be installed. To load the CSDM functionality into SIMPSON, do the following
lappend ::auto_path /path/to/tcllib ./csdm-1.0
package require csdm
...
in the top of your SIMPSON input file. The EasyNMR implementation of SIMPSON already has loaded the required libraries. We're still debugging the Tcl library, so please provide feedback if you experience any problems.

SIMPSON example

The original SIMPSON file format has some limitations. For example, it is only possible to assign one dimension type (fid or spe), even to a two-dimensional spectrum. In addition, if you have a dimension that is not linearly sampled, the SIMPSON format fail to store this correctly. With CSDM this is solved, so if you wish to create an empty 2D dataset that is in frequency domain in the first dimension and monotonic increasing time domain in the second domain, this can be achieved by the command
set f [fcreate                                           \
  -dimensions.0.count         1024                       \
  -dimensions.0.type          "linear"                   \
  -dimensions.0.quantity_name "frequency"                \
  -dimensions.0.increment     "1 Hz"                     \
  -dimensions.1.type          "monotonic"                \
  -dimensions.1.quantity_name "time"                     \
  -dimensions.1.coordinates   {"0 s" "1 s" "5 s" "10 s"} \
]

SIMPSON commands with additional functionality

The SIMPSON implementation is still under development. For the time being, please only use time or frequency as the quantity name and only give the numbers in s (seconds) or Hz, as we haven't implemented a full quantity parser in SIMPSON. List of commands with additional functionality.
CommandOptionsDescription
fload<filename> ?-nmrpipe|<index>?If the option -nmrpipe is specified, the file is interpreted assuming NMRPipe format. Otherwise, file extensions .spe and .fid are used for files in native SIMPSON format, and .csdf and .csdfe indicate that the file is of the CSDM format.
fcreate?-type|-sw|...|<CSDM options>?This command can be used in the original way by specifying the number of points, spectral width, etc. Or it can be used by specifying the relevant CSDM attributes. These are given using the convention -key1.key2.key3..., e.g. fcreate -dimensions.0.type linear -dimensions.0.increment "1 Hz" -dimensions.0.origin_offset "130 MHz" -dimensions.0.quantity_name frequency -dependent_variables.0.type "internal". Remember that all quantities have units.
fget?-sw|-np|-ref|-type|-ni|-sw1|-ref1|<CSDM options>?The first options are the original SIMPSON options. The CSDM options are specified as for fcreate. For example, fget $f -dimensions.0.reciprocal.coordinates_offset or fget $f -dependent_variables.0.components_url.
fset?-sw|-ref|-type|-sw1|-ref1|<CSDM options>?The first options are the original SIMPSON options. The CSDM options are specified as for fcreate. The SIMPSON and CSDM options are mutually exclusive and cannot be mixed in one call.
fsave<desc> <filename> ?-nmrpipe|-binary?*Apart from the standard SIMPSON options to save in binary or NMRPipe format, SIMPSON now allows saving directly in CSDM format. If the filename extension is .csdf(e), the file will be saved as in CSDM format. Otherwise in SIMPSON format.
*fsave also supports a couple of other non-documented options for reasons of backwards compatibility, so don't worry if you see other parameters. They are still supported.


The following commands change the spectral parameters and are updated to handle CSDM files. See the status below
CommandImplementedWorkingComment
fcreate😀😀Supports CSDM.
fload😀😀Supports CSDM.
fget😀😀Supports CSDM.
fset😀😀Supports CSDM.
fsave😀😀Supports CSDM.
fsimpson😀😀Establishes CSDM attributes.
funload😀😀Removes the CSDM attributes .
fdup😀😀Copy CSDM attributes to new spectrum.
fdupzero😀😀Copy CSDM attributes to new spectrum.
fextract😀😀Supports CSDM.
fzerofill😀😀Update CSDM.
shape2fid😀😀Supports CSDM.
fnewnp😀😀Update CSDM.
fft😀😀Update CSDM attributes.
fft1d😡😡Update CSDM attributes.
ftranspose😡😡Update CSDM attributes.
shape2fid😡😡Not yet implemented

😀: Fully implemented

😐: Partially implemented

😡: Not implemented

May 3 2021, Thomas Vosegaard