spike.v1 package — spike 0.99.8-407 documentation

# spike.v1 package

## Submodules

## spike.v1.Bruker module

## spike.v1.Generic module

This library implement the standard functions needed for NMR processing. Most of theese functions require that the NPK mathematical kernel is loaded.

`spike.v1.Generic.` `CosyToInadequate`()

  shearing operation that transform a “cosy” symmetry type experiment to a “Inadequate” one

`spike.v1.Generic.` `CosyToSecsy`()

  shearing operation that transform a “cosy” symmetry type experiment to a “secsy” one

class `spike.v1.Generic.` `Generic_Tests`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `announce`()
  `setUp`()
  `test_load`()

`spike.v1.Generic.` `InadequateToCosy`()

  shearing operation that transform a “Inadequate” symmetry type experiment to a “cosy” one

`spike.v1.Generic.` `JResTilt`()

  tilt operation that transform a JRes experiment to a symmetric one

`spike.v1.Generic.` `NPKtempfile`(ext='.npktmp')

  Standard tempfile module is VERY buggy in jython, the secure mkstemp is missing, and the basic system call needed to implement it are lacking. This is an attempt to make a “slightly” better tempfile than the jython built-in one.

  This seems to be enough to change it from really annoying to bearly noticiable…

`spike.v1.Generic.` `SecsyToCosy`()

  shearing operation that transform a “secsy” symmetry type experiment to a “cosy” one

`spike.v1.Generic.` `Symmetrize2D`(type='Cosy', algorithm='mean')

  realize the symmetrization of the current 2D available types are : Inadequate,Cosy, JRes available algorithm are : mean (X+Y)/2 , smallest value min(X,Y),

  > and continuous (XY^2+YX^2)/(X^2 + Y^2) (not for JRes)

`spike.v1.Generic.` `SymmetrizeCosy`(algorithm='mean')

  realize the symmetrization of COSY 2D available algorithm are : mean (X+Y)/2 , smallest value min(X,Y), continuous (XY^2+YX^2)/(X^2 + Y^2)

`spike.v1.Generic.` `SymmetrizeInadequate`(algorithm='mean')

  realize the symmetrization of INADEQUATE 2D available algorithm are : mean (X+Y)/2 , smallest value min(X,Y), continuous (XY^2+YX^2)/(X^2 + Y^2)

`spike.v1.Generic.` `SymmetrizeJRes`(algorithm='mean')

  realize the symmetrization of JRes 2D available algorithm are : mean (X+Y)/2 , smallest value min(X,Y)

`spike.v1.Generic.` `add_files`(list_of_files, list_of_coefficients=[])

  add a list of files weighted by the given coefficients

  if coefficients are lacking, no weighting is made

`spike.v1.Generic.` `ap2d`(apfunc, axis='F2')

  a 2D automatic phaser

  axis is : F1, F2 or F12 will peak pick the 2D, and apply the chose algo on sums of rows and columns

  MAD nov 2006

`spike.v1.Generic.` `aparm`()

  computes phase correction form a reconstruction of the beginning of the FID

`spike.v1.Generic.` `apmin`()

  automatic 1D phase correction phase by minimizing the negative wing of the spectrum

  MAD, oct 2006

`spike.v1.Generic.` `apmin2d`(axis='F2')

  a 2D version of apmin()

  axis is : F1, F2 or F12 will peak pick the 2D, and apply apmin on sums of rows and columns

  see also : apsl()

  MAD-VC july 2005

`spike.v1.Generic.` `apodise`(apod, axis='F1')

  apod is the function to be applied, it is a python callable sequence which realise the apodisation e.g. “sin(0)” “expbroad(10)” “sqsin(0);expbroad(3)” etc… (note the ; to separate several simple apodisations)

`spike.v1.Generic.` `apodise_f`(apod, axis='F1')

  apod is the function to be applied, it is a python callable sequence which realise the apodisation e.g. “sin(0)” “expbroad(10)” “sqsin(0),expbroad(3)” etc… (note the , to separate several simple apodisations)

  M-A D. march 2006

`spike.v1.Generic.` `apodise_p`(apod, axis='F1')

`spike.v1.Generic.` `apsl`()
  APSL method
    A.Heuer J.Magn.Reson. 91 p241 (1991)

  uses the data buffer

  > you may want to adapt :
  >   s_wdth : ration of line width to spectral width used for computing phases p_wdth : ration of line width to spectral width used for broadening for peak picking npk : minimum number of peaks needed for phasing nfrst : the number of peaks used for first approx

  see also : apsl2d() apsl_cp()

  MAD-VC, july 2005

`spike.v1.Generic.` `apsl2d`(axis='F2')

  a 2D version of apsl()

  axis is : F1, F2 or F12 will peak pick the 2D, and apply apsl on sums of rows and columns

  see also : apsl()

  MAD-VC july 2005

`spike.v1.Generic.` `apsl_cp`(pki, sz)

  computes the phase of the peak centered on i, using +/-sz points the phase of the peak is returned between -180 and 180 i has to be odd ! used by apsl to compute an automatic phase correction of a 1D spectrum

  see also : apsl()

  MAD-VC, july 2005

`spike.v1.Generic.` `auditinitial`(auditfilename='audit_trail.html', title='NPK Processing', append=1)

  initialize the audit trail file

  auditfilename is the name of the audit file if the file does not exist it is created and initialized, if append ==1 and if the file exists, content will be added to it, this is the default behaviour

`spike.v1.Generic.` `audittrail`(auditfile, phtx, *argl)

  management of the audit trail.

  first argument determines action : open close phase text arguments depends on the action

  audittrail(open, “title in audit file”)
    opens the audit trail - use the argument as title
  audittrail(close)
    closes the audit trail
  audittrail(phase, “title of phase”)
    start a new phase, creates a new heading in the audit trail
  audittrail(text, “text to write in audit trail”, parameter_name, parameter_value, …)
    writes in the audit trail

  if text is available on several arguments, several lines are displayed, in this case, the first arguments is the text/title, and the following arguments are by pair, with parameter_name parameter_value if phase mode <P> lines are added if text mode a <li> list is built

`spike.v1.Generic.` `autocalib`(mode='IUPAC')

  on a 2D experiment, assuming the F2 axis is 1H try to detect spin nature from frequency, and apply the unified scale as proposed by IUPAC-2001

  > Harris et al. NMR Nomenclature: Nuclear Spin Properties and Conventions for Chemical Shifts—IUPAC Recommendations. Journal of Magnetic Resonance (2002) vol. 156 (2) pp. 323-326

  WARNING, a different setting for biomolecules was proposed in a IUPAC/IUB recommendation in 1998
    Markley et al. Recommendations for the presentation of NMR structures of proteins and nucleic acids. Journal of Molecular Biology (1998) vol. 280 (5) pp. 933-952

  This previous recommendation was only mentionning 2D 13C, 15N and 31P, but was using different references

  Usage is to use 1998 recommendation for proteins and nucleic acids. these are enforced when mode = “IUB” or “biomolecule” this makes +2.6645 ppm shift in 13C. this makes a +380.4434 ppm shift in 15N.

  Returns the name of the defined nucleus in F1, “15N” “13C” “31P” or “None” if nothing was done

`spike.v1.Generic.` `autocalib_old`()

  on a 2D experiment, assuming the F2 axis is 1H try to detect spin nature from frequency, and apply the unified scale as proposed by IUPAC-2001 WARNING, proteins tend to use DSS reference, where IUPAC imposes TMS this makes +2.66 ppm shift in 13C. IDEM, for 15N proteins tend to use NH3 reference, where IUPAC imposes MeNO3 this makes a +385.50 ppm shift in 15N.

`spike.v1.Generic.` `bcorr_offset`(spec_n=30, axis='F1')

  correct for an offset of the spectrum, computed from an empty region of the spectrum

  spec_n is the argument to spec_noise() axis is the axis to process when in nD

`spike.v1.Generic.` `bcorr_quest`(p=4, axis='F1')

  apply the QUEST baseline correction, based on the Linear Prediction reconstruction on the beginning of the FID.

  p is the number of point to reconstruct axis is the axis to process when in nD

  works on complex as well as real datasets.

  from
    MAGMA. 2004 May;16(6):284-96. 2004 Time-domain quantitation of 1H short echo-time signals: background accommodation. Ratiney H, Coenradie Y, Cavassila S, van Ormondt D, Graveron-Demilly D.

`spike.v1.Generic.` `bucket`(start=0.5, end=9.5, bsize=0.04, file='bucket.cvs')

  This tool permits to realize a bucket integration from the current 1D data-set. You will have to determine (all spectral values are in ppm)

  > - start, end : the starting and ending points of the integration zone in the spectrum
  > - bsize : the size of the bucket
  > - file :the filename to which the result is written

  the “set to current window” button defines the starting and ending points of the integration zone from the current zoom window the “record” button permits to memorize the current parameters, which will be reused for the bucket integration. the “details” button displays the number and the size of the buckets currently defined. a non-integer size means that the integration will be performed on a varying number of data points

  > in order to insure a constant integration width in ppm. However, the integration intensity is not modified by the integration width.

  For a better bucket integration, you should be careful that :
    - the bucket size is not too small, size is better than number !
    - the baseline correction has been carefully done
    - the spectral window is correctly determined to encompass the meaningfull spectral zone.

  %programer%

  > see also : int1d integrate.g

  %author% MA Delsuc %version% 5.2005

`spike.v1.Generic.` `build_dict`(default_list, p_in_arg={})

  build the default parameter dictionary

  used in standard actions, returns a dictionary built from the default parmaters (see do_default.py and Param/*) and the additional parameters defined in the optionnal p_in_arg overwrite the default values

  wrapper around the NPKParam class

`spike.v1.Generic.` `burg2d`(axis='F1', nsz=None)

  apply burg extension to all columns (or rows) of current 2D axis is either “F1” or “F2” nsz is extended size, default (None) implies doubling of the size

`spike.v1.Generic.` `burg2d_back`(axis, nsz)

`spike.v1.Generic.` `burg2d_mirror`(axis, n, bsz)

`spike.v1.Generic.` `burg_back`(nsz)

`spike.v1.Generic.` `burg_mirror`(n, bsz)

`spike.v1.Generic.` `causal_corr`(delay)

  remove the effect of a time shift on the spectrum due to digital filtering (Bruker)

`spike.v1.Generic.` `causalize`(delay)

  remove the effect of a time shift on the FID due to digital filtering (Bruker)

  brings back the beginning of the FID at the first data point shorten the FID length respectively

`spike.v1.Generic.` `change_key_dict`(patternOut, patternIn, p_in_arg)

  goes though the given dictionnay (which remains unchanged) and changes in keys the pattern “patternIn” to “patternOut” and returns the modified dictionnary

  typically used in 3D processing :

  change_key_dict(‘f2’, ‘f3’, change_key_dict(‘f1’, ‘f2’, p_in)) # in THAT order !

  > substitutes F2 (of the 3D) by F1 (of the 2D plane) substitutes F3 (of the 3D) by F2 (of the 2D plane)

`spike.v1.Generic.` `config_get`(config, section, option, default=None, raw=0, vars=None)

  read a value from the configuration, with a default value

`spike.v1.Generic.` `config_getboolean`(config, section, option, default='OFF', raw=0, vars=<built-in function vars>)

  read a boolean value from the configuration, with a default value

`spike.v1.Generic.` `config_getfloat`(config, section, option, default=0.0, raw=0, vars=None)

  read a float value from the configuration, with a default value

`spike.v1.Generic.` `config_getint`(config, section, option, default=0, raw=0, vars=None)

  read a int value from the configuration, with a default value

`spike.v1.Generic.` `conv_n_p`()

  realizes the preparation of 2D FID acquired in n+p mode (echo / anti echo

`spike.v1.Generic.` `dc_offset`(zone)

  corrects each FID of a dataset for constant offset, estimated on the last % of the fid

  zone has a value between 0 and 1; 1 means the whole data set, 0.1 means the last 10%

`spike.v1.Generic.` `derivative`(n, sm)

  @sig public void derivative( int n, int sm )

`spike.v1.Generic.` `dict_dump`(dict, fname)

  dump the content of a dictionary as a property list file

  one entry per line with the following syntax : entry=value

`spike.v1.Generic.` `dict_load`(fname)

  load a property list file as a dictionary

  one entry per line with the following syntax : entry=value

  keys are set to lowercase

`spike.v1.Generic.` `dict_out`(dict, title='')

  dump the content of a dictionary as a property list file

  one entry per line with the following syntax : entry=value

`spike.v1.Generic.` `expbroad`(lb, axis='F1')

  apply a lb exponential broadening along given axis

`spike.v1.Generic.` `filec_status`()

  dumps the detailled header of a joined cache file used mostly for debugging

`spike.v1.Generic.` `flat_solvent`(param, delay=0.0)

  reduces the solvent signal supposed to be at the carrier frequency to be applied on the time domain, before Fourier transform

  actually performs a “baseline” fit type of processing on the FID, real and imaginary parts are handled independantly param is either

  > polynomial moving_average polynomial+moving_average moving_average+polynomial

  and determines the fitting algo used.

  delays is the timezeo delay offset (not implemented yet)

`spike.v1.Generic.` `ft_n_p`(axis='F1')

  F1-Fourier transform for N+P (echo/antiecho) 2D

`spike.v1.Generic.` `ft_phase_modu`(axis='F1')

  F1-Fourier transform for phase-modulated 2D

`spike.v1.Generic.` `ft_seq`()

  performs the fourier transform of a data-set acquired on a Bruker in simultaneous mode Processing is performed only along the F2 (F3) axis if in 2D (3D)

  (Bruker QSIM mode)

  see also : ft_seq() ft_sh() ft_tppi() ft_sh_tppi() ft_phase_modu() ft_n_p()

  MAD-VC July 2005

`spike.v1.Generic.` `ft_sh`(axis='F1')

  States-Haberkorn F1 Fourier transform

`spike.v1.Generic.` `ft_sh_tppi`(axis='F1')

  States-Haberkorn / TPPI F1 Fourier Transform

`spike.v1.Generic.` `ft_sim`()

  performs the fourier transform of a data-set acquired on a Bruker in simultaneous mode Processing is performed only along the F2 (F3) axis if in 2D (3D)

  (Bruker QSIM mode)

  see also : ft_seq() ft_sh() ft_tppi() ft_sh_tppi() ft_phase_modu() ft_n_p()

  MAD-VC July 2005

`spike.v1.Generic.` `ft_tppi`(axis='F1')

  TPPI F1 Fourier transform

`spike.v1.Generic.` `gaussbroad`(lb, axis='F1')

  apply a lb gaussian broadening along given axis

`spike.v1.Generic.` `gaussenh`(gg, ll, axis='F1')

  apply a lb gaussian enhancement along given axis

`spike.v1.Generic.` `get_itype`(dim=0)

  analyze the complex state of the data buffer dim is either 0 (current dim); 1 2 or 3 returns either (t) (t1,t2) (t1,t2,t3) where tx is 0 if real and 1 if complex

`spike.v1.Generic.` `get_npk_path`()

`spike.v1.Generic.` `get_saved_state`(dd)

  recover saved current working data-buffer

`spike.v1.Generic.` `hanning`(axis='F1')

  hanning apodisation

`spike.v1.Generic.` `hilbert`(axis='F1')

  convert a real data set to a complex dataset by using the Hilbert transform

  the number of data point is doubled, thus hilbert();real() is (nearly) a null operation

  axis can be F1 F2 or F12

  in dim(1) no axis is needed does not work in dim(3) yet

  minimal error checking, done mostly by the FT operations.

  Note that a small apodisation is done on the Fourier transform to reduce truncation artifacts you might want to remove this in certain cases, for instance if you plan to have several hilbert() applied to the same data in sequence.

  see also : tocomplex() invhilbert()

`spike.v1.Generic.` `invhilbert`(axis='F1')

  convert a complex data set to a real dataset by using the Hilbert transform

  the number of data point is unchanged, thus the final real dataset is zerofilled once compared to the initial

  invhilbert() is nearly equivalent to having zerofillied once before FT, but processing time is faster.

  despite the name, not quite the inverse of hilbert() !

  axis can be F1 F2 or F12

  in dim(1) no axis is needed does not work in dim(3) yet

  minimal error checking, done mostly by the FT operations.

  see also : tocomplex() hilbert()

`spike.v1.Generic.` `key_is_not_false`(dict, key)

  used to check keys in processing parameter files

  will return true if dict[key] exists and is true or doest not exist will return false if dict[key] is defined false

`spike.v1.Generic.` `key_is_true`(dict, key)

  used to check keys in processing parameter files

  will return true if dict[key] exists and is true will return false otherwise (does not exist or is false)

`spike.v1.Generic.` `left_shift`(shift_size, axis='F1')

  shifts the FID to the left by dropping data points MAD-VC January 2007

`spike.v1.Generic.` `load`(filename)

  load in 1D memory a simple 1D series skip # and ; comments

`spike.v1.Generic.` `local_proj`(axis='F1', algo='M', f1_left=0, f2_left=0, f1_right=0, f2_right=0)

  realize a local projection of the 2D data-set axis : “F1” - “F2” : the axis along which the projection is performed algo : “M” - “S” ; Mean or Skyline f1_left, f2_left, f1_right, f2_right : the coordinates of the local projection

  > O (default) means that the complete data-set will be used, thus: f1_left=1 f2_left=1 f1_right=get_si1_2D(), f2_right=get_si2_2D()

  thus : local_proj(“F1”,”M”) is equivalent to proj(“F1”,”M”)

  WARNING - local_proj(“F1”) will create a F2 1D.

`spike.v1.Generic.` `local_proj_3d`(axis='F1', algo='M', f1_left=0, f2_left=0, f3_left=0, f1_right=0, f2_right=0, f3_right=0)

  realize a local projection of the 3D data-set axis : “F1” - “F2” - “F3”: the axis along which the projection is performed algo : “M” - “S” ; Mean or Skyline f1_left, f2_left, f3_lest, f1_right, f2_right, f3_left : the coordinates of the local projection

  > O (default) means that the complete data-set will be used, thus: f1_left=1 f2_left=1 f3_left=1 f1_right=get_si1_3D(), f2_right=get_si2_3D() f3_right=get_si3_3D()

`spike.v1.Generic.` `neg_wing`()

  measure negative wing power

`spike.v1.Generic.` `peak1d_integ`(index, factor=0.1, thresh=0, slope=0.001)

  compute the integration zone around a given 1D peak

  returns (left,right) as the integration zones left and right are determined as the points were either

  > value gets below thresh (default value 0)
  >   determines an absolute stop point
  > value gets below top_of_peak*factor (default value 0.1 = 10%)
  >   determines a relative stop point
  > value > lower_point_so_far and abs(value-previous)>top_of_peak*slope (default value 0.001 = 0.1%)
  >   allows going up as much as slope*top

  warning, definitions are different from the integ kernel command

`spike.v1.Generic.` `phase_pivot`(p0, p1, pivot=0.5)

  three parameter phasing routine pivot = 0 is on left side pivot = 1 is on right side all intermidoate values are possible returns actual (P0, P1)

`spike.v1.Generic.` `pkfilter`(mode='add', tol=10)

  peak filtering

  first try…

`spike.v1.Generic.` `pksym_p`(mode='add', tol=10)

  peak symmetrisation algorithm

  first try…

`spike.v1.Generic.` `pkwrite_p`(filepeak)

  write the content of the peak table in the kernel to a peak file

  the file is formated as a property list coordinates are in index, widths are in Hz, phases in degrees. format is not fully compatible with the format used in Gifa 5, as the coordinates are ouput in index it will write the 1D, 2D or 3D peak table, depending on get_dim()

`spike.v1.Generic.` `plane_size`(axis='F1')

  returns (si1,si2) the size of the plane orthogonal to axis from the joined dataset

`spike.v1.Generic.` `proc3d`(sourcefile, destinationfile, plane_to_process, commands, context)

  this macro processes a 3D file using the cache system (join, getc, putc) it permits to handle very large files, which would not fit into memory.

  sourcefile : is the initial data-set destinationfile : is the result of the process plane_to_process : either F1, F2 or F3 (NOT F12 or F123)

  > F1 means : planes perpendicular to F1, thus the planes containing the F2 and F3 axes.

  commands : a string holding the commands to be applied to each plane in 2D notation context : a dictionary containing the variables needed to execute commands,

  > i.e. exec(commands,context) will actually be used usually built from globals() and locals()

  the commands are the regular commands you would used to process a 2D data-set. when called without parameters, ‘commands’ can be several line long, as typed when proc3d is called with parameters on the line, then ‘commands’ should be a single command line within quotes.

  e.g. proc3(ser_file, F1_proc, “F1”, ‘sin(0.2,”f12”); ft_sim(); phase(30,-40,f2); real(“f12”); ft_tppi()’)

  > # process axes f3 and f2 as 2D

  proc3(F1_proc, full_proc, “F2”, ‘sin(0.2,”f1”); ft_tppi(); real(“f1”); bcorr(3,”f1”)’)
    # process axis f1

  would process a whole 3D in 2 steps.

`spike.v1.Generic.` `right_shift`(shift_size, axis='F1')

  shifts the FID to the right by adding null data points at the begining of the FID MAD-VC January 2007

`spike.v1.Generic.` `save_state`(dd)

  save current working data-buffer

  kind of wrapper over put(“data”) save on temp file if necessary * NOT FINISHED yet, do no use *

`spike.v1.Generic.` `set_itype`(type)

  set the complex state of the data buffer dim is either 1 2 or 3 type is either (t) (t1,t2) (t1,t2,t3) where tx is 0 if real and 1 if complex

`spike.v1.Generic.` `shear`(slope, pivot)

  shearing of a given NMR 2D experiment realized by a frequency shift of all the F1 spectra pivot is the position of the invariant column (0 is left, 1 is right)

`spike.v1.Generic.` `signal_noise`(left=1, right=1, n=10)

  estimate the signal to noise of a given 1D data-set

  It does this by find the most intense peak and dividing it by the noise level

  left , right define the zone in which the signal/noise is to be computed both value default to 1, right=1 means the right most point. n is the number of pieces on which the noise is computed.

`spike.v1.Generic.` `spec_noise`(n=10)

  estimate of noise in the data-set

  estimates the noise in the data set by choping into n parts, and keeping the smallest one in the same time evaluates the offset on the dataset on the same part used for noise determination

  sets the value in get_noise and get_shift

`spike.v1.Generic.` `spectral_zone`(left, right, axis='F1', left_unit='ppm', right_unit='ppm')

  extract one spectral zone of the spectrum left float

  > the left border of the extract zone, in unit

  left_unit enum ppm hz index
    the unit in which spec_zone_left is given
  right float
    the right border of the extract zone, in unit
  right_unit enum ppm hz index
    the unit in which spec_zone_right is given
  axis enum F1 F2 F3
    if in 2D or 3D, the axis along the extract is to be done, ignored if in 1D
  returns [left,right]
    the left and right coordinates of the extracted spectral zone in index

`spike.v1.Generic.` `tilt`(slope, pivot)

  tilt of a 2D experiment realized by a frequency shift of all the F2 spectra pivot is the position of the invariant row (0 is bottom, 1 is top)

`spike.v1.Generic.` `tocomplex`(axis='F1')

  tocomplex – make dataset complex

`spike.v1.Generic.` `toreal`(axis='F1')

  toreal – make dataset real

`spike.v1.Generic.` `writet`(filename)

  writes the 1D memory as a simple 1D series skip # and ; comments

## spike.v1.GenericDosy module

## spike.v1.GenericMaxEnt module

## spike.v1.Kore module

Kore.py

Created by Marie-Aude Coutouly on 2010-03-26. Copyright (c) 2010 NMRTEC. All rights reserved.

class `spike.v1.Kore.` `Kore`(debug=0)

  Bases: `object`

  `addbase`(constant)

    Removes a constant to the data. The default value is the value of SHIFT (computed by EVALN).

    see also : bcorr evaln shift

  `adddata`(debug=False)

    Add the contents of the DATA buffer to the current data-set. Equivalent to ADD but in-memory.

  `addnoise`(noise, seed=0)

    add to the current data-set (1D, 2D, 3D) a white-gaussian, characterized by its level noise, and the random generator seed.

  `bcorr`(mode, *arg)

    Apply a baseline correction Computes and applies a base-line correction to the current data set. mode describe the algorithm used:

    > - 1 is linear correction
    > - 2 is cubic spline correction.
    > - 3 is polynomial (and related) correction NOT IMPLEMENTED YET !

    > if mode == 1 or 2

    > then in 1D *arg is radius, list_of_points
    >   or in 2D *arg is radius, axis, list_of_points

    axis in 2D is either f1 or f2 (dimension in which correction is applied). radius is the radius around which each pivot point is averaged.

    > list_of_points is then the list of the pivot points used for the

    base-line correction. Linear correction can use 1 or more pivot points. 1 point corresponds to correction of a continuous level. Spline corrections needs at least 3 points. In any case maximum is 100 pivot points.

  `bcorrp0`()
  `bcorrp1`()
  `bruker_corr`()
  `check1D`()

    true for a 1D

  `check2D`()

    true for a 2D

  `check3D`()

    true for a 3D

  `checknD`(n)
  `chsize`(*args)

    Change size of data, zero-fill or truncate. DO NOT change the value of OFFSET and SPECW, so EXTRACT should always be preferred on spectra (unless you know exactly what your are doing).

    see also : extract modifysize

  `col`(i)
  `com_max`()
  `dfactor`(value)
  `diag`(direc='F12')
  `dim`(d)

    Declaration of the ._current buffer

  `dmax`(value)

    Determines the fastest decaying component during Laplace analysis Given in arbitrary unit, use DFACTOR to relate to actual values.

    see also : dmin dfactor laplace tlaplace invlap invtlap

    sets the final value for the laplace transform

  `dmin`(value)

    Determines the fastest decaying component during Laplace analysis Given in arbitrary unit, use DFACTOR to relate to actual values.

    see also : dmin dfactor laplace tlaplace invlap invtlap

    sets the final value for the laplace transform

  `em`(axis=0, lb=1.0)
  `escale`(value=1.0)

    The Entropy expression during Maximum Entropy run is computed as follow :

    > A = Escale * Sum(F(i)) P(i) = F(i)/A S = -Sum( log(P(i)) * P(i) )

    Escale should be set to 1.0 for normal operation

    see also : maxent

  `evaln`(a, b, c=-1, d=-1)

    evaluates the noise level as well as the overall offset of the data,over a area of the data. The results are stored in the NOISE and SHIFT contexts This command is called automatically whenever a data set is read. The command will prompt for the last selected region with the POINT command

    in 2D, a,b,c,d is llf1, llf2, ur1, ur2

  `exchdata`()

    Exchange the contents of the DATA buffer with the current data-set.

    see also : adddata multdata maxdata mindata add mult put

  `extract`(*args)
  `fill`(value)
  `freq`(*args)

    The context FREQ holds the basic frequency of the spectrometer (in MHz). freq_H1 is meant to be the basic frequency of the spectrometer (1H freq) and is not used in the program. freq2 (and freq1 in 2D) are the freq associated to each dimension (different if in heteronuclear mode). Values are in MHz.

    see also : specw offset

  `freq1d`(freq_h1, freq1)
  `freq2d`(freq_h1, freq1, freq2)
  `freq3d`(freq_h1, freq1, freq2, freq3)
  `ft`(axis='F1')

    Performs in-place complex Fourier Transform on the current data-set; Data-set must be Complex.

    All FT commands work in 1D, 2D or 3D

    <ul> <li> in 1D axis, is not needed <li> in 2D axis, is F1, F2 or F12 <li> in 3D axis, is F1, F2, F3, F12, F13, F23 or F123 </ul>

    Here is a complete overview of FT routines : C stands for Complex, R stands for Real <pre>

    > FIDs Spectra C —FT—> C C <–IFT— C R –RFT–> C R <–IRFT– C C -FTBIS-> R C <-IFTBIS- R R Does not exist R

    </pre>

  `ftbis`(axis='F1')

    Data-set must be Complex.

  `get`(buffer_name)
    if parameter == “DATA”:
      self._datab = self._current.copy()

    Moves the content of another buffer, back to the current buffer with buffer_name equal to: “data”: get the content of the data buffer “linefit”: get the simulated spectrum obtained form the current peak table “window”: get actual window used to compute the chisquare “filter”: get filter used for deconvolution “residue”: get residue of the spectrum after a maxent run “tab”: get the tab buffer used for tabulated fit see also : put apply

  `get_Kore_1D`()

    return a working copy of the 1D Kore internal buffer

  `get_Kore_2D`()

    return a working copy of the 2D Kore internal buffer

  `get_Kore_3D`()

    return a working copy of the 3D Kore internal buffer

  `get_col`()
  `get_debug`()
  `get_dfactor`()
  `get_dim`()
  `get_dmax`()
  `get_dmin`()
  `get_freq`()
  `get_freq_1_2d`()
  `get_freq_1_3d`()
  `get_freq_1d`()
  `get_freq_2_2d`()
  `get_freq_2_3d`()
  `get_freq_3_3d`()
  `get_itype_1d`()
  `get_itype_2d`()
  `get_itype_3d`()
  `get_noise`()
  `get_npk1d`()
  `get_npk2d`()
  `get_npk3d`()
  `get_offset_1_2d`()
  `get_offset_1_3d`()
  `get_offset_1d`()
  `get_offset_2_2d`()
  `get_offset_2_3d`()
  `get_offset_3_3d`()
  `get_ph0`()
  `get_ph1`()
  `get_row`()
  `get_shift`()
  `get_si1_1d`()
  `get_si1_2d`()
  `get_si1_3d`()
  `get_si2_2d`()
  `get_si2_3d`()
  `get_si3_3d`()
  `get_si_tab`()
  `get_specw_1_2d`()
  `get_specw_1_3d`()
  `get_specw_1d`()
  `get_specw_2_2d`()
  `get_specw_2_3d`()
  `get_specw_3_3d`()
  `get_version`()
  `geta_max`(index)
  `geta_pk1d_a`(i)
  `geta_pk1d_a_err`(i)
  `geta_pk1d_f`(i)
  `geta_pk1d_f_err`(i)
  `geta_pk1d_p`(i)
  `geta_pk1d_t`(i)
  `geta_pk1d_w`(i)
  `geta_pk1d_w_err`(i)
  `geta_pk2d_a`(i)
  `geta_pk2d_a_err`(i)
  `geta_pk2d_f1f`(i)
  `geta_pk2d_f1f_err`(i)
  `geta_pk2d_f1w`(i)
  `geta_pk2d_f1w_err`(i)
  `geta_pk2d_f2f`(i)
  `geta_pk2d_f2f_err`(i)
  `geta_pk2d_f2w`(i)
  `geta_pk2d_f2w_err`(i)
  `geta_pk3d_a`(i)
  `geta_pk3d_f1f`(i)
  `geta_pk3d_f1w`(i)
  `geta_pk3d_f2f`(i)
  `geta_pk3d_f2w`(i)
  `geta_pk3d_f3f`(i)
  `geta_pk3d_f3w`(i)
  `htoi`(index, dim, axis)
  `htop`(index, dim, axis)
  `ift`(axis='F1')

    Performs in-place inverse complex Fourier Transform on the current data-set; Data-set must be Complex.

  `iftbis`(axis='F1')

    Data-set must be Real.

  `invf`(axis='F1')

    Process data-sets by multiplying by -1 1 point every 2 points. Equivalent to taking the conjugated on complex data-sets, or hyperconjugated on hypercomplex data-sets. If applied on a complex FID, inverses the final spectrum obtained after Fourier transform.

    see also : revf itype ft reverse

  `irft`(axis='F1')

    Perform real-to-complex Fourier Transform on data

  `itoh`(index, dim, axis)
  `itop`(index, dim, axis)
  `itype`(value)
  `join`(file_name)

    write( file_name )

    Writes the current data set to a file in standard format. same as writec

    see also : read

  `lb`(value)
  `maxdata`()

    Compare the content of the current buffer with the content of the DATA buffer, and leave in memory the largest of the 2 values. Usefull for projections or symetrisation macros.

    see also : mindata exchdata adddata multdata sym put

  `mindata`()

    Compare the content of the current buffer with the content of the DATA buffer, and leave in memory the smallest of the 2 values. Usefull for projections or symetrisation macros.

    see also : maxdata exchdata adddata multdata sym put

  `minimax`(mini, maxi)
  `minus`()
  `modifysize`(si1, si2)

    modifysize( si1, si2, si3 )

    Permits to modify the leading sizes of a 2D or a 3D data-set, provided the product of the sizes : si1*si2{*si3} is equal to the product of the old ones.

    Does not actually modify the data.

    see also : chsize

  `modulus`()
  `mult`(constant)
  `mult1d`(axis=0)

    multiply the current 2D or 3D with the contents of the 1d buffer considered as a f1(i)f2(j) concatenated buffer

    see also : multdata add adddata filter

  `multdata`()

    Multiplies point by point, the content of the current working buffer with the content of the DATA buffer. Permits to realize convolution product. Works in 1D, 2D, in real, complex and hypercomplex modes.

    see also : ADDDATA MINDATA MAXDATA EXCHDATA MULT PUT

  `noise`(value)

    Contains the level of noise in the data-set. When loading data (1 or 2D) the noise level is evaluated automatically from the last 10th of the data. Can also be set with EVALN. Used by INTEG and by Maximum Entropy run.

  `offset`(*args)

    Permits to specify the offset of the right-most (upper right most in 2D) point of the data set. The value for offset are changed by @extract see also : specw

  `offset1d`(off1)
  `offset2d`(off1, off2)
  `offset3d`(off1, off2, off3)
  `one`()
  `peak`(pkradius=0)
  `phase`(ph0, ph1, axis=1)
  `pkclear`()
  `plane`(axis, i)

    Extract the nth 1D row (along F2 axis) from the 2D data-set, and put it in the 1D buffer. The row will be available as a 1D data set when going from 2D to 1D

  `plus`()
  `power2`(i)

    Compute the power of 2 that is under or equal to i

  `proj`(axis, projtype)
  `ptoh`(index, dim, axis)
  `ptoi`(index, dim, axis)
  `put`(parameter)

    put(parameter, n)

    Moves the content of the current buffer to an other buffer With parameter equal to:

    xx* DATA
      load the data to be used for MaxEnt processing or
        as a off-hand place for processing

    in 1D only FILTER load the filter used for Deconvolution. If NCHANNEL is

    > greater than 1, then which channel you want to put. eg. PUT FILTER 3. PUT FILTER 0 will consider the current data set as the multichannel filter, and will load the whole filter. Useful when associated with GET FILTER to store filters as files.

    WINDOW load the window to be used for MaxEnt processing TAB load the TAB buffer, used for tabulated fit.

    in 2D only ROW n load the 1D buffer in the ROW n COL n load the 1D buffer in the COL n

    in 3D only PLANE Fx n load the 2D buffer in the plane Fx n

    see also : GET SHOW APPLY

  `read`(file_name)

    Reads the file as the new data set in standard format . Same as readc

    see also : write

  `real`(axis='F1')
  `report`()

    print a summary of the internal state of the kernel

  `reverse`(axis='F1')
  `revf`(axis='F1')

    Processes FID data-sets by multiplying by -1 2 points out of 4. Permits to preprocess Bruker FIDs in Dim 2 (Bruker trick) before RFT, or permits to bring back zero frequency in the center for some other data formats

  `rft`(axis='F1')

    Perform real-to-complex Fourier Transform on data

  `row`(i)

    Extract the nth 1D row (along F2 axis) from the 2D data-set, and put it in the 1D buffer. The row will be available as a 1D data set when going from 2D to 1D

  `set_Kore_1D`(npkdata)

    uses npkdata as the 1D Kore buffer

  `set_Kore_2D`(npkdata)

    uses npkdata as the 1D Kore buffer

  `set_Kore_3D`(npkdata)

    uses npkdata as the 3D Kore buffer

  `set_task`(task)
  `setval`(*args)

    Will set the value of the data point to x. The number of coordinates of the point depends of dim. In dim 2 or 3, coordinates are F1 F2 or F1 F2 F3. Can be usefully used when associated to the functions valnd() to change data point value.

  `setval1d`(i, x)
  `setval2d`(i, j, x)
  `setval3d`(i, j, k, x)
  `shift`(value)

    This context holds the systematic baseline shift of the current data-set, computed automatically by EVALN. Used by INTEG. see also : evaln noise addbase

  `sin`(maxi, axis=1)
  `specw`(*args)

    Permits to enter the value for the spectral width of the current data-set. One parameter will be needed for each dimension of the data-set.

    When reading a file the spectral width is set to 2000 * 3.1416 if no parameter block is available.

    The value for spectral width are changed by EXTRACT

    see also : offset extract

  `specw1d`(x)
  `specw2d`(x, y)
  `specw3d`(x, y, z)
  `sqsin`(maxi, axis=1)
  `status`()

    print a summary of the internal state of the kernel

  `tm`(tm1, tm2, axis=0)
  `val1d`(i)
  `val2d`(i, j)
  `val3d`(i, j, k, x)
  `vert`(i, j)

    In 3D mode, extract a column orthogonal to the last displayed plane. The column is taken at coordinates i and j in this plane.

    see also : plane col row dim

  `window`({axis}, x, y)

    Define the window (with the starting point and the ending point) on which data is actually used for the iteration. Data outside this window(displayed as 0 during the interactive input) are just ignored for the processing. Window can be entered several time, the result being cumulative.

    see also : window_reset window_mode put apply

  `window_reset`({axis})

    Resets the window to 1.0

    see also : window window_mode

  `write`(file_name)

    Writes the current data set to a file in standard format. same as writec

    see also : read

  `writec`(file_name)

    write( file_name )

    Writes the current data set to a file in standard format. same as writec

    see also : read

  `zero`()
  `zoom`(*args)

`spike.v1.Kore.` `compatibility`(context)

  inject Kore definition into context given by the caller

## spike.v1.Launch module

## spike.v1.NPKv1 module

## spike.v1.Nucleus module

Values (tentatively) from ROBIN K. HARRIS, EDWIN D. BECKER, SONIA M. CABRAL DE MENEZES, ROBIN GOODFELLOW, AND PIERRE GRANGER “NMR NOMENCLATURE.NUCLEAR SPIN PROPERTIES AND CONVENTIONS FOR CHEMICAL SHIFTS (IUPAC Recommendations 2001)” Pure Appl.Chem., Vol.73, No.11, pp.1795-1818, 2001.

`spike.v1.Nucleus.` `freq`(spin='1H', H_freq=100.0, mode='standard')

  returns the frequency of the given spin, in a field were the proton 1H is at frequencey H_freq values if mode is “standard” or “IUPAC”, (default) the standard values are used if mode is “biomolecule” or “IUPAB” values are taken from previous paper

  > Markley et al. Recommendations for the presentation of NMR structures of proteins and nucleic acids. Journal of Molecular Biology (1998) vol. 280 (5) pp. 933-952 This previous recommendation was only mentionning 2D 13C, 15N and 31P, but was using different references They are given in table 4 of 2001 paper

  Usage is to use 1998 recommendation (mode = “biomolecule”) for proteins and nucleic acids.
    this makes +2.6645 ppm shift in 13C. this makes a +380.4434 ppm shift in 15N.

`spike.v1.Nucleus.` `freqB`(spin='1H', Bo=14.092)

  returns the frequency in MHz of the given spin, in a field of intensity Bo Tesla

`spike.v1.Nucleus.` `receptivity`(spinans, spinref='1H')

  returns the receptivity of a given spin, relative to spinref

`spike.v1.Nucleus.` `report`(H_freq=600.0)

  report the spin table at a given field

## spike.v1.Param module

This class extend the standard dictionnary behaviour. It is used to read and store all the parameters used by the NPK program.

- it adds the possibility to load from files and dump/store to files the content of the dictionnary the file will be of the form : key=value, with one entry per line
- when extracted from the dictionnnary, values are interpreted in several manner
    o 1K is replaced by 1024 and all multiples (4k; 24k; etc…) o 1M is replaced by 1024*1024 and all multiples (4M; 24M; etc…) o all arithmetic is evaluated : math.pi/2, 0.1*get_si1_2d(), etc…

class `spike.v1.Param.` `NPKParam`(dict_=())

  Bases: `collections.UserDict`

  NPKParam class handles the parameter set used by NPK

  `build_default`(default_list)

    build the default parameter dictionary

    used in standard actions, returns a dictionary built from the default parmaters (see do_default.py and Param/*) and the additional parameters defined in the optionnal p_in_arg overwrite the default values

  `change_key`(patternOut, patternIn)

    goes though the given dictionnay (which remains unchanged) and changes in keys the pattern “patternIn” to “patternOut” and returns the modified dictionnary

    typically used in 3D processing :

    p_in.change_key(‘f1’, ‘f2’).change_key(‘f2’, ‘f3’)

    > substitutes F2 (of the 3D) by F1 (of the 2D plane) substitutes F3 (of the 3D) by F2 (of the 2D plane)

  `dump`(fname)

    dump the content of the Parameter dictionnary as a property list file entries are not evaluated

    one entry per line with the following syntax : entry=value

  `load`(fname)

    load a property list file as a dictionary

    one entry per line with the following syntax : entry=value

    keys are set to lowercase

  `raw`(key)

    acces to the raw data present in the dictionnary, necessary in certain cases

  `store`(fname)

    write the content of the Parameter dictionnary as a property list file equivalent to dump, BUT entries are evaluated

    one entry per line with the following syntax : entry=value

`spike.v1.Param.` `NPKevaluate`(val)
  - val is interpreted in several manner
      o 1K is replaced by 1024 and all multiples (4k; 24k; etc…) o 1M is replaced by 1024*1024 and all multiples (4M; 24M; etc…) o all arithmetic is evaluated : math.pi/2, 0.1*get_si1_2d(), etc…

`spike.v1.Param.` `parse`(line)

## spike.v1.Process1D module

## spike.v1.Process2D module

## spike.v1.Process3D module

## spike.v1.ProcessDosy module

## spike.v1.mflops module

## spike.v1.test module

## spike.v1.v1_Tests module

## Module contents

The NPK Package