NPK: Process2D.py Wed Oct 14 15:25:36 2009 |
This module contains all the routines needed to process 2D NMR spectra The following functions realize a set of operations, needed for NMR 2D processing, You will find operation for FT analysis, MaxEnt Analysis, Inverse Fourier, etc.. Processing are divided in pre - FT - Post phases. For instance a typical 2D procesing, would be pre_2d() pre_ft_2df2() ft_2df2() post_ft_2df2() pre_ft_2df2() ft_2df2() post_ft_2df2() post_2d() but other combinations are possible. Most functions take the following arguments : arguments : audit the opened audit file, if empty or set to none, audit will go to the stdout filein the file name of the input file, will loaded before operation, if name is "memory", then processing takes place on the current 2D kernel buffer fileout the file name of the input file, can be "memory" will written after operation, if name is "memory", then processing results is left in 2D kernel buffer p_in the dictionary containing all the processing parameters most entries are optionnal as entries are protected with try / except f_in the dictionary containing all the details on the spectrum "filein" f_out details on the spectrum "fileout" will be put in this dictionary location the directory where the output files will be written Most operation are performed in-memory, and filein and fileout are not a requisite. It is possible to just realize the processing from the 2D data-set in memory, leaving the result in memory. To do this, simple use "memory" instead of a real filename.
FT2D(audit,p_in_arg_,f_in,f_out,inputfilename,outputfilename) | ||
FT processing of a 2D FID uses : pre_2d() pre_ft_2df2() ft_2df2() post_ft_2df2() pre_ft_2df1() ft_2df1() post_ft_2df1() post_2d() |
FT_F2_2D(audit,p_in_arg,f_in,f_out,inputfilename,outputfilename) | ||
processing of the F2 axis of a 2D FID used by 3D processing uses : pre_2d() pre_ft_2df2() ft_2df2() post_ft_2df2() |
FT_F1_2D(audit,p_in_arg,f_in,f_out,inputfilename,outputfilename) | ||
processing of the F1 axis of a 2D FID used by 3D processing uses : pre_2d() pre_ft_2df1() ft_2df1() post_ft_2df1() post_2d() |
MaxEnt2D(audit,p_in_arg,f_in,f_out,inputfilename,outputfilename) | ||
MaxEnt processing of a 2D FID uses : pre_2d() pre_ft_2df2() pre_ft_2df1() maxent_2d() post_maxent_2d() post_2d() |
ft_2df1( audit, filein, fileout, p_in, f_in, f_out) | ||
This macro realizes the FT operation on the F1 FID of the 2D it implements the spectral analysis step : - truncate : remove points at the end of the FID - lp_extend : extend the FID by LP analysis - apodisation : multiply the FID by some windowing function - Fourier_transform : performs FFT - reverse : reverses spectral axis Input Domain in F1: time Output Domain in F1: frequency Dimensionality: 2 Author: Marc-Andre Delsuc Version: 6.0Actions
|
ft_2df2( audit, filein, fileout, p_in, f_in, f_out) | ||
This macro realizes the FT operation on the F2 FID of the 2D it implements the spectral analysis step : - truncate : remove points at the end of the FID - lp_extend : extend the FID by LP analysis - apodisation : multiply the FID by some windowing function - Fourier_transform : performs FFT - causal_corr : perform causal correction - reverse : reverses spectral axis Input Domain in F2: time Output Domain in F2: frequency Dimensionality: 2 Author: Marc-Andre Delsuc Version: 6.0Actions
|
pre_ft_2df1( audit, filein, fileout, p_in, f_in, f_out ) | ||
This macro realizes the pre FT operation on each F1 FID of the 2D it implements FID massaging before FT: - left_shift : drops first points of the FID - right_shift : adds empty points on the beginning of the FID - back_extend : reconstructs missing points in the beginning of the FID by LP analysis Input Domain in F1: time Output Domain in F1: time Dimensionality: 2 Author: Marc-Andre Delsuc Version: 6.0Actions
|
pre_ft_2df2( audit, filein, fileout, p_in, f_in, f_out ) | ||
This macro realizes the pre FT operation on each F2 FID of the 2D it implements FID massaging before FT: - dc_offset : corrects for constant offset in FID - causalize : changes DSP processed FID (Bruker) to causal FID's by Hilbert transform - flatten_solvent : removes solvent signal by FID analysis - left_shift : drops first points of the FID - right_shift : adds empty points on the beginning of the FID - back_extend : reconstructs missing points in the beginning of the FID by LP analysis Input Domain in F2: time Output Domain in F2: time Dimensionality: 2 Author: Marc-Andre Delsuc Version: 6.0Actions
|
post_ft_2df1( audit, filein, fileout, p_in, f_in, f_out ) | ||
This macro realizes the post FT operation on each F1 spectrum of the 2D it implements the massaging of the spectrum after FT : - phase : apply phase correction on the complex spectrum - autophase : compute and apply phase correction - invHibert : apply inverse Hilbert transform - calibration : apply ppm calibration - autocalibrate : autocalibration of the F1 axis based on the F2 calibration - spectral_zone : extract a spectral zone Input Domain in F2: frequency Output Domain in F2: frequency Dimensionality: 2 Author: Marc-Andre Delsuc Version: 6.0Actions
|
post_ft_2df2( audit, filein, fileout, p_in, f_in, f_out ) | ||
This macro realizes the post FT operation on each F2 spectrum of the 2D it implements the massaging of the spectrum after FT : - phase : apply phase correction on the complex spectrum - autophase : compute and apply phase correction - invHibert : apply inverse Hilbert transform - calibration : apply ppm calibration - spectral_zone : extract a spectral zone Input Domain in F2: frequency Output Domain in F2: frequency Dimensionality: 2 Author: Marc-Andre Delsuc Version: 6.0Actions
|
pp_2d( audit, filein, filepeak, p_in, f_in, f_out ) | ||
This macro realizes the peak picking of a 2D dataset it implements - spec_noise : estimates noise - prefilter : apply a filtering to the data-set to remove features below a given separation in Hz - restrict : defines the zone in whch the peak-picking is to be done - peakpick : do the peak picking - postfilter : apply a post filtering on the peak list Input Domain in F1: frequency Input Domain in F2: frequency Dimensionality: 2 Author: Marc-Andre Delsuc Version: 6.0Actions
|
maxent_2d( audit, filein, fileout, p_in, f_in, f_out ) | ||
This macro realizes the MaxEnt spectral analysis of a 2D FID it implements the following steps : - freq_massage : do some preparation in the frequency domain - causal_corr : perform causal correction - phase : apply phase correction on the complex spectrum before analysis - spectral_zone : extract a spectral zone before analysis - reverse : reverses spectral axis - truncate : remove points at the end of the FID - preconvoluate : apply a preconcolution function of the FID - partialsampling : implements analysis on partially sampled FID - positive_negative : implements two channel processing for positive and negative lines - deconvoluate : deconvoluate spectrum from a given time domain response - maxent : apply Maximum Entropy analysis of the dataset arguments : audit the opened audit file filein the file name of the input file, can be "memory" fileout the file name of the input file, can be "memory" p_in the dictionary containing all the processing parameters f_in the dictionary containing all the details on the spectrum "filein" f_out details on the spectrum "fileout" will be put in this dictionary Input Domain in F1: time Output Domain in F1: frequency Input Domain in F2: time Output Domain in F2: frequency Dimensionality: 2 Author: Marc-Andre Delsuc Version: 1.0Actions
|
post_2d( audit, filein, fileout, p_in, f_in, f_out, location=".") | ||
This macro realizes the post FT operation on a 2D spectrum This macro implements the massaging of the spectrum after complete Spectral analysis : - autophase2D : computes and apply global phase correction - modulus : take the modulus of the complex spectrum - baseline : baseline correction - shear : apply the shear correction - tilt : apply the tilt correction - symetrize : apply symetrisation algorithms - smoothing : apply a smoothing filter - median : apply a media filter - projection : compute F1 and F2 projections - select_state : enforce the final state of the data - spec_noise : estimates noise in final spectrum Input Domain in F1: frequency Output Domain in F1: frequency Input Domain in F2: frequency Output Domain in F2: frequency Dimensionality: 2 Author: Marc-Andre Delsuc Version: 6.0Actions
|
post_maxent_2d( audit, filein, fileout, p_in, f_in, f_out,location="." ) | ||
This macro realizes the post MaxEnt operation on a 2D spectrum it implements the massaging of the spectrum after FT : - level_correction : correct the slight level offseting by doing a simple baseline correction - calibration : apply ppm calibration - positive_negative_cor : reconstruct a composite 2D from the two channel processing - smoothing : apply a smoothing filter - median : apply a media filter - projection : compute F1 and F2 projections - select_state : enforce the final state of the data arguments : audit the opened audit file filein the file name of the input file, can be "memory" fileout the file name of the input file, can be "memory" p_in the dictionary containing all the processing parameters f_in the dictionary containing all the details on the spectrum "filein" f_out details on the spectrum "fileout" will be put in this dictionary Input Domain in F1: frequency Output Domain in F1: frequency Input Domain in F2: frequency Output Domain in F2: frequency Dimensionality: 2 Author: Marc-Andre Delsuc Version: 6.0Actions
|
pre_2d( audit, filein, fileout, p_in, f_in, f_out ) | ||
This macro realizes the preparation operation on a 2D FID it implements global FID evaluation before 2D FT: - data_check : performs minimum data checking - fid_noise : measure of noise and offset levels in FID of noise and offset levels in FID - conv_n_p : conversion of N+P acquisition (echo / antiecho) arguments : audit the opened audit file filein the file name of the input file, can be "memory" fileout the file name of the input file, can be "memory" p_in the dictionary containing all the processing parameters f_in the dictionary containing all the details on the spectrum "filein" f_out details on the spectrum "fileout" will be put in this dictionary Input Domain in F1: time Input Domain in F2: time Output Domain in F1: time Output Domain in F2: time Dimensionality: 2 Author: Marc-Andre Delsuc Version: 6.0Actions
|
read_file_2d( audit, filein) | ||
used to read the input binary file, while maintaining the audittrail |
write_file_2d( audit, fileout) | ||
used to write the output binary file, while maintaining the audittrail |