Home
GAMMA Graphics Documentation
Contents
1. ysize Ay 88 he xsize Figure 4 11 How to set the skew or viewing angle in the FM stack plot function Changes made to the row increment row inc somewhat affects plot scaling as well because only the rows actually plotted are considered not the entire data matrix input The figure below demonstrates the effect of increasing the value of row inc Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 42 Graphics amp I O FrameMaker Functions 3 4 Stack Plot Row Increments increased _1 Figure 4 12 The effect of the row increment arguemnt The value of xinc dictates how much horizontal skew there is in the final plot Neg
2. 5 6 Description 5 6 1 Felix dat File Structure Each Felix dat file is a serial type of file i e a series of 1D spectra stacked one after another which we will refer to as blocks At the beginning of each block are two integers The first is used for structured I O in FORTRAN which Felix uses The second is a flag as to whether or not the data in the block is spectral data positive integer or parameter data negative integer The absolute value of this second integer will be the number of complex points in the block SIZE There is no particular limit as to how many blocks are contained in a Felix dat file probably all data blocks should be of the same length Each block also ends with an integer again the result of FORTRAN sutructured I O Felix dat File Structure A SIZE 0 1 m NUN SIZE 2 SIZE 1 A A SIZE 0 1 SIZE 2 SIZE 1 A A SIZE 0 1 NS SIZE 2 SIZE 1 A A SIZE 0 1 EE LU SIZE 2 SIZE 1 A Figure 4 7 File Structure of an Felix dat file There are SIZE complex points per each 1D spectrum The integer A which starts and ends each row is used for FORTRAN structured I O within Fe lix The second integer of each row SIZE if negative indicates that the row contains param eter information The first data point of the row is indexed 0 and the last indexed size 1 Felix dat Header Structure The first block in a Felix dat file may contain
3. Input verbose level cout lt lt Output line feed so screen is nice NMRi_header filename verbose Output the header info in filename In this example the user is queried for the file and the amount of information should be returned The default value of 0 returns the minimal amount of information the amount increases as verbose increases up to 10 The header information is returned to the standard output stream Copyright Scott A Smith May 22 1998 GAMMA NMRi I O 110 User Documenation Routines 6 3 6 4 Description NMRi File Structure NMRi files begin with a header which contains 512 parameters describ ing the spectral data A 1D spectrum of length SIZE is written immediately after the header all real values followed by all imaginary values If the data is not complex the imaginary values are absent from the file A two or multi dimensional spectrum is successive 1D spectra sharing the same header information as depicted in the figure below NMRi File Structure Spectrum 2 SIZE Reals Spectrum 2 SIZE Imaginaries Spectrum SPECNUM SIZE Reals Spectrum SPECNUM SIZE Imaginaries Figure 25 1 Overall file structure of a NMRi file containing SPECNUM 1D complex spectra each of length SIZE This file structure is described in the NMRi manual LAB ONE NMR2 USER MANUAL Release 3 5 on page 29 NMRi Header Structure A full listing of the parameters contained in the header is given in the N
4. 0 90 B 90 B 90 p 90 B 90 Figure 4 19 Examples of rotations using only the 1st two Euler Angles Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 48 Graphics amp I O FrameMaker Functions 3 4 These axes were generated with the program listed as Example using a radius of 1 cm a gamma value of zero de grees and type 0 only axes The axis orientation proceeds via first rotating about the z axis with angle alpha followed by rotation about the new x axis with angle beta The last rotation if gamma were non zero is about the new z axis with angle gamma Looking from the positive axis toward the origin all rotations appear clock wise Euler Rotations About B and y B 0 p 10 B 45 B 90 0 0 Y 0 y 0 Z Z Z x 2 L 7 y B 0 B 10 B 45 B 90 y 10 y 10 y 10 y 10 Z Z Z X X X i P ED 4 y y B 0 B 10 B 45 B 90 y 45 45 45 45 7 Z X Z y y y y X 0 B 10 45 90 90 y 90 90 90 Figure 4 20 Again these axes were generated with the program listed as Example 1 The axis 1 Euler rotations follow the right hand rule that is the coordinate system moves counter clockwise about the rotation axes An alternate and equivalent view is that the coordinates themselves move clock wise about sta tionary axes This function strictly adheres to this convention The overall plot is reference to some static axes Any data is thus rota
5. 2 5 Routines for Interactive Plotting Using Gnuplot 2 5 1 GP 1Dplot Usage include lt gnuplot h gt void GP_1Dplot const String amp gnumacro const String amp file1D int join 1 void GP_1Dplot GPdat amp G Description The function GP 1Dplot can be used to produce 1D plots to the screen while a GAMMA program is running using Gnuplot This is in three steps First during the course of a simulation an ASCII file suitable for use in Gnuplot is written to a file Second an ASCII file full of Gnuplot commands to plot the ASCII data file is written to another file Finally Gnuplot is invoked and the commands executed Return Value Nothing A new disk file in the MMF is produced for incorporation into Gnuplot Example include gamma h FM Matrix Testal mmf c j 6 00 6 00 Note that the 1 1 is set to the integer 1 the 1 2 element to 1 00 because its full value is 1 001 The imaginary part has a value of 0 0001 and falls below threshold See Also FM Mat Plot Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 20 Graphics amp I O Index of Figures amp Tables 2 3 2 6 Additional Examples 2 6 1 Spherical Plots Description Although there is no function in GAMMA yet to support it directly users can make 3D spherical plots with Gnuplot and GAMMA In this instance the program should generate a coordinate vector of the 3D points These are subsequently projected into 2 dim
6. The function NMRiFile is used to either create a new NMRi compatible file or to open an existing file which is in the standard NMRi format The data is contained in the data block The file is specified by either the name filename or by the file pointer file The parameter indicates whether to write real or com plex default data If rc is 0 only the real data will be output If rc is negative only the imaginary data is writ Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 114 User Documentation NMRifFile Figures and Tables 7 3 ten as reals and if rc 0 the complex data is written Return Value Nothing when producing a NMRi file Example 7 4 3 Usage include lt gamma hc gt main block_1D BLK1 128 Define a 1D data block Gaussian 128 64 42 46 Set 1D block to Gaussian NMRi fp BLKB 0 fp close Close file NMRND tst The last NMRi file produced NMRND tst was made by first opening a file successively writing 1D spectra to it then closing the file Since this program accessed NMRi files previously during the creation of NMRID tst and NMR2D tst the first spectrum was independently written outside the loop with the zero flag set when calling NMRi This sets the internal counter to zero something unnecessary had NMRi files not been previously created in the program write include lt NMRiFile h gt void write const matrix amp mx
7. void write const block 1D amp void write const block 2D amp BLK Description The function write is used to write data from a GAMMA matrix or block into an NMRi compatible file There is only one argument and it can be either a matrix 1 dimensional data block or 2 dimensional data block Return Value Nothing the function is void The NMRi file will be modified Example main NMRiFile filel oldfile dat Open an old NMRiFile filel external name oldfile dat mstrix mx Declare a general matrix block 1D Declare a 1D data block block 2D BLK2 Declare a 2D data block Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 115 User Documentation NMRifFile Figures and Tables 7 3 file 1 read mx Read all the data points in oldfile dat into matrix mx file 1 read BLK2 Read all data points in oldfile dat into 2D block BLK2 7 4 4 read Usage include lt NMRiFile h gt void read matrix amp mx void read block 1D amp void read block 2D amp void read matrix amp mx int rows void read block 1D amp BLK int rows void read block 2D amp BLK int rows Description The function read is used to read data from an NMRi compatible file into a GAMMA matrix or data block Only one argument in utilized in the first three funciton forms either a matrix 1 dimensional data block or 2 dimensional data block With this
8. 5 6 1 Felix 1D Spectrum Output 5 6 2 Felix 2D Spectrum Serial Output 5 6 2 Felix 1D Spectrum Output 5 6 2 Felix 1D Example Output 5 6 2 Felix 2D Example Output 5 6 2 Felix dat File Structure 5 6 2 Felix dat File Header Structure 5 6 2 Felix dat File Header Structure 5 6 2 Felix mat File Structure 5 6 2 Felix mat File Header Structure 5 6 2 Typical Matrices versus Felix mat 2D Matrix 5 6 2 General Felix mat File Structure 5 6 2 Felix mat File Structure for 512x512 Real Matrix Table 2 Felix mat File Header Scalar Parameters Table 3 Felix Matrices versus Felix Header Scalars Table 4 Felix mat File Header Vector Parameters Table 5 Felix Matrices versus Felix Header Scalars Table 6 Felix mat File Other Parameters Table 7 Felix Matrices versus Felix Header Scalars Table 8 Felix Matrices versus Felix Header Scalars Copyright Scott A Smith May 22 1998 page 76 page 77 page 79 page 81 page 82 page 92 page 93 page 94 page 95 page 96 page 101 page 102 page 103 page 96 page 97 page 98 page 99 page 99 page 103 page 104 GAMMA Felix I O 75 Graphics amp I O 5 5 Routines 5 5 1 Felix Usage include lt Felix h gt void Felix const char filename block_1D amp BLK int rc 1 void Felix const char filename block_2D amp BLK int rc 1 void Felix File amp fp block 1D amp BLK int rc 1 int reset 0 y y Description The function Feli
9. For all data blocks in a Felix dat file the value stored in SIZE will always indicate the number of complex points stored in the block A data block may contain either real or complex points but this information is contained in the previous header block the first non data block in the dat file Also contained in the previous header block is the value DSIZE the actual number of data points that Felix expects to obtain from the data block Again this information is independent from the value of SIZE The number of data points used from a given block may actually be far less that the num ber of points stored in the block If the header has flagged the data as complex the information is expected to be stored point wise that is re im re im until the end If the data contained in the block is real the points are stored in order that is re re re until the end The value DSIZE set by the previous header tells Felix how many points to take out of the data block This value is the number of complex points to take when the data is complex and the number of real points to take when the data is real unlike SIZE which is always assuming storage for complex points Note If no header exists optional in Felix dat files the data is taken as complex and DSIZE SIZE Felix dat File Header Structure A SIZE 0 1 Gee eee 1 SIZE 2 SIZE 1 A COMPLEX Zo 21 ZsIZE 2 25178 1
10. Initially the coordinates and or drawn coordinate system is rotated by the specified Euler angles The rotated three dimensional coordinates are then projected onto the 2D plane of the paper or screen To produce a rea sonable plot the 3D z coordinates is mapped into the 2D y coordinates and the 3D x coordinates are mapped into the 2D negative x coordinate as depicted in the figure below This mapping keeps everything related to standard right handed coordinate systems The initial unrotated system has y coming up out of the paper plane Figure 4 18 Depiction of simple 3D Euler Rotation and subsequent projection on plot axes Perspective Euler Rotations The three Euler angles can dramatically change the quality of the out put plot The de fault Euler angles are set to produce a nice view of typical data maintaining the z axis vertical The following figures demonstrate by example the effect of the various Euler angles on the final coordinate axes in which the data is drawn Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 47 Graphics amp I O FrameMaker Functions 3 4 Z y gu e X y Rotated Data Coordinate System Euler Rotations About o and p did Coordinate Vector Coordinate System 2D Projected Paper Coordinate System a 0 al i o 45 a 90 Z Z Z Z X X X y y 2 0 0 10 0 45 0 90 B 10 B 10 a 0 2 10 0 9 8 45 4 45 Baas X LA i Z y y 0 0 0 10
11. CPN double xsize double ysize The function FM contour creates a Gnuplot file called filename in MIF format The produced file will contain a contour plot of the real data contained in the matrix mx The contours begin at the level set by threshold and increment by the value of CLI The number of contours is set by steps The levels increment either geometrically or linearly as set by the value of CLM the default is linear Positive and negative contours are set by the flag CPN For CPN 1 default both positive and negative contours are produced For CPN 0 only the positive contours are output while for CPN 1 only the negative contours are done The output file contour plot will be of dimension xsize by ysize both given in centimeters default 10 cm CPN This is a flag to indicate whether positive or increasing negative or decreasing or both positive and negative contours If CPN 0 only contours increasing from the set threshold will be computed If CPN 1 only contours decreasing from the set threshold will be computed If CPN 1 default contour will be computed increasing from Ithresholdl and decreasing from Ithresholdl xsize ysize These determine the overall plot dimensions the Gnuplot output will assume The values are input in centimeters and are defaulted to 10 cm each The values do nothing to the relative x to y scaling im plicit in the data matrix thus a 256 by 512 array will be 5 x 10 cm even though xsize and
12. Felix stores these points in 64 point clumps the first clump belonging to elements which would be read by the Felix command oa 0 1 a row in standard matrix nomenclature The the next clump con tains the first 64 elements which would be read by oa 0 2 and so on until the entire 4K block is filled up It is the second block which contains the second set of 64 point clumps for all of these rows and since dimension 1 spans 512 points it takes 8 complete blocks to span the vectors ob tained by loa 0 1 through loa 0 64 This is a brick The data obtained from loa 0 65 begins at the start of the second brick at the 8th block 0 7 allotted to brick 0 Copyright Scott A Smith May 22 1998 GAMMA Felix I O 103 Graphics amp I O Felix mat File Structure for 512x512 Real Matrix 0 1 2 3 ECL 4093 4094 4095 Pese wm pan stole i rears oan onl sioleas su 511 509 511 510 Figure 4 11 Header Structure of an Felix mat file Note that the index in FORTRAN the language in which Felix is written is shifted by 1 realative to the standard C indexing used in GAMMA that is vectors start at 21 and end at 100 etc Below is a brief table of the first for scalar parameters found versus the matrix generated from the Felix bld command Table 7 Felix Matrices versus Felix Header Scalars Felix bld Scalar 0 Scalar 1 Scalar2
13. Multiple Contours threshold 0 1 0 6 steps gt 11 0 4 CLI 0 1 ai CLM 1 0 2 CPN 0 1 0 8 threshold 0 2 steps gt 3 d CLI 0 3 0 CLM 1 0 2 CPN 0 1 threshold 0 1 2 steps gt 5 0 2L CLI 0 1 0 CLM 1 5 0 2 CPN 0 Figure 4 27 The two plots above were contained in the file FM mif and imported directly to this document without further alteration The import command within FrameMaker is under the File option These plots were produced from the example code I Contouring for an individual level is performed in the routine contour level In this function the entire matrix is scanned for possible contours and these are hopefully converted into FrameMaker PolyLines The algorithm used is based on a three point search of all the data in the matrix Looping occurs over all matrix points horizontally as the column index changes more rapidly than the row index P ilmx j For each P asecond point is chosen which is the first diagonal relative to P namely i 1 mx j 1 These two points form the corners 2x2 sub matrix and a triangle is formed with a third point of this sub matrix first an upper triangle with point U ilmx j 1 then a lower triangle with point L i 1 mx j 1 The points in the last matrix row and column are never chosen as the point P but are included in the con touring as they will be taken as either P U or L eventually Copyright Ti
14. The number of bins is specified by the integer bins and should not exceed the number of points in the input data vector The default number is zero whereupon each point in vx is a separate bin Currently the data must be increasing monotonic It is recommended that filename end with mif to signify a FrameMaker MIF file Note block 1D can be substituted for row vector in the function call Each bin of the histogram may be manipulated individually within FrameMaker Return Value Nothing A new disk file is produced for incorporation into FrameMaker Example include lt gamma h gt main row_vector vx 51 create a data block row_vector vx1 51 vxl Gaussian 51 25 3 fill up data with Gaussian for int 120 1 51 i 1 complex i 1 1 FM_histogram FM mif vx bins output FrameMaker mif plot file Histogram Example 1 0 8 0 6 0 4 0 2 Hii iiullH 0 10 20 30 40 50 See Also FM 1 FM 1Dm FM xyPlot FM scatter Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 34 Graphics amp I O FrameMaker Functions 3 4 3 4 5 FM scatter Usage include lt FrameMaker h gt void FM scatter const char filename row vector amp vx int sides 0 double PGsize 0 double xsize 14 double ysize 14 void FM scatter const
15. are any scalar values For the intersection point we have Podere P e We need now substitute tersect aS described in the last equation into our equation for the contour plane Pos ok 0 Pintersect threshold k ek threshold k ek k 0 0 If we solve for the constant c zx cT rhreshold k e 0 ek C7 rhreshold k eX 0 cTek threshold k P4 e m hreshold k P1 eX Tek Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 65 Graphics amp I O FrameMaker Functions 3 4 and then substitute this back into our equation for the intersection point we attain 2 2 x o Ghreshold k Pi e Pintersect P1 c1 i ME EE Now we need only to described the line T in terms of quantities we already know to have a working formula for the intersection point We choose the simplest description of T T c4 P1 B5 P5 Our equation is then A A threshold k P 4 Pintersect Fit rm P3 P P5 ek and since the z components are the matrix points themselves we have E threshold P gt Pintersect P1 epep 2 where isa unit vector along the z direction and perpendicular to the contour level plane and where Po is any point other that the intersection point in the contour level plane The second in tersection point may be found by replacing point P2
16. main block_1D BLK Felix felix dat Get the first spectrum from felix dat FM_1D felix mif BLK Output spectrum to FrameMaker BLK Felix felix dat 127 Get the 128th spectrum in felix dat FM_1D felix2 mif BLK Output spectrum to FrameMaker Felix ID Example Output Spectrum 1 Spectrum 127 Figure 4 4 Example program result from use of the GAMMA function Felix to read a file The example reads two 1 D spectra from a Felix dat file This was applied to the file which was Copyright Scott A Smith May 22 1998 GAMMA Felix I O 82 Graphics amp I O generated and plotted in Example 3 for the function Felix on an earlier page of this document 5 5 3 Felix 2D Usage include lt Felix h gt block 2D Felix 2D const char filename int rowi 0 rows 0 Description The function Felix 2D is used to read 2 dimensional spectrum from a Felix dat file The Felix file name is filename typically something with a dat suffix such as name dat The 2D spectrum can be only part of a larger data set either 2D or ND To read a sub matrix the initial and number of rows to be read can be spec ified with the parameters rowi and rows respectively These both have default settings of zero to indicate that the entire dat file should be read as a single 2D matrix If only rows is left 0 it is assumed that the 2D matrix should be filled with the
17. stack Stack Plot Functions To Make Interactive GAMMA Plots Using Gnuplot GP 1Dplot Dimensional Plot Interactively IDm Multiple 1 DimensionalPlots 2 3 Index of Figures amp Tables Figure 4 1 Gnuplot Funcion GP 1D Example Figure 4 2 Gnuplot Function GP 1Dm Example Figure 4 3 Gnuplot Function GP xy Example Figure 4 4 Gnuplot Function GP contour Example Figure 4 5 Gnuplot Function GP stack Example Figure 4 6 Gnuplot 3D Spherical Plot Example Copyright Scott A Smith page 8 page 11 page 13 page 15 page 17 page 19 page 11 page 10 page 12 page 14 page 16 page 18 page 22 May 22 1998 GAMMA Gnuplot Output 8 Graphics amp I O Index of Figures amp Tables 2 3 2 4 Routines 2 4 1 GP 1D Usage include lt gnuplot h gt void GP_1D const char filename const row_vector amp vx int 0 double xmin 0 double xmax 0 double cutoff 0 void GP_1D ofstream amp ofstr const row_vector amp vx int ri 0 double xmin 0 double xmax 0 double cutoff 0 Description The function GP 1D writes the information contained in the input row vector vx in ASCII format to either a file or a file stream The integer flag ri dictates whether real ri 0 default imaginary ri 0 or complex val ues from vx will be output If xmax or xmax amp xmin are specified the horizonatal axes will be labeled the first point with the value of xmin and the last point with the value of xmax For some 1D
18. 1 32 1024 4 4 1 4 8 256 1 8 bld x 2 1024 32 1 1 1 1024 32 4 4 1 4 256 8 1 126 bld x 3 32 3280 1 1 1 32 32 8 2 2 1 1 2 4 16 16 16 1 16 256 bld x 3 32 8 320 1 1 1 32 8 32 2 1 2 1 2 2 16 16 16 1 16 256 bld x 3 8 32 32 1 1 1 1 8 32 32 1 2 2 1 1 2 8 16 16 1 8 128 Other Parameters Following the vector parameters the header contains various other param eters which track filenames etc The following table describes the other parameters and the last parameter in the header Table 6 Felix mat File Other Parameters Point Description Values Other 101 Total Number of Bricks in Data Matches Par 2 Includes 1 for Header 111 Number of Characters in mat File Filename lms 112 First Character in Filename ASCII character 113 Second Character in Filename ASCII character Copyright Scott A Smith May 22 1998 GAMMA Graphics amp I O Felix I O 100 Table 6 Felix mat File Other Parameters Point Description Values 111 nch Last Character in Filename ASCII character 220 First Character of 1st Dimension Reference Text Default D 221 2nd Character of 1st Dimension Reference Text Default 1 222 First Character of 2nd Dimension Reference Text Default 223 2nd Character of 3rd Dimension Reference Text Default 2 220 nd 1 First Character of Last Dimension Reference Text Default D 220 nd 2nd Character
19. 12 Euler Rotations About b and g page 48 Figure 4 13 sphere Example 1 Output page 50 Figure 4 14 sphere Example 2 Output page 51 Figure 4 15 sphere Example 3 Output page 52 Figure 4 17 Contours page 59 Figure 4 18 Multiple Contours page 60 Figure 4 20 Contouring Concept page 61 Figure 4 20 Contouring Theme page 62 Figure 4 21 Contouring Situation page 63 Figure 4 22 Contouring Situation page 64 Table 1 Eight 23 Triangle Based Contouring Situations Possible page 61 Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 27 Graphics amp I O FrameMaker Functions 3 4 3 4 FrameMaker Functions 3 4 1 FM_1D Usage include lt FrameMaker h gt void FM 1D const char filename row vector vx double xsize 14 double ysize 14 double min 0 double max 1 int 0 Description The function FM 1D creates a FrameMaker file called filename in the MIF format It will contain plot s of the data contained in the vector vx on the y axis versus point number on the x axis The plot s will be of di mension xsize by ysize in centimeters default to 14x14 cm plot The x axis produced will span a range min max which defaults to 0 1 The flag re dictates which plot s are produced For re 0 default only the real data is plotted For rc lt 0 only the imaginary data is plotted For re gt 0 both the real and imaginary plots are produced FrameMaker MIF files are typically named
20. 71 4 4 MATLAB Figures amp Tables MATLAB Example Plot 1 page 69 MATLAB Example Plot 2 page 69 MATLAB MAT File Structure page 70 MATLAB MAT Header Structure page 71 MATLAB MAT Matrix Data Structure page 71 1 MATLAB is a product of The Math Works Inc 21 Eliot Street South Natick MA 01760 Phone 508 653 1415 Telex 910 240 5521 FAX 508 653 2997 E mail na mathworks na net stanford edu GAMMA was written and used in conjunction with PRO MATLAB for Sun Workstations the most recent date on the supplied manual being Feburary 3 1989 Copyright Tilo Levante Scott A Smith May 22 1998 GAMMA MATLAB I O 67 User Documenation Routines 4 5 4 5 Routines 4 5 1 MATLAB Usage include lt MATLAB h gt void MATLAB const char filename const char dataname matrix amp mx int rc 1 void MATLAB File amp file const char dataname matrix amp mx int rc 1 matrix MATLAB const char filename const char dataname Description The function MATLAB is used to read or write MATLAB MAT files that is files in the standard MATLAB format The MATLAB file name is filename typically something with a suffix such as name mat 1 MATLAB const char filename const char dataname matrix amp mx int 1 When MATLAB is invoked with this argument list it writes the data contained in the matrix mx to a newly constructed file filename in the MATLAB MAT format The data is given the MATLAB internal var
21. Graphics amp I O Index of Figures amp Tables 2 3 Gnuplot Function GP xy Example astroid asc 1 0 8 0 6 0 4 0 2 0 0 2 04 06 08 1 Figure 4 3 Example program result from use of the GAMMA function GP xy The plot above was incorporated directly into this file using the MIF export type in Gn uplot After the plot is displayed on the screen the commands set terminal MIF set output plot mif and replot were given to have Gnuplot produce the plot in MIF format in the file plot mif The file plot mif was imported to this document with the FrameMaker import command under the File option See Also 1D GP 1Dm Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 15 Graphics amp I O Index of Figures amp Tables 2 3 2 4 4 Usage GP contour include lt gnuplot h gt void GP_contour ofstream amp ofstr const row_vector amp vx double row int row_inc 0 double xmin 0 double xmax 0 double cutoff 0 void GP contour ofstream amp ofstr matrix amp mx int row inc 0 double ymin 0 double ymax 0 double double xmin 0 double xmax 0 void GP contour ofstream amp ofstr matrix amp mx double row int row inc 0 double ymin 0 double ymax 0 double double xmin 0 double xmax 0 Description The functions GP contour is used to create contour plots in Gnuplot MIF format FM contour const char filename matrix amp mx double threshold int steps double CLI double CLM int
22. WEM oerte 114 7 4 4 dO vs 115 7 4 5 wite Parameter PNG 116 7 4 6 readParametet edet nee nens 116 7 4 7 Wite header ree etes i ete tois eris 117 7 4 8 read header iie Deo TD RO ET BER 117 7 4 9 print Beaded oet cette opa tet d tes Md es 118 7 4 10 Adr pe m M 118 7 4 11 PEE 119 7 4 12 119 7 4 13 ell De ie unu ALL 120 7 4 14 E E E 120 7 5 Class 1 DesScEIpUOHT bep eue 122 7 5 1 Introduction i eee 122 7 5 2 NMRiIEIleStr ct re oue coe ee esi ineo 122 7 5 3 NMR Bile Structure 123 7 5 4 NMRi Header Structure _ 124 7 5 5 1 35 m rere ER 125 7 5 6 GAMMA Treatment of NMRi Files oo cccccsessssccececeeeceessrsaeeeeeeeens 125 May 22 1998 GAMMA Introduction 6 Graphics and I O 1 Introduction This document discusses the ways in which GAMMA can be used to both input and output data in formats suitable for processing and or the production of graphical plots Actual plotting is inevita bly done using OTHER software Thus GAMMA only serves as a hub which manipulates data There are three data types in GAMMA which are often used to contain information that is to be displayed g
23. four cusps x cos theta x a cos theta 3 here a 1 y sin theta y a sin theta 3 here a 1 X x x x BLK i complex x y FM_xyPlot astroid mif BLK output FrameMaker mif plot file Copyright Tilo Levante Scott Smith Beat Meier May 22 1998 GAMMA FrameMaker Output 32 Graphics amp I O FrameMaker Functions 34 XY Plot Example 1 0 5 0 0 5 1 1 0 5 0 0 5 1 Figure 4 4 The two plots above were contained in the file FM mif and imported directly to this document without further alteration The import command within FrameMaker is under the File option These plots were produced from the example code See Also FM 1 FM 1Dm FM scatter FM histogram Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 33 Graphics amp I O FrameMaker Functions 3 4 3 4 4 FM histogram Usage Note this function works but is still under construction It may fail if the number of points does not far exceed the number of bins a factor of 2100 seems o k include lt FrameMaker h gt void FM histogram const char filename vector amp vx int bins 0 double xsize 14 double ysize 14 Description The function FM histogram creates a FrameMaker file called filename in the MIF format The plot will be of the data supplied by the vector vx and the plot dimension xsize by ysize in centimeters default to 14x14 cm plot
24. newfile dat float fdata 5 12 Declare a float array of 512 points file 1 write_header fdata Write all 512 parameters in fdata to filel s header 7 4 8 read header Usage include lt NMRiFile h gt float NMRiFile read_header Description The function read_header is used to read all 512 parameters contained in an NMRi file into a floating point array The NMRi file will be accessed directly regardless of where the file pointer is The file pointer will be immediately after the header at the start of the data Return Value This function returns a pointer to a floating point array Example include lt NMRiFile h gt main Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 118 User Documentation NMRifFile Figures and Tables 7 3 NMRiFile filel oldfile dat Open an old NMRiFile filel external name oldfile dat float fdata Declare a pointer to a float fdata oldfile read header Now fdata is an array filled with all header parameters 7 4 9 print_header Usage include lt NMRiFile h gt ostream amp NMRiFile print header ostream amp ostr int level 1 Description The function print header is used to send the parameter information contained in an NMRi file header into an output stream The returned output stream is the stream given in the first argument ostr with the header parameters added The second argument level set the amount of parameters to include in the ou
25. of Last Dimension Reference Text Default nd Last Point 4095 Status Flag 0 Bad 1 Good Copyright Scott A Smith May 22 1998 GAMMA Felix I O 101 Graphics amp I O 5 6 5 Felix Data Structure The matrix data points follow immediately after the Felix mat header These points are not stored in the typical matrix row column fashion one is accustomed to Rather Felix uses an internal sub block storage scheme which can make both matrix column and row access relatively quick We will begin this discussion talking about the more familar 2 dimensional arrays since even with these conceptually easier structures it is difficult to see what Felix is doing The first thing to note is that Felix does not associate its dimensions with rows or columns This is immediately evident to anyone who has plotted a non square array with the program Usually an mxn matrix is thought to contain m columns and n rows and when sketched out on paper it ap pears just that way Not so for Felix arrays Felix plots dimension 1 horizontally and dimension 2 vertically the exact opposite of common matrix nomenclature This can be seen in the following diagram Typical Matrices versus Felix mat 2D Matrix 256 x 512 bld 2 256 512 bld 2 512 256 Matrix 2 D Matrix 2 D Matrix columns ___ gt DI Also unlike the Felix dat file matrix files have a block unit which is set to be of length 4096 for all mat files Thus the
26. positive contours are output while for CPN 1 only the negative con tours are done The output file contour plot will be of dimension xsize by ysize both given in centimeters default 10 cm Contour Parameters filename Although not mandatory this should be name mif where the mif indicates a FrameMaker file mx Can be any matrix or block 2D in GAMMA Note that it is the real data that is contoured threshold This can be a positive or negative quantity If both positive and negative contours are to be per formed the absolute value will be taken for the first contour of the positives and the negative of the absolute value taken as the first contour of the negative levels This is shown in the following figure where the dashed line indicates the value of threshold and the arrows indicate the direction of subsequent contour levels Choosing Contour Levels o oooo oooo CPN 0 CPN 1 CPN 1 threshold 0 1 threshold 0 6 threshold 0 1 Figure 4 8 Depiction of the two basic parameters for picking contour levels steps This is the number of contour levels to plot The default value is 3 and the maximum value is set to 20 If both positive and negative contours are output there will be still be this number performed in both contour directions Note that the contours may not be visible in the plot if there is no data in the input matrix corre sponding to the contour level CL
27. sphere for plotting a coordinate vector The value of type indicates whether the plotted data should be a solid line individual points or vectors see Example 3 The function rotate is a member function of a coordinate vector The sphere size default 5 cm radius was altered to 2 5 cm radius within FrameMaker Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 52 Graphics amp I O FrameMaker Functions 3 4 Example 3 include lt gamma h gt main int size 31 Set 31 points coord vec trajl size Declare two coordinate vectors coord_vec traj2 size double xx yy theta for int 120 i lt size i Fill coordinate vectors Trajectory 1 is in the yz plane theta PI 2 0 i size 1 decreasing from 001 to 010 xx cos theta Trajectory 2 is in the xz plane yy sin theta decreasing from 100 to 00 1 traj1 put O yy xx i traj2 put xx 0 yy 1 FM sphere FM sph2 mif trajl Output FrameMaker MIF file traj2 2 0 0 15 0 45 0 Euler angles for nice perspective FM_sphere Example 3 Output Figure 4 23 The two plots above were contained in the file FM mif and imported directly Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 53 Graphics amp I O FrameMaker Functions 3 4 to this document without further alteration The import command within FrameMaker is under the File option These plo
28. subdir Copyright Scott A Smith May 22 1998 GAMMA Felix I O 89 Graphics amp I O Thats all there is to it You work up you data in a Felix matrix to get it into a desired format then execute the macro to spit out any need rows into a concatonated file The following stack plot was produced in this fashion 1 GAMMA was used to perform a simulation a decopuling experiment which output an unprocessed Felix dat file 2 Felix was used to process the simulated data into a Felix mat file 3 The Felix macro listed previously was used to output the Felix matrix file into a concatenated Felix dat file The GAMMA program listed previously was used to read in the con catonated file and output a FrameMaker stack file shown below Felix Concatonation Example Output yB Hertz 1125 v Hertz Figure 4 6 Example program result from use of the GAMMA function Felix 2D It is preferable to use the Felix matrix functions provided but if they fail this function can be very handy and perform the same feats with a bit of work Copyright Scott A Smith May 22 1998 GAMMA Felix I O 90 Graphics amp I O 5 5 6 Usage Felix m
29. takes aGAMMA matrix and slices through specified contours to produce a FrameMaker MIF output file An attempt is made to group all points for each specific contour line together as a single PolyLine Following this all PolyLines for a specific contour level are grouped together As a last step all positive contours are grouped together as are all negative con tours The contouring algorithm processes the matrix in the following general order I Function arguments are checked for validity and adjusted if necessary contour_setup I Any positive or increasing contours are first taken followed by any negative contours I Individual contours are converted to FM PolyLines in the function contour_level I Contours are grouped together as all positives and or all negatives in group_contours I Initially the function FM_contour checks its input arguments with the auxiliary function contour_setup This function first checks that the overall plot size is reasonable xsize 5cm 20cm amp ysize 5cm 27cm Then it insures that the input matrix is large enough to be contoured the smallest allowed matrix is 5x5 A scaling factor for cm point is then computed this is the same in both dimensions to keep the relative contour plot size proper in the two dimen sions The next check looks for the matrix global maximum and minimum If these are the same the matrix will contain no contours and the function signals an error A check is also made to insure tha
30. this function end with mat Return Value Nothing when producing a MATLAB file a matrix when reading a MATLIB file Example include lt gamma h gt main File fp Specify a file pointer Copyright Tilo Levante Scott A Smith May 22 1998 GAMMA User Documenation MATLAB I O Routines 68 4 5 fp open twomxs mat io writeonly a create Open file twomxs mat matrix mx 101 101 block 1D BLK 101 BLK1 101 BLK sinc 101 50 10 for int 120 i lt 101 i for int j 0 j lt 101 j mx i j BLK 1 BLK MATLAB onemx mat mx1 mx 0 MATLAB fp mx1 mx square wave 101 20 70 for int k 0 k 101 k for int 120 1 lt 101 1 mx k l BLK k BLK1 1 MATLAB fp mx2 mx fp close Define a matrix Define two 1D data blocks First block to sinc function Fill matrix with sinc by sinc Output MATLAB file onemx mat reals Put matrix into file twomxs mat complex Fill block with box function Fill matrix with sinc x box Put matrix into file twomxs mat Close file twomxs mat matrix mx2 Define a second matrix for fun mx2 MATLAB twomxs mat mx2 Read file twomxs mat retreive mx2 In this example a file onemx mat is produced contaning a single matrix in the MATLAB MAT format A sec ond file twomxs mat is also produced which contains two matrices useable by MATLAB In this latter case the user ope
31. usage the Return Value Nothing the function is void The NMRi file will not be modified Example include lt NMRiFile h gt main NMRiFile filel oldfile dat Open an old NMRiFile filel external name oldfile dat mstrix mx Declare a general matrix block 1D Declare a 1D data block block 2D BLK2 Declare a 2D data block file 1 read mx Read all the data points in oldfile dat into matrix mx file 1 read BLK2 Read all data points in oldfile dat into 2D block BLK2 Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 116 User Documentation NMRifFile Figures and Tables 7 3 7 4 5 writeParameter Usage include lt NMRiFile h gt void NMRiFile writeParameter int pos mx float par void NMRiFile writeParameter int pos int par Description The function writeParameter is used to write parameters into an NMRiFile For this function the value of the argument pos indicates which parameter relative to the beginning of the file is to be written The value of the parameter itself par can be input as either a floating point number or an integer Return Value Nothing the function is void The NMRi file will be modified by having the parameter specified altered Example include lt NMRiFile h gt main a create Open file NMRND tst 7 4 6 readParameter Usage include lt NMRiFile h gt void NMRiFile readParameter int pos mx float amp par void NMR
32. with a mif suffix so it is recommended that all filenames used for this function end with mif Return Value Nothing a new disk file in the MIF is produced for incorporation into FrameMaker It will contain either one SEES or two plots depending on the flag Example include lt gamma h gt main row_vector vx 101 Block for data points double x y Working x y ordinates for int 120 i lt 101 i Fill up data block x double i 50 Offset x so centered y x x x 125000 Cubical parabolic imag x x x 2500 Parabolic into reals vx put complex x y 1 Store this point FM_1D FM mif BLK 10 5 50 50 1 Output FM mif both plots Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 28 Graphics amp I O FrameMaker Functions 3 4 FM ID Example Output 1 1 0 8 s 0 6 0 4 0 2 0 5 0 1 40 20 0 20 40 40 20 0 20 40 Figure 4 2 The two plots above were contained in the file FM mif and imported directly to this document without further alteration The import command within FrameMaker is under the File option These plots were produced from the example code See Also FM 1Dm FM xyPlot FM scatter FM histogram Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 29 Graphics amp I O FrameMaker Functions 3 4 3 4 2 FM_1Dm Usage include lt FrameM
33. with point U or L in the previous equation As the matrix is scanned over a specific contour level by investigating all of the possible trian gles sets of two points are constantly passed to the function PL contour These are stored in dual matrices of contour lines for the level being contoured one set which is increasing to the left and the other which is increasing towards the right As contributors to the contour lines for the contour level being treated are found they are treated in three distinct ways I Points are not connected to any previous lines found start a new contour line I Points are a continuation of a previous contour line add it to existing contour I Points connect two previous contour lines concatenate two existing lines into one I Points connect a previous contour to form a closed contour output contour line PolyLines are stored one branching off from the first point to the left and another branching off from the first contour point to the right Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA MATLAB I O 66 User Documenation 4 MATLAB I O 4 1 Overview The MATLAB I O routines are provided to allow the transfer of matrices between GAMMA and the program MATLAB 1 4 2 Available MATLAB Functions MATLAB page 67 4 3 MATLAB Discussion MATLAB File Structure page 70 MATLAB MAT File Header Structure page 70 MATLAB MAT File Data Structure page
34. ysize are both set to 10 cm Return Value Nothing A new disk file is produced for incorporation into Gnuplot Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 16 Graphics amp I O Index of Figures amp Tables 2 3 Example include lt gamma h gt main matrix mx 101 101 Data matrix row_vector vx1 101 vx2 101 Two working blocks of length 101 vx sinc 101 50 10 Use provided window sinc function vx2 sin square 101 50 Use provided window sin squared function for int 120 1 lt 101 i Loop through and fill up the matrix for int j 0 j 101 j mx put vx 1 get i vx2 get j i j String afile contour asc Output ASCII file name GP_contour afile mx Write the ASCII file for Gnuplot GP_contplot contour gnu afile Interactively output contour plot Gnuplot Function GP_contour Example contour asc 0 797 0 595 0 392 0 189 m 0 0135 50 Figure 4 4 Example program result from use of the GAMMA function GP stack See Also FM stack Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 17 Graphics amp I O Index of Figures amp Tables 2 3 2 4 5 GP stack Usage include lt gnuplot h gt void GP_stack ofstream amp ofstr const amp row_vector double row int row_inc double xmin double xmax double cutoff 0 void GP stack String amp filename matrix amp mx int row inc 0 double ymi
35. 0 2 CPN 0 Figure 4 9 Examples depicting function arguments vs contour levels chosen Setting CPN to 1 will produce the same levels as well as those mirrored vertically about 0 except that the input threshold must be greater than 0 Thus keeping the setting as in the above diagram the but with CPN 1 will force the function to internally alter these input thresholds CPN This is a flag to indicate whether positive or increasing negative or decreasing or both positive and negative contours If CPN 0 only contours increasing from the set threshold will be computed If CPN 1 only contours decreasing from the set threshold will be computed If CPN 1 default contour will be computed increasing from Ithresholdl and decreasing from Ithresholdl xsize ysize These determine the overall plot dimensions the FrameMaker output will assume The values are input in centimeters and are defaulted to 10 cm each The values do nothing to the relative x to y scaling implicit in the data matrix thus a 256 by 512 array will be 5 x 10 cm even though xsize and ysize are both set Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 39 Graphics amp I O FrameMaker Functions 3 4 to 10 cm Return Value Nothing A new disk file is produced for incorporation into FrameMaker Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 40 Graphics amp I O FrameM
36. 64 12 Set block to sinc function BLKB 127 1 NMRi fp BLKB 0 1 Last 1 needed as previous NMRi files used for i 1 1 lt 128 i Output 128 1D blocks to NMRi file only the reals are output here BLKB i BLKA 127 i BLK1 Copyright Scott A Smith May 22 1998 GAMMA NMRi I O 108 User Documenation Routines 6 3 NMRi fp BLKB 0 fp close Close file NMRND tst The last NMRi file produced NMRND tst was made by first opening a file successively writing 1D spectra to it then closing the file Since this program accessed NMRi files previously during the creation of NMRID tst and NMR2D tst the first spectrum was independently written outside the loop with the zero flag set when calling NMRi This sets the internal counter to zero something unnecessary had NMRi files not been previously created in the program 6 3 2 NMRi 1D Usage include lt NMRi h gt block 1D NMRi 1D const char filename int spectrum 1 Description The function NMRi 1D is used to read a 1D spectrum from an NMRi file that is a file in the standard NMRi format The NMRi file name is filename Returned is an 1D data block containing the parameters in the NMRi file along with the spectrum chosen with spectrum The default spectrum will be the initial one Return Value A one dimensional data block Example 6 3 3 NMRi 2D Usage include lt NMRi h gt block 2D NMRi 2D const char
37. 7 05 21 33 GMT 1993 Copyright C 1986 1993 Colin Kelley Thomas Williams Send comments and requests for help to info gnuplot dartmouth edu Send bugs suggestions and mods to bug gnuplot dartmouth edu Terminal type set to x11 gnuplot set data style line gnuplot gt set parametric dummy variable is t for curves u v for surfaces gnuplot gt set angles degrees gnuplot gt set title 3D Trajectory gnuplot gt set nokey gnuplot gt set view 80 140 6 2 5 gnuplot gt set mapping spherical gnuplot gt set samples 32 gnuplot gt set isosamples 9 gnuplot gt set urange pi 2 pi 2 gnuplot gt set vrange 0 2 pi gnuplot gt splot cos u cos v cos u sin v sin u with lines 3 4 sphere asc with lines 1 2 gnuplot gt set terminal mif Terminal type set to mif Options are colour polyline gnuplot set output x mif gnuplot gt replot gnuplot gt quit The last lines produce a MIF file that is shown in the next figure Other than being resized is has not been altered within FrameMaker although it could be Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 22 Graphics amp I O Index of Figures amp Tables 2 3 Gnuplot 3D Spherical Plot Example 3D Trajectory Figure 4 6 Example program result illustrating production of 3D spherical plots Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 23 Graphics amp I O Index of Figures amp Tables 2 3 2 7 Additional Hints 271 Gnuplot Contour Plo
38. 98 GAMMA Felix I O 76 Graphics amp I O Example 1 For this first example the function is used to output a 1D NMR spectrum The data block data is filled with the simulated FID of a two spin system following a simple 90 degree pulse include lt gamma h gt main spin_system ab 2 Create a spin system with 2 spins ab shift 0 700 5 Set chemical shift of fist spin to 700 5 Hz ab shift 1 600 Second spin to 600 Hz ab J 0 1 20 Coupling to 20 Hz gen_op sigma H detect Declare the operators sigma sigma_eq ab Set the density matrix to equilibrium H Ho ab Set isotropic liquid Hamiltonian detect Fm ab Set the detection operator to F lock 1D data 2048 Declare a block for data sigma Iypuls ab sigma PI 2 Apply a PI 2 y pulse FID sigma detect 0 0005 2048 data Calculate the FID after the pulse Felix felix dat data Output the Felix dat file The last line of the program creates the file felix dat readable by Felix The file contains a complex FID which is worked up in Felix to produce an NMR spectrum The commands and spectrum from Felix are shown below Felix 1D Spectrum Output 1 re felix dat 2 1b 5 3 em 4 ft 5 ref 1024 6 ax 2 7 dr 400 400 Hz Figure 4 1 Example program result from use of the GAMMA function Felix Copyright Scott A Smith M
39. C 2 0 2 4 6 8 Figure 4 6 The plot above was contained in the file FM mif and imported directly to this document Minor alterations were performed in FrameMaker coloring sizing and axis font changes The import command within FrameMaker is under the File option Each symbol can be manipulated individually or all simultaneously within FrameMaker Thus one can fill the circles change their sizes etc after the plot has been produced The next example demonstrates this ability and the use of characters to mark the points Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 36 Graphics amp I O FrameMaker Functions 3 4 include lt gamma h gt main block_1D BLK 101 create a data block double x y a 3 declare needed variables for int i20 1 lt 51 i fill block with Strophoid y 2 x 2 a x a x x 5 5 1 50 2 5 y sqrt x x a x at x BLK complex x y BLK 100 1 complex x y FM scatter FM mif BLK b Output FM scatter plot letter b marking points FM scatter Example 2 Output bb bbbbbbbbbbbbbbbbbbbbp Ir pb ERE 1 i j 3 Figure 4 7 This plot above was also produced into a file called FM mif and imported directly to this document It has be subsequently altered within Framemaker First the overall plot dimensions was changed from the def
40. Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 13 Graphics amp I O Index of Figures amp Tables 2 3 2 4 3 GP xy Usage include lt gnuplot h gt void GP xy const char filename const row vector amp vx void GP xy ofstream amp ofstr const row vector amp vx Description The function GP xy creates an ASCI file filename in a format suitible for use in Gnuplot Unlike function GP 1D which assumes the data is monotonically increasing on the horizontal axis GP xy produces plots in parametric fashion i e true x versus y The plot will be of the data supplied by the vector vx It is recommend ed that filename end with asc to signify an ASCII file Return Value Nothing A new disk file is produced for use in Gnuplot Example include lt gamma h gt main row_vector data 360 Create a data block double x y theta Declare needed variables for int 1 0 1 lt 360 i Loop through 360 degrees Fill up block with Astroid theta 1 2 0 PI 360 0 also called a Hypercycloid of four cusps cos theta a cos theta 3 here a 1 y sin theta y a sin theta 3 here a 1 X x x x y y y y data put complex x y 1 Store the data point GP_xy astroid asc data Output Gnuplot mif plot file GP_xyplot asteroid gnu astroid asc Interacitvely plot to screen Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 14
41. Data type 0 0 quadrature 1 0 singulature 2 0 singulature sorted 220 Second dimension size This is SPECNUM in Figure 29 1 230 Second dimension spectral width Other parameters which should be included according to the NMR2 manual are the following 120 Spectrometer Frequency F2 Observe Frequency 153 First Dimension Units 219 Spectrometer Frequency F1 Observe Frequency 221 First Dimension Transform State 222 Transpose State 223 Second Dimensiton Transform State 235 Second Dimension Units For consistency with the program description found in the supplied manuals the file structure will be briefly discussed in terms of blocks each block being of length 64 Thus the header takes up 4 blocks NMRi Header Structure SSeS es Figure 29 2 Header Structure of a NMRi file The header is conceptually divided into 4 blocks each containing 64 parameters 1 The block length of 64 is intrinsic to the file structure as utilized in the FORTRAN code for file I O supplied with the NMRi programs GAMMA uses C code to perform its I O regarding NMRi files rendering this conceptual division unnecessary Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 125 User Documentation NMRifFile Figures and Tables 7 3 7 5 5 NMRIi Data Structure The actual data starts immediately after the header In a file containing multiple spectra i e a 2D spectrum each spectrum mus
42. GAMMA Graphics Documentation Author Scott A Smith Date May 22 1998 Graphics Chapters Introduci n 6 Ghu DIOC OULDUE EEEE EERE 7 va wee La EE a 24 MATLAB VO out iota itur odis s tot od ecd 66 ERES 73 NMR VO DIT 106 ase Leh M ESPNER 112 GAMMA Table of Contents Graphics amp I O iii 1 2 2 3 2 4 2 4 1 2 4 2 2 4 3 2 4 4 2 4 5 2 5 2 5 1 2 6 2 6 1 2 7 2 7 1 2 7 2 3 34 22 3 3 3 4 3 4 1 3 4 2 3 4 3 3 4 4 3 4 5 3 4 6 3 4 7 3 4 8 3 5 3 5 1 3 5 2 3 6 3 6 1 FHtFOQUCHOR ded t roe to dee ua 6 Output FU eMe e GRP A GP etit tetto qu Routines for Interactive Plotting Using Gnuplot GIPDIDplOot ae dea eot Additional Example S endete oec a inca deb Niquilq de Additional Cmuplot Contour Plots Gnuplot Stack Plots FrameMaker Output 24 FrameMaker Overview EM XyPlo
43. I CLM These are the linear and geometric factors which change the contour levels at each step CLI must Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 38 Graphics amp I O FrameMaker Functions 3 4 have a positive value regardless of whether one desires positive or negative contours CLM must be positive and gt 1 Typically CLM ranges between 1 default and 2 The first contour will occur at the value set by threshold level 0 threshold The next contour will be determined strictly by the threshold value and the value of CLI namely level 1 threshold CLI Subsequent levels are determined jointly by the values of CLM Contour Level Modifier and CLI Contour Level Increment Generally the contour levels above the initial level 0 are determined from level i level i 1 CLI Note that there is a default setting of CLI to zero which flags the contour function s to determine an appropriate CLI for the number of steps input Below are a few 1 dimensional plots depicting how CLM and CLI interact Setting CPN to 1 would will keep the contour spacing the same but they will decrease in height from the initial level Multiple Contour Levels m threshold 0 1 0 6 steps gt 11 0 4 CLI 0 1 1 0 2 CPN 0 1 0 8 threshold 0 0 6 steps gt 3 a L CLI 0 3 0 CLM 1 _0 2 CPN 0 1 0 8L threshold 0 1 na steps gt 5 02 CLI 0 1 0 CLM 1 5
44. MATLAB Example Plot 1 m T T J I S I 2 n s 2 NS Ww S WO SN Jj n NN NN Soe a x NN SSS SSN By default the northwest corner is the matrix point 0 0 and the southwest corner 0 ncols 1 The MATLAB commands here separated by semicolons for brevity load twomxs mesh mx1 meta MLmx1 mesh mx2 meta MLmx2 exit produce the two MATLAB meta files MLmx1 and MLmx2 These are subsequently converted to hpgl format by the commands issued in UNIX again separated by semicolons for brevity gpp MLmx1 dhpgl gpp MLmx2 dhpgl which takes the MAT files and produces HPGL plot files MLmx1 hpgl and MLmx2 hpgl These are then con verted to encapsulated postscript by issuing the commands from UNIX hpgltoeps MLmx1 hpgl MLmx1 hpgltoeps MLmx2 hpgl MLmx2 which creates the two files MLmx1 and MLmx2 These are plotted above and were incorporated into this doc ument using the Import option under File at the top of the document in FrameMaker Copyright Tilo Levante Scott A Smith May 22 1998 GAMMA MATLAB I O 70 User Documenation Routines 4 5 4 6 Description 4 6 1 MATLAB MAT File Structure MATLAB always maintains its ta as matrices and each MATLAB MAT fi le may c m veral matrices Internally e ach m atri ispre eede Ds a header whi ch contains the inform i uard ing the data size the matri dr forth This scheme is depicted in e figu
45. MRi manual LAB ONE NMR1 USER MANUAL Release 3 8 on page 1 37 Of the 512 pa rameters it contains few are useful outside of the NMRi programs Those absolutely required are given in the NMR2 manual cited previously on page 28 and listed here 100 First dimension size This is SIZE in Figure 25 1 101 First dimension spectral width 107 Data type 0 0 quadrature 1 0 singulature 2 0 singulature sorted 220 Second dimension size This is SPECNUM in Figure 25 1 230 Second dimension spectral width Copyright Scott A Smith May 22 1998 GAMMA NMRi I O 111 User Documenation Routines 6 3 For consistency with the program description found in the supplied manuals the file structure will be briefly discussed in terms of blocks each block being of length 64 Thus the header takes up 4 blocks NMRi Header Structure a ee ee ee Figure 25 2 Header Structure of a NMRi file The header is conceptually divided into 4 blocks each containing 64 param eters NMRi Data Structure The actual data starts immediately after the header In a file containing mul tiple spectra i e a 1D spectrum each spectrum must be of the same size and this size must be a power of 2 64 128 256 If the any spectrum does not meet this latter requirement it will be padded with zeros until the size is a power of 2 Furthermore they must all be real or all be com plex NMRi Data Structure SIZE Reals SIZE Imaginari
46. OOCKcJXODOOOOOOoooo 9000 0000 9660 eooooOOOOCKCOOOOOOoooo D 0000 9090 lt 09 0 2 9 o gt o COOOKAIOAOGNA o e Figure 4 2 Example program result from use of the GAMMA function Felix Copyright Scott A Smith May 22 1998 GAMMA Felix I O 78 Graphics amp I O Each data row is successively written so that Felix can read them in the dat format For the above plot felix dat was read into a Felix matrix with a macro and then contoured An hpgl output file was then produced from Felix and transformed into encapsulated postscript eps with a program provided by FrameMaker The eps file was imported into this document in FrameMaker and re sized The Felix macro which produced the matrix file is as follows the comments off to the side are not part of the macro bld felix 2 256 256 1 build a felix 2D matrix 256x256 real mat felix mat write open the matrix created for writing for row 1 256 loop through each row of the matrix re felix dat successively read each row of the dat file red set the row to be real not complex sto 0 amp row store the row in the matrix typ row amp row write to standard output this has been done next go back for the next row end Once this macro has been executed in Felix the commands to produce the contour plot on the screen are Iv1 0 000000001 set contour l
47. Scalar3 Matrix Matrix Command Dimensions Type Bricks Blocks Filesize Points bld test 2 512 512 0 2 1 65 8 1064960 262144 bld test 2 512 512 1 2 2 129 16 2113536 524288 Copyright Scott A Smith May 22 1998 GAMMA Graphics amp I O Felix I O 104 Table 7 Felix Matrices versus Felix Header Scalars Felix bld Scalar 0 Scalar 1 Scalar2 Scalar3 Matrix Matrix Command Dimensions Type Bricks Blocks Filesize Points bld test 2 256 512 0 2 1 33 amp 540672 131072 bld test 2 512 256 0 2 1 33 amp 540672 131072 bld test 2 256 512 1 2 2 65 8 1064960 524288 bld test 2 512 256 1 2 2 65 8 1064960 524288 bld test 2 32 1024 0 2 1 9 4 147456 32768 bld test 2 1024 32 0 2 1 9 4 147456 32768 bld test 2 32 1024 1 2 2 17 4 278528 65536 bld test 2 1024 32 1 2 2 17 4 278528 65536 bld test 3323260 3 1 5 2 81920 8192 bld test 3 32 8 320 3 1 5 2 81920 8192 bld test 3 8 32321 3 2 5 2 81920 16384 As seen from the above table the number of stored dimensions and the matrix data type is straight forward The number of bricks which felix uses can be determined by the formula bricks rpts 4096 1 where rpts is the total number of real points in the matrix The minimum value of bricks allowed by felix is 5 i e the smallest Felix mat file takes up 81920 bytes One can easily determine the size of the mat file from the following equation fil
48. T2SIZE 4 gt 12517 2 DosIZE 3 T2SIZE 1 REAL Tot 1203 PL CL Figure 4 9 Data Structure of an Felix dat file There are SIZE complex points or 2 SIZE individual real points Complex points are stored real then imaginary The storage of all reals versus com plex is specified by the second parameter in the header Felix may not use all of these points that depends upon what the value of DSIZE was set to in the previous header block 5 6 3 Felix File Structure Each file mat internally consists of a header followed by the spectral data Unlike a dat file there must be one and only one matrix header in each mat file residing at the start of the file It contains all parameters associated with the data set and is a block of integers floats and characters of length 4096 The matrix data points follow immediately after the header 1 Why this is allowed is a mystery as it wastes disk space Fortunately the number of points expected will not exceed the number which are stored 2 This deviates from the program FTNMR FTNMR always needs the number of complex points Copyright Scott A Smith May 22 1998 GAMMA Felix I O Graphics amp I O 95 Felix mat File Structure 0 1 2 3 e HEADER 4093 4094 4095 MATRIX DATA Copyright Scott A Smith May 22 1998 GAMMA Felix I O 96 Graphics amp I O 5 6 4 Felix File Header As sho
49. ained in the 1 dimensional data block BLK in the Felix dat format to wherever the file point er file is at The file where file is pointing is assumed to be open opened explicitly sometime prior to the function call and will remain open with the file pointer advanced to the file end at the function return The file should be closed externally as well The flag reset tells the program whether or not to write any header information If you do not desire the header information to be written in the Felix dat file then this is inconsequential If your program has not called a Felix function in connection with another file then this is unimportant If you want the header and have used function Felix earlier in your program to generate a file then you must reset the Felix function to tell it the header should be output For this reset is set to a non zero number on the first and only the first function call on the newly opened file attached to fp Felix dat files are typically named with dat suffix so itis recommend that all filenames used for this func tion end with dat Furthermore Felix has trouble recognizing capitol letters at least in UNIX so filenames should be all lower case letters Note Felix has difficulties with real data It is now mandatory that the user specifies the data set is real with in Felix itself Return Value Nothing A new disk file in Felix dat format is produced Copyright Scott A Smith May 22 19
50. aker Functions 3 4 Example include lt gamma h gt main matrix mx 101 101 create a 101x101 matrix for data row vector sinc 101 50 10 use provided window sinc function row vector BLK2 sin square 101 50 use provided window sin squared function for int 120 1 lt 101 i loop through and fill up the matrix for int j 0 j lt 101 j mx i j BLK1 i BLK2 FM_contour contour mif mx 05 10 05 create file FM contour file contour mif FM_contour Example Output oooo Or ROO CORDE Re Figure 4 10 Contour plot of the 101x101 matrix which is a 2 on one axis and a sinc y on the other axis The first contour is set at 0 05 and increments by 0 05 up and down over 10 con tours of which only four of the negative contours exist The file contour mif was incorporated directly contained in the box to this document using the FrameMaker import command The plot was resized and the negative contour lines switched to dashed for highlighting The two 1D plots were independently generated with FM 1D and added for clarity See Also FM stack Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 41 Graphics amp I O FrameMaker Functions 3 4 3 4 7 FM_ stack Usage include lt FrameMaker h gt void FM stack const char filename matrix amp mx double xinc double yinc int row inc do
51. aker h gt void FM 1Dm const char filename int N row vector vxs Description The function FM 1Dm creates a FrameMaker file called filename in MIF format It will contain plots of the data contained in the N vectors which are pointed to by vxs These plot s may be further manipulated from within FrameMaker itself FrameMaker MIF files are typically named with a mif suffix so it is recom mended that all filenames used for this function end with mif Return Value Nothing A new disk file in the MIF is produced for incorporation into FrameMaker It will contain either one 66 7 or two plots depending on the flag Example include lt gamma h gt main int i j N 5 This many plots row_vector vxs 5 vx 101 Blocks for data points for i 0 i lt N i vxs i vx Initilize the 5 blocks double x Working x y ordinates for i 0 1 lt 101 i Fill up data blocks x double i 50 Offset x so centered x x x 2500 Parabolic function for j20 j N j vxs j put complex j x i Store this point FM_1Dm FM mif vxs Output to FM mif N plots Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 30 Graphics amp I O FrameMaker Functions 3 4 FM IDm Example Output 0 0 0 2 0 4 0 6 0 8 1 Figure 4 3 The two plots above were contained in the file FM mif and imported directly to this document I did som
52. alled filename in the MIF format It contains a single 3D plot which has been projected after rotation by the Euler angles alpha beta and gamma input in degrees to produce the desired perspective 1 sphere const char filename int type double alpha double beta double gamma double radius int points Used in this manner the function plots no data only coordinate axes and or a coordinate sphere depending on the value of type For type 0 the three coordinate axes are drawn of unprojected length 2 radius For type 0 the coordinate sphere having radius of radius is drawn along with it s intersection with the three planes xy xz amp yz For type 2 both the axes and the sphere are drawn The value of points specifies how many points to use when drawing each sphere plane intersection 2 FM sphere const char filename double coord vec int type double alpha double beta double gamma double radius int points When the function is called with these arguments it draws the plot produced in the description above 1 with both axes and the coordinate sphere It then adds the data contained in the coord vec data to the plot 3 sphere const char filename double coord vec double coord vec int type double alpha double beta double gamma double radius int points When the function is called with these arguments is the same as the previous description 2 but plots both data sets datal and data2 2D Projection
53. alue of extremum is set to the maximum or minimum contour level If contouring is set in the function call to go beyond the matrix maximum minimum the value of extremum will stop unnecessary contouring Thus contouring for positives or negatives will stop if abs threshold abs extrem um As looping begins over the number of contours desired steps the contour number is set to level the contour value is set to acthresh and the contour ID conID is set Actual contouring on an in dividual level is performed is the auxiliary function contour level When contouring is completed for a value of acthresh the value is adjusted and the loop continues to the next contour level The contour levels are set to change either monotonically or geometrically depending upon the value of CLM acthresh acthreshy CLI x CLMlevel 1 When CLM 1 the levels will change monatomically and when CLM gt 1 the levels change in geo metric fashion 1 The contour ID is set for use in FrameMaker Each contour is given an individual ID so that it is a specific graphic object within FrameMaker Subsequently each contour may be independently manipulated within FrameMaker 2 Values where CLM lt 0 are disallowed If the function is called with CLM 0 itis replaces by CLM abs CLM in the function contour setup Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 60 Graphics amp I O FrameMaker Functions 3 4
54. ample 1 0 8 0 6 0 4 0 2 Figure 4 1 Example program result from use of the GAMMA function Felix See Also Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 11 Graphics amp I O Index of Figures amp Tables 2 3 2 42 GP_1Dm Usage include lt gnuplot h gt void GP 1Dm const String amp filename row vector vx int N int ri 0 double xmin 0 double xmax 0 int cutoff 20 Description The function GP 1Dm creates an ASCII file called filename suitable for reading and plotting with Gnuplot It will contain plot s of the data contained in the array of vectors vx on the y axis versus point number on the x axis The number of vectors in the array vx to plot is given by the integer N The x axis produced will span a range xmin xmax which defaults to 0 1 The flag ri dictates which plot s are produced For rc 0 default only the real data is plotted For rc lt 0 only the imaginary data is plotted For rc 0 both the real and imaginary plots are produced For some 1D plots points in the Gnuplot output file may be skipped and hence from smooth data the output file size reduced This is done automatically by this GAMMA function the value of cutoff indicative of what point variation is considered roundoff Note that some type of plotting do not allow for skipped points and the value of cutoff should be left at zero Return Value Nothing A new disk file in ASCII is produced for plotting wi
55. as read into a Felix matrix with a macro and then appropriate parameters were set for a reasonable stack plot An hpgl output file was then pro duced from Felix and transformed into encapsulated postscript eps with a program provided by FrameMaker The eps file was imported into this document in FrameMaker and resized The Fe lix macro which produced the matrix file is as follows the comments off to the side are not part of the macro bld felix 2 128 128 1 build a felix 2D matrix 128x128 real mat felix mat write open the matrix created for writing for row 1 128 loop through each row of the matrix re felix dat successively read each row of the dat file red set the row to be real not complex sto 0 amp row store the row in the matrix typ row amp row write to standard output this has been done next go back for the next row end Once this macro has been executed in Felix the commands to produce the contour plot on the screen are loa 0 128 load the last row of data dr have a look at the row on the screen loa 50 0 load the 50th column of data dr have a look at the column on the screen dx 0 4 set the x axis skew dy 0 4 set the y axis skew sp generate the stack plot on the screen To generate the hpgl contour plot file the Felix commands are once cp produces the screen plot hdv felix hpgl hardcopy device is file felix hpgl hpm 32 hardcopy plot mode is hpgl hcp produce the plot Finally to produce the
56. at include lt Felix h gt void Felix mat const char filename block 2D amp BLK int rc 1 void Felix mat File amp fp block 1D amp BLK int rc 1 int reset 0 Description The function Felix mat is used to write Felix mat or matrix files The data is contained in the data block BLK The file is specified either by a file name filename or by a pointer to an open file fp The parameter rc specifies whether real or complex data is written For real rc 0 and for complex rc 1 This will default to complex if left out of the function argument list 1 Felix mat const char filename block 2D amp BLK int 1 When Felix is invoked with this argu ment list it writes the data contained in the 2 dimensional data block BLK to a newly constructed file filename in the Felix mat format If rc is 1 default the data is written as complex numbers If rc is set to zero only the real data of the block is output Any parameters in BLK compatible with the Felix pa rameters will be automatically transferred into the Felix file The file is closed upon the function return The function will overwrite any file filename previously in existence Felix File amp fp block 1D amp BLK int rc 1 When Felix is invoked with this argument list it writes the data contained in the 1 dimensional data block BLK in the Felix mat format to wherever the file pointer fp is at The file where fp is pointing is assumed to be open opened expli
57. ative values are acceptable this simply changes the orientation as shown in the next figure e mm Negative xinc Zero xinc Positive xinc Larger Positive Figure 4 13 How xinc affects the skewing of the output stack plot In a similar fashion yinc dictates the amount of vertical skew there is Negative values for yinc are not cur rently supported and will yield unpredictable plots Rather it is recommended that the matrix is multiplied by prior to entering this function xinc yinc and Stack Plots Negative yinc Zero yinc Positive yinc Larger Positive Figure 4 14 How xinc affects the skewing of the output stack plot Graphics Properties Within FrameMaker stack plots generated with this function are full graphics objects and have a graphics hierarchy The entire plot is grouped and can be resized annotated or rotated As a example the figure be low is a stack plot generated with this function which has been manipulated several different ways within FrameMaker Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 43 Graphics amp I O FrameMaker Functions 3 4 Graphical Manipulations of Stack Plots Within FrameMaker Rescaled Original Plot Hidden Lines now Visible Rotated Figur
58. ault values of 14cm by 14cm Second the plot originally had the char acter b marking each point As all points are a single graphics object these b s were all changed simultaneously to a larger font size default 12pt to 14pt and to a new font type Zapfdingbat See Also FM 1 FM_1Dm FM_xyPlot FM histogram Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 37 Graphics amp I O FrameMaker Functions 3 4 3 4 6 FM_ contour Usage include lt FrameMaker h gt void FM_contour const char filename matrix amp mx double threshold int steps 3 double CLI 0 double CLM 1 int CPN 1 double xsize 10 double ysize 10 Description The functions FM_contour is used to create contour plots in FrameMaker MIF format FM_contour const char filename matrix amp mx double threshold int steps double CLI double CLM int CPN double xsize double ysize The function FM_contour creates a FrameMaker file called filename in the MIF format The produced file will contain a contour plot of the real data contained in the matrix mx The contours begin at the level set by threshold and increment by the value of CLI The number of contours is set by steps The levels increment either geometrically or linearly as set by the value of CLM the default is linear Positive and negative contours are set by the flag CPN For CPN 1 default both positive and negative con tours are produced For CPN 0 only the
59. ay 22 1998 GAMMA Graphics amp I O Felix I O 77 Example 2 This example shows how the function is utilizes a 2D data array either a block 2D or a matrix to produce a Felix dat file To keep the program simple the data block BLK is filled with the product of a sinc and sinusoidal function finclude gamma h main block 2D BLK 256 256 block 1D BLK1 256 BLK1 sinc 256 128 10 for int 120 1 lt 256 i for int j 0 j lt 256 j BLK i j BLK1 i BLK1 j Felix felix dat BLK j Declare a 2D data block Declare a 1D data block Set the 1D block to a sinc function Fill the 2D block with sinc x sinc y Write Felix dat file a serial file As in the previous example the last line of the program creates the file felix dat readable by Felix Felix 2D Spectrum Serial Output OOUUULCUXCJUUUUCOCOO 2 o 00000000Q Al ceoooOoQOGXKcCopooeooooo eooooOOQO Xcoeoeoooooe o oOooQpoooooo ooooooooO9OQO0QGKcxDO0O99 oooooodqq 8S SISO 2000080000 JOKOKCOXOOCX OOO99oooqd SP m 00 ana f H THE E de 81 0 08 DO mms 0000000008 n Semen oe moles c jels POD OOO QQOOLEMALIQOOOE OE00 oooooOoCoOQ XKGCDO DOOG Ooooodq ooooooOoO
60. ble Table 9 NMRiFile Internal Structure Variable Type Units Description Comments fp File The NMRi file on disk Set in constructor fsize int bytes Size of NMRi file in bytes cols int points Number of columns in the file rOW int points Number of rows in the file pos_ int bytes Current position in file fname String External NMRi file name Set in constructor headersize int parame Size of NMRi file header Set Constant 512 ters par_SIZE int parame File position of parameter SIZE Set Constant 99 ters par SPEC int parame File position of parameter SPECS Set Constant 219 S ters Most manipulations within NMRiFile are performed with the C class File The other quantities are defined mostly for convenience and or because they are constants for all NMRi files 1 NMR1 and NMR2 are a products of New Methods Research Inc 7 East Genesee Street Syracuse NY 13210 Phone 315 424 0329 FAX 315 424 0356 GAMMA was tested on Sun systems running the Sun views operating system release 3 8 and NMR2 release 3 5 were the manuals referred to during the programming Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 123 User Documentation NMRiFile Figures and Tables 7 3 7 5 3 File Structure files begin with a header which contains 512 parameters headersize describing the spectral data A 1D spectrum of length SIZE is written immediately after
61. bove were taken from plots made with the FM scatter function using the various size values and 0 25 for PGsize 2 FM scatter const char filename row vector amp vx char a double xsize 14 double ysize 14 When the function is called with these arguments it uses a character to mark the points in the scatter plot These objects marking the plotted points are grouped together and can be manipulated as a whole or individ ually inside of FrameMaker It is recommended that filename end with mif to signify a FrameMaker MIF file Note block_1D can be substituted for row_vector in this function Return Value Nothing A new disk file is produced for incorporation into FrameMaker Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 35 Graphics amp I O FrameMaker Functions 34 Examples include lt gamma h gt main block 1D BLK 50 create a data block double x y theta declare needed variables double a b declare needed variables for int 120 1 lt 50 i loop through 50 points fill up block with Prolate Cycloid a l b 2 theta PI 1 4 0 PI 49 0 angles span pi to 3pi a theta b sin theta x a theta b sin theta here 1 b 2 b cos theta a b cos theta BLK complex x y FM_scatter FM mif BLK 0 1 14 5 output FrameMaker mif plot file FM scatter Examplel Output O N U
62. char filename row vector amp vx char a o double xsize 14 double ysize 14 Description The function FM scatter is essentially the same as the function FM xyPlot except that the points are not con nected by a line they are marked with a specified symbol The FrameMaker MIF file filename is created containing a plot of the data supplied by the vector vx The plot dimension is xsize by ysize in centimeters default to 14x14 cm plot The data is plotted x versus y where x are the real points of the vector and y the imaginary points 1 scatter const char filename row vector amp vx int sides 0 double PGsize 0 double xsize 14 double ysize 14 When the function is called with these arguments a graphic object is used to mark the point in the scatter plot The size of the symbol is given in centimeters by PGsize which defaults to 1 100 of xsize PGsize is the radius of the circle which circumscribes the graphics objects marking the points The object itself is determined by the value of sides Typically sides will be the number of sides of a polygon and defaults to zero in order to indicate a circle The following are valid numbers for sides Size Vs Symbol in Scatter Plots size object size object size object 021 6 A y 2 X 4 a 4 BO X3 Figure 4 5 Value of size vs Symbol Output These also be set inside FrameMaker The objects shown a
63. citly sometime prior to the function call and will remain open with the file pointer advanced to the file end at the function return The file should be closed externally as well The flag reset tells the program whether or not to write any header information It is mandatory that the header information be present in the Felix mat file unlike a Felix dat file where the header can be absent This will be done automatically if your program has not previously called a Felix mat function in connection with another file If it has then you must reset this Felix mat function to tell it the header should be output For this reset is set to a non zero number on the first and only the first function call to Felix mat on the newly opened file attached to fp Felix mat files are typically named with a mat suffix so it is recommend that all filenames used for this function end with mat Furthermore Felix has trouble recognizing capitol letters at least in UNIX so file names should be all lower case letters Return Value Nothing A new file is produced in Felix mat format Example 5 5 7 Usage Felix mat 1D include lt Felix h gt block 1D Felix mat 1D const char filename int block 0 Description The function Felix mat 1D is used to read a 1 dimensional spectrum from a Felix dat file The Felix file name is filename typically something with a dat suffix such as name dat The spectrum assuming there Copy
64. ctly Since FrameMaker also has the ability to graphically manipulate GAMMA generated files your plots may be cosmetically enhanced Because GAMMA is capable of reading other file formats it can serve a a conversion tool If plot files from other programs are read into GAMMA e g a matrix from Felix they may be re output into FrameMaker format for use in a document FrameMaker can also be used just for viewing GAMMA simulated spectra on the screen GAMMA amp FrameMaker Matrix Row Vector Column Vector Coordinate Vector Figure 4 1 GAMMA output in FrameMaker You re viewing a document produced with FrameMaker and the plots were made with GAMMA a Note that this is a one directional process Unlike other output formats supported by GAMMA Felix NMRi etc GAMMA cannot re read FrameMaker files DO NOT make the mistake of considering your FrameMaker output files as a means of data storage from which further mathe matical manipulations may be performed within GAMMA FrameMaker files are exclusively used for FrameMaker A primary reason for GAMMN s interface to FrameMaker is that such plots are graphic objects That is to say they may be manipulated graphically inside FrameMaker Your plots can be resized recolored annotated added into other documents made into transparencies etc The downside of this is that to use these routines you must purchase FrameMaker More information
65. data from rowi until the end of the file Both rowi amp rows must be positive Return Value Nothing A block 2D is returned containing a data array from the Felix dat file filename Example include lt gamma h gt main block_2D BLK Create a 2 D data block BLK Felix_2D felix dat 29 79 Get the first spectrum from felix dat FM_stack felix mif BLK 0 3 0 3 Output spectrum to FrameMaker Felix 2D Example Output Figure 4 5 Example program result from use of the GAMMA function Felix 2D Copyright Scott A Smith May 22 1998 GAMMA Felix I O 83 Graphics amp I O In this example spectra 30 through 80 in the Felix dat file felix dat are read into a 2D data block A stack plot for FrameMaker is then output and shown above The file was that used in Example 3 for the function Felix on an earlier page of this document Copyright Scott A Smith May 22 1998 GAMMA Felix I O 84 Graphics amp I O 5 5 4 Felix header Usage include lt Felix h gt void Felix header const char filename Description The function Felix header is used for viewing the header information in a Felix file Unlike its predecessor FTNMR the current version of Felix uses very little of the header information present Felix does read the header and perhaps more of the information present will be used in future versions Return Value Nothing Felix header information is writte
66. e 4 15 The two plots above were contained in the file FM mif and imported directly to this document without further alteration The import command within FrameMaker is under the File option These plots were produced from the example code Furthermore each row can be individually manipulated also be manipulated as a graphics object as the following di agram illustrates Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 44 Graphics amp I O FrameMaker Functions 3 4 More Graphical Manipulations of Stack Plots Original Plot Specific Line Highlighted v Positive in plane amp negative Specific Line Isolated Figure 4 16 The two plots above were contained in the file FM mif and imported directly to this document without further alteration The import command within FrameMaker is under the File option These plots were produced from the example code FrameMaker MIF files are typically named with mif suffix so it is recommended that all filenames used for this function have a mif at the end Return Value Nothing A new disk file is produced for incorporation into FrameMaker Example include lt gamma h gt main matrix mx 101 101 create a 101x101 matrix for data block_1D vx 100 create a 1D data block of length 101 vx sinc 101 50 10 use provided window sinc function for int 120 1 lt 101 i loop through and fill up the matrix for int
67. e DTE 82 Be lix he ad erates oe ee eee eec eee edad deve edere toc oe 84 BEelixdcat emnt ceo cedendo Credere dtes cod Corde 85 Felix mat Sto EHE ERN eI NEM 90 Felix mat bD s sheet esce 90 Felix mat Hea E se ic 91 Descriptio ies TH 92 Felix dat File SUU CtUEe 42i eee te tec teet det terr 92 Data Str ctute uen Deer iiieee 94 Felix mat File Str ctute 94 Felix mat Pile Header 96 Felix mat Data Structure sees 101 NMRi I O 00000000000000000000000000000000000000000000000000000000000000000000 0 106 docs cea 106 Available NMRi Functions 106 106 INNMRI S eee 106 MEE ERR Eu 108 2D 5 525 5c e d ee LS 108 NMR 109 110 NMRiFile 00000000000000000000000000000000000000000000000000000000000000000000 0 112 OVCIVIEW rod M 112 Available NMRiFile Functions 112 NMRI iFile Figures and Tables pel t totae e aeter p C ebd 112 ISOUeS cote otc emer arreter velle ees bie ues uer 113 May 22 1998 GAMMA Table of Contents V Graphics amp I O 7 4 1 NMRIEIHS sedia Si RD RD Labia M n Mee ee Has iei 113 7 4 2 dar PE CEP E 113 7 4 3
68. e coloring resizing and a bit of axis adjusting in FrameMaker The import command within FrameMaker is under the File option These plots were pro duced from the example code See Also FM 1D FM xyPlot FM scatter FM histogram Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 31 Graphics amp I O FrameMaker Functions 3 4 3 4 3 FM xyPlot Usage include FrameMaker h void FM xyPlot const char filename row vector amp vx double xsize 14 double ysize 1 4 Description The function FM xyPlot creates a FrameMaker file filename in the MIF format Unlike function FM 1 which assumes the data monotonically increasing on the horizontal axis FM xyPlot produces plots in para metric fashion i e true x versus y The plot will be of the data supplied by the vector vx and the plot dimension xsize by ysize in centimeters default to 14x14 cm plot It is recommended that filename end with mif to signify a FrameMaker MIF file Note block 1D can be substituted for row vector in the function call here Return Value Nothing A new disk file is produced for incorporation into FrameMaker Example include lt gamma h gt main block_1D BLK 360 create a data block double x y theta declare needed variables for int i20 1 lt 360 i loop through 360 degrees fill up block with Astroid theta 1 2 0 PI 360 0 also called a Hypercycloid of
69. e function NMRiFile is used to either create a new NMRi compatible file or to open an existing file which is in the standard NMRi format The first argument filename is the NMRi file name to be accessed The sec ond argument io mode is exactly analogous to the valid arguments used to open a file The possible input values are io readonly the file will be opened without write access io writeonly the file will be open for writing only io readwrite the file will be opened for both reading and writing default The last argument access mode is also analogous to access modes for files The possible input values are a createonly create the file fail if file exists a create create the file recreate if file exists a useonly open an existing file fail if it does not exist use open an existing file create if it does not exist The default values of the latter two are usually correct but the NMRi file must then have both read and write privileges set for the individual at tempting to access it Return Value Nothing when producing a NMRi file Example include lt NMRiFile h gt main NMRiFile filel newfile dat Create a new NMRiFile filel external name newfile dat NMRiFile file2 oldfile dat Open an old NMRiFile file2 external name oldfile dat 7 4 2 close Usage include lt NMRiFile h gt void NMRi const char filename io mode m io_readwrite access mode a a use Description
70. ed in the file 7 4 12 seek Usage include lt NMRiFile h gt void NMRiFile seek int pos int seek_mode 0 Description The function seek is used to set the internal positioning in the NMRi file The argument pos is a value for the position in rows or data blocks The second argument seek mode indicates how pos is implemented The default value seek mode the file position is set at pos rows from the file start For the value seek mode 1 the file position is set pos rows from the current position For the value seek mode 2 the file position is set pos rows back from the end of the file Return Value None the function is void Example include lt NMRiFile h gt main Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 120 User Documentation NMRifFile Figures and Tables 7 3 NMRiFile filel oldfile dat Open an old NMRiFile filel external name oldfile dat filel seek 5 Skip to row 5 of the data in filel filel seek 2 2 Skip to the second row 5 from the end of the data in filel filel seek 1 Skip one row now to last one 7 4 13 tell Usage include lt NMRiFile h gt int NMRiFile tell Description The function fell is used to obtain the current file position in terms of rows or blocks of an NMRi file Return Value An integer is returned Example include lt NMRiFile h gt main NMRiFile file1 oldfile dat Open an old NMRiFile fi
71. elong to some contour line in the contour level being treated These two points are passed on to the function PL_contour which places them into a FrameMaker Polyline These two contour points occur where two of the three triangle lines P U P P U P3 cross the contour level plane or P L P P L P for the lower triangles so determin ing their values is accomplished by solving the problem of where a line in 3 dimensional space crosses plane Using vector notation a plane is defined by the scalar product relationship which exists between a vector in the plane and a vector normal to the plane For the contour level plane this would be then LE 0 where lane 18 the arbitrary vector which lies in the contour plane and ka unit vector along the z axis and perpendicular to the contour plane Since the contour level plane lies horizontal the 1 The solution is taken from Mathematics for Chemists Charles L Perrin Wiley Interscience John Wiley amp Sons Inc New York 1970 See page 181 of that text Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 63 Graphics amp I O FrameMaker Functions 3 4 vector Pune can be taken as the difference of a vector th reshold k with the intersection point vector desired Fae P intersect threshold k The first vector may be thought of as one which starts at the origin runs along the z axis and is of length th
72. encapsulated postscript file for importing into FrameMaker the program hpgltoeps provided by FrameMaker was used This is done outside of Felix in UNIX and the command was hpgltoeps felix hpgl felix eps and produced the file felix eps that was incorporated for the plot on the previous page 1 Felix version 1 0 seems to prefer that one draws 1D plots before 2D plots or it confuses itself on the plot limits Apparently loading a row loa 0 128 and drawing it dr then loading a column loa 50 0 and drawing it dr prior to the stack plot does something to help Felix figure itself out The manual claims at least one should be done to set the scaling but if not done half of the data matrix disappears Copyright Scott A Smith May 22 1998 GAMMA Felix I O 81 Graphics amp I O 5 5 2 Felix 1D Usage include lt Felix h gt block 1D Felix 1D const char filename int block 0 Description The function Felix 1D is used to read a 1 dimensional spectrum from a Felix dat file The Felix file name is filename typically something with a dat suffix such as name dat The spectrum assuming there are more than one present in the file is specified by the value of block which defaults to 0 the first spectrum Note that for N total spectra the spectra are indexed from 0 N 1 Return Value Nothing A block 1D is returned containing the spectrum block from the Felix dat file filename Example include lt gamma h gt
73. ensions with the coordinate vector projection function The GP xy function is then used to output the projected points Example include lt gamma h gt main int argc char argv iint N 4096 We ll plot this many points coord vec data N Here s a coordinate vector double x y z Here are ordinates double w W 250 0 double Nm1 double N 1 double di for int 120 i lt N i Now we ll fill up the vector di double i Point value w W di Nml Frequency vlaue z 1 0 2 0 di Nml Letz l 1 x sin w x oscillating y cos w y oscillating data put x y z 1 Store coordinate row_vector proj N For projected data double TH PH double fact 180 0 PI coord pt for int 1 0 1 lt N 1 pt data l TH fact pt theta PH fact pt phi proj put complex PH 90 TH Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 21 Graphics amp I O Index of Figures amp Tables 2 3 GP_xy sphere asc proj 2D gnuplot of traj cout lt lt n n Keep the screen nice This plot makes a helix which spirals up the surface of a sphere The following dialog demostrates how to display these plots on the screen on a Unix system assuming Gnuplot is installed and the executable gnuplot is in the users path lgammal gt gnuplot GNUPLOT unix version 3 5 patchlevel 3 50 1 17 27 Aug 93 last modified Fri Aug 2
74. erwrites any data present so that at the end of each loop the output dat file contains only one block plus its header Thus the macro also contains a call to the system to execute the command felixcp Actually felixcp contains a couple of com mands which concatenate felblock dat to anything output previously The file felixcp contains the following two lines true UNIX commands cat subtot dat felblock dat gt total dat cp total dat subtot dat This first command concatenates the output Felix dat file to the file subtot dat and calls the result total dat The second line copies total dat back over subtot dat At the beginning of the macro both subtot and total should be empty files and at end of the macro they will both contain all of the fel block dat files concatenated together There are a few more things to know about this procedure 1 The files subtot dat and total dat must exist and be empty at the start of the macro The four commands will accomplish this rm subtot dat rm total dat touch subtot dat touch total dat 2 The file felixcp should have executable privledges This is done with the chmod command chmod felixcp 3 The file felixcp must reside in the default Felix directory This will be the directory from which Felix is executed from 4 The two data files subtot and total must be in the Felix data directory This is set with the fol lowing felix command don t forget to end with a slash pre dat dir
75. es Optional Figure 25 3 Structure of NMRi 1D spectrum Again for consistency with the program description found in the supplied manuals the file struc ture will be discussed in terms of blocks of length 642 The data begins at block number 4 and the length of each 1D spectrum will be LENGTH SIZE 64 for a complex data set where LENGTH is given in blocks For a real data set this number will be halved GAMMA When creating NMRi files GAMMA will initially write an empty header 512 prior to any spectral data After each 1D spectrum is written the header will be updated to reflect how many lines of 1D data are present That would be the variable SPECNUM shown in Figure 25 1 1 The block length of 64 is intrinsic to the file structure as utilized in the FORTRAN code for file I O supplied with the NMRi programs GAMMA uses C code to perform I O withe NMRi making this conceptual divi sion nearly unnecessary 2 See the previous footnote This information is only useful in clarification of the manual description Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 112 User Documentation Overview 7 1 7 NMRiFile 7 Overview The class NMRiFile provides I O functions to read and write files in NMRi Format This class is constructed in analogy to the standard class File for handling files on disk As such each NM RiFile accesses a disk file either for reading or writing Provisions are made for transferri
76. esize bricks x 4096 x 4 where there are 4K real points in a brick and 4 bytes per point Below is a brief table of what Felix stores for its vector parameters relative to the matrix generated from the Felix bld command Table 8 Felix Matrices versus Felix Header Scalars Felix bld Vector 0 Vector 1 Vector2 Vector 3 Vector 4 Vector 5 Command Points Bricks Brick Index Blocksize Block Index bld x 2512 5120 1 1 512 512 8 8 1 8 64 64 1 64 bld x 2512 5121 1 1 512 512 8 16 1 8 64 32 1 64 bld x 2 256 5120 1 1 256 512 4 8 1 4 64 64 1 64 Copyright Scott A Smith May 22 1998 GAMMA Graphics amp I O Felix I O 105 Table 8 Felix Matrices versus Felix Header Scalars Felix bld Vector 0 Vector 1 Vector 2 Vector 3 Vector 4 Vector 5 Command Points Bricks Brick Index Blocksize Block Index bld x 2512 2560 1 1 512 256 8 4 1 8 64 64 1 64 bld x 2 256 512 1 1 1 256 512 8 8 1 8 32 64 1 32 bld x 2512 2561 1 1 512 256 8 8 1 8 64 32 1 64 bld x 2 32 1024 0 1 1 32 1024 2 4 1 2 16 256 1 16 bld x 2 1024 320 1 1 1024 32 4 2 1 4 256 16 1 126 bld x 2 32 1024 1 1 1 32 1024 4 4 1 4 8 256 1 8 bld x 2 1024 32 1 1 1 1024 32 4 4 1 4 256 8 1 126 bld x 3323280 1 1 1 32 32 6 2 2 1 1 2 4 16 16 16 1 16 256 bldx 3328320 1 1 1 32 8 32 2 1 2 1 2 2 16 16 16 1 16 256 bldx 3 8 32 32 1 1 1 1 8 32 32 1 2 2 14122 8 16 16 1 8 128 Cop
77. eters Values 20 Data Type for Dimension 1 1 Real Complex 21 Data Type for Dimension 2 1 Real Complex 20 nd 1 Data Type for Dimension nd 1 Real Complex 20 nd Number of Points in Dimension 1 20 nd 1 Number of Points in Dimension 2 20 2 nd 1 Number of Points in Dimension nd 20 2 nd Number of Blocks in Dimension 1 1 20 2 nd 1 Number of Blocks in Dimension 2 20 3 nd Number of Blocks in Dimension 1 1 20 3 1 Number of Blocks in Dimension 2 20 4 nd Blocks Size of Dimension Data 1 20 4 nd 1 Blocks Size of Dimension 2 Data Copyright Scott A Smith May 22 1998 GAMMA Graphics amp I O Felix I O 99 Below is a brief table of what Felix stores for its vector parameters relative to the matrix generated from the Felix bld command Table 5 Felix Matrices versus Felix Header Scalars Felix bld Vector 0 Vector 1 Vector 2 Vector 3 Vector 4 Vector 5 Command Points Bricks Brick Index Blocksize Block Index bld x 2512 5120 1 1 512 512 8 8 1 8 64 64 1 64 bld x 25125121 1 1 512 512 8 16 1 8 64 32 1 64 bld x 2 256 5120 1 1 256 512 4 8 1 4 64 64 1 64 bld x 2 512 2560 1 1 512 256 8 4 1 8 64 64 1 64 bld x 2 256 512 1 1 1 256 512 8 8 1 8 32 64 1 32 bld x 2512 2561 1 1 512 256 8 8 1 8 64 32 1 64 bld x 2 32 1024 0 1 1 32 1024 2 4 1 2 16 256 1 16 bld x 2 1024 320 1 1 1024 32 4 2 1 4 256 16 1 126 bld x 232 1024 1 1
78. evel very low 10 8 lower than exptl cpn 1 both positive and negative contours nl 5 five levels cli 1 geometrically progressing contours clm 2 5 contours increment 250 percent cp draw the contour plot to the screen To generate the hpgl contour plot file the Felix commands are once cp produces the screen plot hdv felix hpgl hardcopy device is file felix hpgl hpm 32 hardcopy plot mode is hpgl hcp produce the plot Finally to produce the encapsulated postscript file for importing into FrameMaker the program hpgltoeps provided by FrameMaker was used This is done outside of Felix in UNIX and the command was hpgltoeps felix hpgl felix eps and produced the file felix eps that was incorporated for the plot on the previous page 1 Felix version 1 0 seems to prefer that one draws 1D plots before 2D plots or it confuses itself on the plot limits Apparently loading a row loa 0 256 and drawing it dr then loading a column loa 130 0 and drawing it prior to the contour plot does something to help Felix figure itself out Copyright Scott A Smith May 22 1998 GAMMA Felix I O 79 Graphics amp I O Example 3 This example demos use of function Felix in a loop writing successive 1 D blocks to a serial file finclude gamma h main block 1D BLK1 128 BLKA 128 BLKB 128 Create 3 1 D data blocks Gaussian 128 32 42 46 Set to a Gaussian BLKA sinc 128 64 12 Set BLKA t
79. filename Description The function NMRi 2D is used to read a 2D spectrum from an NMRi file that is a file in the standard NMRi format The NMRi file name is filename Returned is an 2D data block containing the parameters in the NMRi file along with the entire 2D spectrum Return Value A two dimensional data block Example Copyright Scott A Smith May 22 1998 GAMMA NMRi I O 109 User Documenation Routines 6 3 6 3 4 NMRi header Usage include lt NMRi h gt ostream amp NMRi_header const char filename int verbose 0 Description The function NMRi header is used to quickly read the header information contained in an NMRi file The NMRi file name is filename The header contains 512 pieces of information only some of which is partic ularly useful outside of the NMRi programs themselves The integer verbose specifies how much of this in formation should be returned The default value of 0 returns the minimal amount of information the amount increases as verbose increases up to 10 The header is returned in an output stream Return Value None the function sends information to standard output Example include lt gamma h gt main String filename Declare a string cout lt lt Which Levy File Ask for filename cin gt gt filename Input filename int verbose Declear an integer cout lt lt nHow verbose Ask for verbose level cin gt gt verbose
80. first block is the parameter header A data matrix is commonly for example in FORTRAN stored column wise lt 111 gt lt 211 gt 3l1 nl1 lt 211 lt 212 gt nln Accessing a column with this storage scheme needs one disk seek followed by suc cessive elements being rapidly read Accessing a row then requires a disk seek for each element and is thus much slower For a matrix stored row wise the opposite logic holds By using a sub matrix storage scheme both row and column access will be faster that the row read of the typically stored matrix the tradeoff being both are slower that row read of common storage method The bottom line is that if you assume you will be processing both rows and columns of the matrix a lot the latter storage will always seem reasonably fast whereas the simpler storage will probably seem unbearably slow whenever the less favorable access is need ed Copyright Scott A Smith May 22 1998 GAMMA Felix I O 102 Graphics amp I O General Felix mat File Structure There is also a larger structure in the matrix files called a brick which clusters together several blocks A brick is used to easily jump from one matrix point to the next in any of the matrix dimen sions We will use two examples to illustrate the brick block matrix structures The following fig ure outlines the storage of a matrix constructed by the Felix command bld x 2 512 512 0
81. iFile readParameter int pos int amp par Description The function readParameter is used to read parameters from an NMRiFile For this function the value of the argument pos indicates which parameter relative to the beginning of the file is to be written The value of the parameter par will be set and output as either a floating point number or an integer type depending on the argument given Return Value Nothing the function is void The value of input parameter will be set the NMRi parameter Example include lt NMRiFile h gt main NMRiFile filel oldfile dat Open an old NMRiFile filel external name oldfile dat Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 117 User Documentation NMRifFile Figures and Tables 7 3 cout lt lt No of rows filel rows Output the number of rows contained in the file 7 4 7 write header Usage include lt NMRiFile h gt void NMRiFile write header Description The function write header is used to write all 512 parameters into an NMRi file into a floating point array The NMRi file will be accessed directly regardless of where the file pointer is The file pointer will be imme diately after the header at the start of the data Return Value This function returns a pointer to a floating point array Example include lt NMRiFile h gt main NMRiFile file1 newfile dat Open an new NMRiFile 1 external name
82. iable name taname If rc is set to zero only the real part of the matrix is output If rc is 1 default both the reals and the imaginaries are written The file is closed upon the function return and will overwrite any file file name previously in existance when the function is called 2 MATLAB File amp file const char dataname matrix amp mx int re 1 When MATLAB is invoked with this argument list it writes the data contained in the matrix mx in the MATLAB MAT format to wherever the file pointer file is at The data is given the MATLAB internal variable name dataname If rc is setto zero only the real part of the matrix 1s output If rc is 1 default both the reals and the imag inaries are written The file where file is pointing is assumed to be open when the function is called and will remain open with the file pointer advanced to the end at the function return The file should be closed externally 3 MATLAB const char filename const char dataname When MATLAB is invoked with this argu ment list it attempts to read the file filename assumed in the MATLAB MAT format and retreive the data dataname The name dataname is the variable name which MATLAB uses internally Note that MATLAB can be called with a 1 or 2 dimensional data block in place of the matrix block 1D or block 2D MATLAB mat files are typically named with a mat suffix so it is recommened that all filena mes used for
83. ier May 22 1998 GAMMA FrameMaker Output 55 Graphics amp I O FrameMaker Functions 3 4 1 00 0 00 1 00 0 00 0 00 0 00 0 00 0 10 0 10 0 00 5 00 3 00 4 00 4 00 5 00 5 00 6 00 6 00 Testal mmf file imported directly into this document 1 1 00 0 0 10 7 0 10 5 3 1 4 4 7 5 5 i 6 1 Figure 4 24 The two plots above were contained in the file FM mif and imported directly to this document without further alteration The import command within FrameMaker is under the File option These plots were produced from the example code Note that the 1 1 is set to the integer 1 the 1 2 element to 1 00 because its full value is 1 001 The imaginary part has a value of 0 0001 and falls below threshold See Also FM_Mat_Plot Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 56 Graphics amp I O FrameMaker Functions 3 4 3 5 2 FM_Mat_Plot Usage include lt FrameMaker h gt void FM Mat Plot const char filename gen op amp Op int threshold 0 001 void FM Mat Plot const char filename matrix amp mx int threshold 0 001 void FM Mat Plot const char filename gen op amp Op gen op amp ref Op int threshold 0 001 void FM Mat Plot const char filename matrix amp mx matrix amp ref mx int threshold 0 001 Description The function FM Matrix generates a FrameMaker Interchange Format MIF file which can be directly imported int
84. j 0 j lt 101 j mx i j vx i vx j FM_stack stack mif mx 0 02 0 02 1 output the FrameMaker mif plot file Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 45 Graphics amp I O FrameMaker Functions 3 4 FM_stack Example Output Figure 4 17 This example generates a 101x101 matrix which is a sinc function along both axes The first contour block plotted is row 0 Each successive row begins 0 02 cm above and 0 02 over from the previous row In this example the row increment is set to 7 The default dimensions of 14x14 cm are used because they are left out of the function call Note that the plot here has been rescaled See Also FM contour Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 46 Graphics amp I O FrameMaker Functions 3 4 3 4 8 FM_sphere Usage include lt FrameMaker h gt void FM sphere const char filename int type 2 double alpha 0 double beta 15 double gamma 15 double radius 5 double points 1 00 void FM_sphere const char filename coord_vec amp data int type 0 double alpha 0 double beta 15 double gamma 15 double radius 5 double points 100 void FM_sphere const char filename coord vec amp data1 coord vec amp data2 int type 0 i double alpha 0 double beta 15 double gamma 15 double radius 5 double points 100 Description The function FM sphere creates a FrameMaker file c
85. lel external name oldfile dat filel seek 5 Skip to row 5 of the data in filel filel seek 2 2 Skip to the second row 5 from the end of the data in filel filel seek 1 Skip one row now to last one 7 4 14 Usage include lt NMRiFile h gt int NMRiFile tell Description The function is used to place all parameters contained in the NMRi file header into a parameter set class p set Return Value Void Example include lt NMRiFile h gt Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 121 User Documentation NMRifFile Figures and Tables 7 3 main NMRiFile filel oldfile dat Open an old NMRiFile filel external name oldfile dat filel seek 5 Skip to row 5 of the data in filel filel seek 2 2 Skip to the second row 5 from the end of the data in filel filel seek 1 Skip one row now to last one Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 122 User Documentation NMRifFile Figures and Tables 7 3 7 5 Class NMRiFile Description 7 5 1 Introduction Every data file suitable for use in the NMR data processing packages from New Methods Research Inc e g NMR1 and NMR2 has a standard internal format Class NMRiFile was constructed in order that users of GAMMA are able to efficiently manipulate such files 7 5 2 NMRiFile Structure The internal design of Class NMRiFile is quite simple It contains the quantities defined in the fol lowing ta
86. les suitable for use in Gnuplot They may be readily viewed with that program or used in any other plotting program that takes ASCII input The following dialog demostrates how to display these plots on the screen on a Unix system assuming Gnuplot is installed and the executable gnuplot is in the users path lgammal gt gnuplot GNUPLOT unix version 3 5 patchlevel 3 50 1 17 27 Aug 93 last modified Fri Aug 27 05 21 33 GMT 1993 Copyright C 1986 1993 Colin Kelley Thomas Williams Send comments and requests for help to info gnuplot dartmouth edu Send bugs suggestions and mods to bug gnuplot dartmouth edu Terminal type set to x11 gnuplot gt set data style lines gnuplot gt plot real gnu gnuplot gt plot imag gnu gnuplot gt plot bides gnu gnuplot gt quit lgammal gt Since this documentation was created with the program FrameMaker I can also put these plots di rectly into the document For example before the quit command above I can do the following gnuplot gt set terminal mif Terminal type set to mif Options are colour polyline gnuplot gt set output real mif gnuplot gt plot real gnu This produces three corresponding MIF files that are shown in the next figure Other than being resized they have not been altered within FrameMaker although they could be Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 10 Graphics amp I O Index of Figures amp Tables 2 3 Gnuplot Funcion GP 1D Ex
87. lo Levante Scott Smith Beat H Meier May 22 1998 GAMMA Graphics amp I O FrameMaker Output FrameMaker Functions 61 3 4 Contouring Concept f 2 2 Pi ij U i j 1 E Data Matrix z L 1 1 j P5 i 1 j 1 z Column Dimension Figure 4 28 How a matrix is searched for contours in the GAMMA FM contour function For each triangle formed both upper and lower function contour level determines whether a con tour line passes through it and if so the two points where the contour line intersects the triangle there are eight unique situations which exist in looking for a contour line in the triangle as given in the following table Table 1 Eight 2 Triangle Based Contouring Situations Possible Ist Point 22 2nd Point 2 3rd Point 2 Situation P gt threshold 0 P gt threshold 0 U L gt threshold 0 0 P gt threshold 0 P gt threshold 0 U L lt threshold 1 1 P gt threshold 0 P lt threshold 2 U L gt threshold 0 2 P gt threshold 0 lt threshold 2 U L lt threshold 1 3 P lt threshold 4 P gt threshold 0 U L gt threshold 0 4 P lt threshold 4 P gt threshold 0 U L lt threshold 1 5 P lt threshold 4 P lt threshold 2 U L gt threshold 0 6 P lt threshold 4 P lt threshold 2 U L lt threshold 1 7 Based on the binary T F conditions for each poi
88. lt nPlease input plot type O axes 1 planes 2 both int type cin gt gt type FM_sphere FM_sph1 mif type alpha beta gamma radius FM sphere Example 1 Output 45 5 0 10 10 3 15 0 y 15 15 type 0 type 1 type 2 radius 2 radius 1 0 radius 1 5 Figure 4 21 This example program runs interactively and prompts the user for information concern ing the plot Here the function FM sphere is used only to produce a coordinates system plot either axes the coordinates sphere or both Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 51 Graphics amp I O FrameMaker Functions 3 4 Example 2 include lt gamma h gt main coord_vec data1 500 Declare a 500 point coordinate vector coord_vec data2 500 A second coordinate vector double xx yy zz Declare needed variables double theta Declare an angle variable for int 120 i lt 500 i Fill datal with a spiral theta 1 6 0 PI 499 0 xx 3 0 cos theta yy 3 0 sin theta zz 3 0 6 1 499 datal put xx yy 77 1 data2 datal rotate 90 90 0 Set 2nd coordinate vector to rotated datal FM sphere FM sph2a mif data1 0 Output FrameMaker file FM sph2a mif FM sphere FM sph2b mif data2 1 Output FrameMaker file FM sph2b mif j FM sphere Example 2 Output Figure 4 22 This example demonstrates the use of the function FM
89. lt nc 2 lt lt cin gt gt ic cout lt lt n tPlease the Number of Colums 2 lt lt nc ic lt lt cin gt gt ncols cout lt lt n tDo You Wish to Plot Only Some of the Rows y n cin gt gt yn int ir 0 nrows nr if yn y cout lt lt nMPlease Enter First Row Index 0 lt lt nr 2 lt lt cin gt gt ir Copyright Scott A Smith May 22 1998 GAMMA Felix I O 87 Graphics amp I O cout lt lt n tPlease Enter Last Row Index 2 lt lt nr ir lt lt cin gt gt nrows block_2D subBLK subBLK BLK get_block it ic nrows ncols cout lt lt n tDo You Wish to Row Order Reversed y n cin gt gt yn block 1D rowBLK1 rowBLK2 int kswap for int k 0 k lt nrows k kswap nrows k 1 if kswap gt k rowBLK1 subBLK get_block k 0 1 ncols rowBLK2 subBLK get_block kswap 0 1 ncols subBLK put_block kswap 0 rowBLK1 subBLK put_block k 0 rowBLK2 Output FrameMaker mif Stack File double xsize ysize xsinc ysinc int rinc cout lt lt n tPlease Enter Stack Plot Width in cm 8 5in 21 5cm cin gt gt xsize cout lt lt n tPlease Enter Stack Plot Height in cm 1 lin 27 9cm cin gt gt ysize cout lt lt n tPlease Enter Stack Plot Row Increment 1 nrows 1 cin gt gt rinc cout lt lt n tPlease Enter X Incre
90. ment in cm cin gt gt xsinc cout lt lt n tPlease Enter Y Increment in cm cin gt gt ysinc FM_stack stack mif subBLK xsinc ysinc xsize ysize Concatonation of any two UNIX files is performed using the cat command as indicated in the func tion description Subsequently the concatonated Felix file can be read by a simple or as in our ex ample program an elaborate GAMMA program Worth mentioning is how to get Felix itself to Copyright Scott A Smith May 22 1998 GAMMA Felix I O 88 Graphics amp I O produce a concatonated Felix dat file from one of its matrix mat files This can by done with the following tricky but manageable macro the comments off to the side are not part of the macro get First Matrix Row rowi get initial matrix row desired get Last Matrix Row rowf get final matrix row desired for row amp rowi amp rowf loop through matrix rows specified loa 0 amp row load row into workspace wr felblock dat write row to Felix dat file named felblock dat sys felixcp call to UNIX and concatonate with previous file ty row amp row echo that row is complete next go back for next row end exit the macro After getting the matrix rows that the user wished concatonated the macro loops through and writes each block to the file felblock dat Unfortunately Felix does not append each successive block to what felblock dat previously contained It ov
91. n 0 double ymax 0 double double xmin 0 double xmax 0 void GP stack ofstream amp ofstr matrix amp mx double row int row inc double xmin double xmax double cutoff 0 Description The function GP stack creates an ASCII file Gnuplot file called filename in the MIF format It contains a single stack plot of dimension xsize by ysize both given in centimeters default 14 cm The data is input in the form of a matrix and the plot is of the entire matrix real data The values xinc and yinc also given in cen timeters are the amount to shift the next row in the horizontal and vertical directions respectively The rows which are to be plotted are specified by the value row inc e g a row increment of 3 causes the first fourth seventh etc until the end of the matrix is reached Return Value Nothing A new disk file is produced for incorporation into Gnuplot Example finclude gamma h main matrix mx 101 101 Create a 101x101 matrix for data row vector vx 100 Create a 1D data block of length 101 vx sinc 101 50 10 Use provided window sinc function for int 120 1 lt 101 i Loop through and fill up the matrix for int j 0 j 101 j mx i j vx i vx j String afile stack asc Output ASCII file name GP_stack afile mx Write the ASCII file for Gnuplot This example generates a 101x101 matrix which is a sinc function along both axes The following dialog demo
92. n to standard output Example include lt Felix h gt include lt String h gt Could just have used include lt gamma h gt main String filename Declare a string for the filename cout lt lt n tWhich Felix dat File Ask the user to give the filename cin gt gt filename Input the filename from the user cout lt lt Output a linefeed so screen stays nice Felix_header filename Output the header information in the file cout lt lt n Output a linefeed so screen stays nice Below is a sample of the output to expect from this function from a typical Felix dat file Which Felix dat File felix dat Initial integer read for FORTRAN 32772 Header Size in Complex Points 4096 1 4096 Number of Complex Points 2 1 Data Type Complex 3 0 Transform State FID 4 0 W2 Axis None 5 0 W2 W1 Axis Equivalence 6 0 W1 Axis None 7 0 Empty 8 0 Empty 9 0 Empty 10 0 Empty Copyright Scott A Smith May 22 1998 GAMMA Graphics amp I O Felix I O 85 11 12 13 14 15 16 17 18 19 20 21 22 23 24 258 26 27 28 29 30 31 32 0 0 0 0 0 0 Hz 0 Hz 0 4096 MHz 0 0 Deg 0 Deg 0 0 Hz 0 MHz 0 0 Hz 0 0 Deg 0 Deg 0 0 Pointer to Comments Length of Comments Pointer to Raw Header Length of Raw Header Spectrometer Type W2 Spectral Width W2 Spectrometer Frequency W2 Refere
93. nce Point W2 Reference Frequency W2 Reference Frequency Type W2 Zero Order Phase Correction W2 First Order Phase Correction W2 First Order Phase Correction WI Spectral Width WI Spectrometer Frequency W1 Reference Point W1 Reference Frequency WI Reference Frequency W1 Zero Order Phase Correction WI First Order Phase Correction Reserved Reserved Final integer read for FORTRAN 32772 5 5 5 Usage include lt Felix h gt Felix d cat block 2D Felix d cat const char filename int lOout 0 Description The function Felix d catis used for reading a concatonated Felix dat file filename This function is similar to the function Felix 2D but it ignores any or multiple headers found in the file This allows users to blend multiple dat files into one by using standard UNIX file concatonation cat file1 dat file2 dat gt filename Once the concatonated data is an a GAMMA matrix it can be easily manipulated The argument Oout if set to non zero will write information to standard output about the concatenated file as it is being processed One example of this functions utility would be if a computer simulation does not run to completion The job can be restarted in the middle and the two output Felix dat file concatonated This function can then effec tively reproduce the full file This function is also handy when one has multiple Felix dat files which the user desires to manipulate these together The Felix
94. ng the data in an NMRiFile into a matrix or from a matrix into an NMRiFile 7 2 Available NMRiFile Functions NMRiFile Create or open an NMRiFile page 113 NMRiFile Close an NMRiFile close Close an NMRiFile write Write a block to a NMRiFile page 114 read Read a block from a NMRiFile at a specified position page 115 writeParameter Write a parameter into the NMRiFile PRIVATE FUNCTION page 116 readParameter Retrieve a parameter from the NMRiFile page 116 write header Write the entire NMRiFile header page 117 read header X Retrieve the entire NMRiFile header page 117 print header Send NMRiFile header information to output stream page 118 rows Returns the number of rows spectra in the NMRi file page 118 cols Returns the number of cols spectra size in the NMRi file page 119 seek Set the current position in an NMRiFile page 119 tell Retrieve the current position in an NMRiFile page 120 Read the NMRiFile header parameters into a p set 7 3 NMRiFile Figures and Tables NMRiFile Internal Structure page 122 NMRi File Structure page 123 NMRi Header Structure page 124 NMRi Data Structure page 125 NMRi Data Structure page 125 Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 113 User Documentation NMRifFile Figures and Tables 7 3 7 4 Routines 7 4 1 NMRiFile Usage include lt NMRiFile h gt void NMRi const char filename io mode m io_readwrite access mode a a use Description Th
95. ns and closes the file directly and is able to write multiple matrices into it This is not true for the first file which is produced with a single line of code and may contain only one matrix Finally the second file is re opened and scaned for the variable mx2 the second matrix This is put into the matrix mx2 but unused in the example To see a mesh plot of the data contained in twomxs mat issue the following commands within MATLAB load twomxs Load in the file This may need the directory path as well e g load nmr net home sosi twomxs e 1 Graph the first matrix as a meshed 2D plot mesh mx2 Graph the second matrix as a meshed 2D plot mesh mx2 Have MATLAB produce a mesh plot of the matrix mx2 MATLAB plots may be incorporated into FrameMaker if desired Currently the MATLAB plot must be out put as a MATLAB meta file converted to HPGL format with the MATLAB supplied program gpp then con verted to encapsulated postscript with the FrameMaker supplied program hpgltoeps and finally imported into the FrameMaker document of choice Note that each MATLAB plot must be output to a separate meta file or the plots will overlap in FrameMaker The following plots were produced in this manner from the file twom xs mat created in the example They have been resized and labeled after importing Copyright Tilo Levante Scott A Smith May 22 1998 GAMMA MATLAB I O 69 User Documenation Routines 4 5
96. nt of the triangle there are 8 situations possible one of which will occur for each specific triangle These can be visualized as shown in the follow ing figure upper triangle shown only Two of these 0 all points above the contour level and 7 all points below the contour level will contain no contour contribution All the other situations will contribute to some contour on the contour level being examined The contour line contribu Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 62 Graphics amp I O FrameMaker Functions 3 4 tions are shown in thick solid lines By using a linear fit the endpoints of the solid lines where the triangle intersects the contour plane are calculated in routine contour_level and forwarded to the function PL_contour which decides how they contribute to the contour Contouring Theme Contour Level Figure 4 29 Possible interasections between 3 points and a contour plane The diagrams in the previous figure are a bit contrived because the points are rendered to show the matrix i j or x y spacing and do not exhibit the point intensities or z Thus the lines crossing the plane appear vertical horizontal or parallel with the skew of the plane itself This is not the case for the matrix points which actually form these triangles whose z values will likely vary Again for each upper and lower triangle either two or zero points are thus generated which b
97. o a FrameMaker Document The file contains a graphical depiction of the matrix or the operator Whenever the norm of an element is larger then threshold a black square is put to the appropriate position For the forms with two Operator or Matrices on input black squares are placed everywhere where the difference in the norm of the elements of the two respective matrices is above threshold Return Value Nothing A new disk file in the MIF format is produced for incorporation into FrameMaker Example include gamma h main matrix C cin gt gt C cout c FM Mat Plot Testal mif c 1 0 Dialog of Program Execution gt 33 gt 1 0 0 0 gt 1 001 0 0001 gt 0 0 00001 gt 0 1 gt 10 gt 5 3 00001 gt 44 gt 5 5 gt 66 3 x 3 full matrix 1 00 0 00 1 00 0 00 0 00 0 00 0 00 0 10 0 10 0 00 5 00 3 00 Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 57 Graphics amp I O FrameMaker Functions 3 4 4 00 4 00 5 00 5 00 6 00 6 00 Testal mif file imported directly into this document Figure 4 25 The result of the example program read into this document See Also FM Matrix Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 58 Graphics amp I O FrameMaker Functions 3 4 3 6 Mathematical Details amp Code Specifics 3 6 1 FrameMaker Contour Plots The contouring function
98. o a sinc File fp Create a file fp open felix dat io writeonly a create Open file with name felix dat for int i20 1 lt 128 i Loop over 128 points filling the block BLKB with a blend BLKB i BLKA 127 1 BLK1 of the Gaussian and sinc then Felix fp BLKB write the result block to the file in Felix dat format fp close Close the file Felix ID Spectrum Output A gt DI points Figure 4 3 Example program result from use of the GAMMA function Felix in a loop 1 If this program were to continue and generate some other Felix dat file using this same form of the function Felix the reset flag would have to be used on the first function call if any parameters to be written to the file The same would be true in this program had any of the forms of function Felix been called previous to where it is called in the loop To set the reset status the loop would then go from 1 to 128 and the first row 0 output before the loop with Felix fp BLKB 1 1 where the last 1 tells the program to write the header information If this is not done the header will simply not be written and the program still works fine Copyright Scott A Smith May 22 1998 GAMMA Felix I O 80 Graphics amp I O In this example the file felix dat is produced from first opening the file then successively writing 128 1D data blocks to it For the above plot felix dat w
99. parameters not spec tral data This is indicated by the second integer in the block having a negative value A header block can be of any size but normally a Felix default it will contain 32 complex values 64 floats or 64 integers This default structure is shown in the following diagram Copyright Scott A Smith May 22 1998 GAMMA Felix I O 93 Graphics amp I O Felix dat File Header Structure A SIZE 0 1 derum m im SIZE 2 SIZE 1 A k ther Info Comments 16 size 1 A Figure 4 8 Header Structure of an Felix dat file The first 16 complex points are used to store 32 parameters either integer or real The locations after this may be used for any additional pa rameters or comments Although the program reads this information Felix should be trusted only to use the 1st and 2nd parameters the value of DSIZE and whether the data is real RIF 0 or complex RIF 1 Note that DSIZE in the header sets the number of points real or complex that Felix expects to read in ensuing data blocks regardless of how much storage SIZE the block actually uses In principle Felix uses the information contained in the header to set spectral parameters In prac tice some versions of Felix seem to have trouble maintaing this information in the way that FT NMR utilized it Copyright Scott A Smith May 22 1998 GAMMA Felix I O 94 Graphics amp I O 5 6 2 Felix dat Data Structure
100. plots points in the Gnuplot output file may be skipped and hence from smooth data the output file size reduced This is done automatically by this GAMMA function the value of cutoff indicative of what point variation is considered roundoff Note that some type of plotting do not allow for skipped points and the value of cutoff should be left at zero The latter form of the function is useful for successive writes of 1D spectra to the same file Return Value Nothing A new disk file in ASCII is produced for plotting with Gnuplot or other plotting programs which SR take ASCII It will contain either one or two plots depending on the flag rc Example include lt gamma h gt main int npts 101 How about this many points row_vector data npts 1 dim data block double x y Some temporary variables for int i 0 i npts i Fill up data block x double i 50 y x x x 125000 Cubical parabolic in imaginaries x x x 2500 Regular parabolic into reals data put complex x y 1 Put this point into the vector GP_1D real gnu data 0 Write real points to an ASCII file GP_1D imag gnu data 1 Write imaginary points to an ASCII file GP_1D bides gnu data 1 Write complex points to anASCII file Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 9 Graphics amp I O Index of Figures amp Tables 2 3 j When compiled and executed the program makes three ASCII fi
101. raphically These are row vectors matrices and coordinate vectors GAMMA Supported I O S PAM NMRi Figure 19 1 Some of the programs with which GAMMA can easily interact There are other prgrams that also have been used with GAMMA those that come to mind at the moment are Sig maPlot Deltagraph and XMGR These take ASCII input and need no special interface Scott Smith May 22 1998 GAMMA Gnuplot Output Graphics amp I O Index of Figures amp Tables 2 Gnuplot Output 2 1 Overview Gnuplot is a plotting package which runs on Unix systems PCs and Macs It s price free and ver satility make it a good choice for use in visualization of data GAMMA s Gnuplot routines are pro vided to allow the output of vector matrix and coordinate vector data into ASCII files suitable for plotting in Gnuplot Aside from being able to see your simulation result plotted on virtually every kind of computer you are using Gnuplot also allows one to build interactive GAMMA programs that plot to the screen Furthermore Gnuplot can output plots in many different formats and to many different types of devices More information regarding the software can be found at http www cs dartmouth edu gnuplot info html 2 2 Available Gnuplot Functions Functions To Make Plot Files For Gnuplot Use GP ID Dimensional Plot IDm Multiple 1 DimensionalPlots GP xy Parametric Plot GP contour Contour Plot GP
102. re AT MATLAB MAT File Structure Header 1 Data Matrix 1 Header 2 Data Matrix 2 Figure 25 1 Overall file structure of a MATLAB MAT file containing multiple matrices 4 6 2 MATLAB MAT File Header Structure The header structure is described in the MATLAB man ual u nder load save in the n nce Chap ter zx ia gt PRO MATLAB August 1987 v n Essentia ader a 20 byte stru ning 5 four byte long integers wo ids Copyright Tilo Levante Scott A Smith May 22 1998 GAMMA MATLAB I O 71 User Documenation Routines 4 5 MATLAB MAT Header Structure Figure 25 2 Header Structure of a MATLAB MAT file The five parameters are defined as follows type Type flag An integer indicating the computer type the data was produced on mrows Row dimension An integer with the number of rows in the stored matrix ncols Column dimension An integer with the number of columns in the matrix imagf Imaginary Flag Real data imagf 0 Complex data imagf 1 namlen Name Length Integer number of characters in variable name 1 4 6 3 MATLAB MAT File Data Structure The structure of the stored matrix data is described in the same section of the MATLAB manual previously cited for the header structure The size will of course vary depending upon how much data is stored but there is always the data name followed by the real data and then optionally fol lowed by the imaginary data if present MATLAB MAT Ma
103. regarding the software can be found at http www frame com Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 26 Graphics amp I O Index of Figures amp Tables 3 3 3 2 Index of GAMMA s FrameMaker Functions FM ID Dimensional FrameMaker Cartesian Plot in MIF Format page 27 FM 1Dm Multiple 1D FrameMaker Cartesian Plots in MIF Format page 29 FM_xyPlot Parametric FrameMaker Plot in MIF Format page 31 FM_histogram Histogram Plot in MIF Format page 33 FM_scatter Scatter Plot in MIF Format page 34 FM_contour 2 Dimensional Contour Plot in MIF Format page 37 FM_stack Stack Plot in MIF Format page 41 FM_sphere Vector s on a sphere plot in MIF Format page 46 FM_Matrix Matrix output in MMF format page 54 FM Mat Plot Graphical depiction of a matrix in MIF page 56 3 3 Index of Figures amp Tables Figure 4 1 GAMMA Output to FrameMaker page 25 Figure 4 2 FM_1D Example Output page 28 Figure 4 3 FM_1Dm Example Output page 30 Figure 4 4 XY Plot Example page 32 Figure 4 4 Histogram Example page 33 Figure 4 4 Size Vs Symbol in Scatter Plots page 34 Figure 4 6 FM scatter Examplel Output page 35 Figure 4 7 FM scatter Example 2 Output page 36 Figure 4 7 Choosing Contour Levels page 32 Figure 4 8 Multiple Contour Levels page 33 Figure 4 10 contour Example Output page 40 Figure 4 10 stack Example Output page 45 Figure 4 11 Euler Rotations About a and b page 47 Figure 4
104. reshold whereas the second can be assumed as starting at the origin and ending at the intersection point One of the two vectors for triangle situation 2 is shown in the next figure Contouring Situation Py TRIANGLE SITUATION 2 d P p threshold k m dii A Two Possible Contour Level Pintersect Points threshold Figure 4 30 First type of intersection with a contour plane As for the 3 dimensional line which intersects the contour plane we may choose any scalar mul tiple of the triangle edges which pass through the plane Which if any triangle edges to choose will also depend upon which of the eight situations is under consideration Expanding upon the pre vious figure one of the two possible lines T is shown 2 When use the normal vector as k because our contour planes are horizontal For any general plane we would have to use some general normal vector Neither the normal vectors origin nor magnitude are of conse quence here so we have chosen a vector of length 1 starting at the true matrix origin Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 64 Graphics amp I O FrameMaker Functions 3 4 Contouring Situation TRIANGLE SITUATION 2 d Contour Level threshold Figure 4 31 Second type of intersection with a contour plane The line 7 is then described by T c P1 Pintersect 01 7 P3 c3 Pintersect where c
105. right Scott A Smith May 22 1998 GAMMA Felix I O 91 Graphics amp I O are more than one present in the file is specified by the value of block which defaults to 0 the first spec trum Note that for N total spectra the spectra are indexed from 0 N 1 Return Value Nothing A block 1D is returned containing the spectrum block from the Felix dat file filename 5 5 8 Felix mat header Usage include lt Felix h gt void Felix mat header const char filename int verbose 0 Description The function Felix mat header is used for viewing the header information information in a Felix mat file The file name is input by filename and the amount of information to send out increases with the magnitude of the integer verbose There are 4096 integer length bits of information present in the header so the output can be quite long if verbose is set to gt 10 Return Value Nothing Felix header information is written to standard output Example finclude gamma h main String filename Declare a string for the filename cout lt lt Which Felix mat File Ask the user to give the filename cin gt gt filename Input the filename from the user cout lt lt Output two linefeeds so screen stays nice Felix_mat_header filename Output the header information in the file Copyright Scott A Smith May 22 1998 GAMMA Felix I O 92 Graphics amp I O
106. scription of Scalar Paramters Usually 0 Variable a A Felix mat Brick is defined to be 4096 4K floating points b A Felix mat Block contains 64 floating points This value is the number of Bricks which contains 64 matrix rows In most Felix mat files that the author has looked at only the first four scalar values are present in the header Below is a brief table of the first for scalar parameters found versus the matrix gen erated from the Felix bld command Table 3 Felix Matrices versus Felix Header Scalars Felix bld Scalar 0 Scalar 1 Scalar 2 Scalar3 Matrix Matrix Command Dimensions Type Bricks Blocks Filesize Points bld test 2 512 512 0 2 1 65 amp 1064960 262144 bld test 25125121 2 2 129 16 2113536 524288 bld test 2 256 512 0 2 1 33 amp 540672 131072 bld test 2 512 256 0 2 1 33 amp 540672 131072 bld test 2 256 512 1 2 2 65 amp 1064960 524288 bld test 2 512 256 1 2 2 65 amp 1064960 524288 bld test 2 32 1024 0 2 1 9 4 147456 32768 bld test 2 1024 32 0 2 1 9 4 147456 32768 bld test 2 32 1024 1 2 2 17 4 278528 65536 bld test 2 1024 32 1 2 2 17 4 278528 65536 bld test 2 32 32 2 1 2 1 32768 1024 bld test 3 32 3280 3 1 5 2 81920 8192 bld test 3 32 8 320 3 1 5 2 81920 8192 bld test 3 832321 3 2 2 81920 16384 As seen from the above table the number of stored dimensions and the matrix data type is straigh
107. strates how to display these plots on the screen on a Unix system as suming Gnuplot is installed and the executable gnuplot is in the users path lgammal gt gnuplot GNUPLOT Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 18 Graphics amp I O Index of Figures amp Tables 2 3 unix version 3 5 patchlevel 3 50 1 17 27 Aug 93 last modified Fri Aug 27 05 21 33 GMT 1993 Copyright C 1986 1993 Colin Kelley Thomas Williams Send comments and requests for help to info gnuplot dartmouth edu Send bugs suggestions and mods to bug gnuplot dartmouth edu Terminal type set to X11 gnuplot gt set data style lines gnuplot gt set parametric gnuplot gt splot stack asc Since this documentation was created with the program FrameMaker I can also put these plots di rectly into the document For example before the quit command I can do the following gnuplot set terminal mif Terminal type set to mif Options are colour polyline gnuplot gt set output stack mif gnuplot gt replot gnuplot gt quit This produces a MIF files that is shown in the next figure Other than being resized is has not been altered within FrameMaker although it could be Gnuplot Function GP_stack Example stack asc 100 Figure 4 5 Example program result from use of the GAMMA function GP stack Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 19 Graphics amp I O Index of Figures amp Tables 2 3
108. t ia dau eem dte sat Me BML SD Sto Sanit dora Co ea ee etl eeu BS Aas ies us BM scatet decuriones eti d pere tin un e po il ent dS FEM contor EM 8 dahin re a eco pep Routines for Matrix Output in FM EM MatriX ede osito Sake Ue eode audet tei ooi tadashi EM Mathematical Details amp Code Specifics FrameMaker Contour Plots ber ie May 22 1998 GAMMA Table of Contents iv Graphics amp I O 4 5 4 5 1 4 6 4 6 1 4 6 2 4 6 3 5 5 5 5 5 1 5 5 2 5 5 3 5 5 4 5 5 5 5 5 6 MI 5 5 8 5 6 5 6 1 5 6 2 5 6 3 5 6 4 5 6 5 6 6 1 6 2 6 3 6 3 1 6 3 2 6 3 3 6 3 4 6 4 7 T4 22 T3 7 4 ROUNE S uon tecto debe eM EE 67 IVA DAB abd sub i a E EE 67 IDESCEIPUI OM Ec 70 MATLAB MAT File Structure oie eee nn nennen 70 MATLAB File Header Structure _ 70 MATLAB File Data Structure eee eene 71 Felix I O 00000000000000000000000000000000000000000000000000000000000000000000000 0 73 75 dq E E E T E A E R ENEE 75 TEE EE 81 FE LiK
109. t forward A Felix brick is defined to be 4K real points so the number of bricks can be determined by dividing the total matrix points by 4096 and adding in the header brick The number of bricks Copyright Scott A Smith May 22 1998 GAMMA Felix I O 98 Graphics amp I O which Felix uses can thus usually be determined by the formula bricks rpts 4096 1 where rpts is the total number of real data points in the matrix For smaller 2D arrays the mini mum value of bricks allowed by Felix is 2 i e the smallest Felix mat file takes up 32768 bytes One can easily determine the size in bytes of the mat file from the equation filesize bricks x 4096 x 4 where there are 4K real points in a brick and 4 bytes per point Vectors Following the scalar paramters the header contains a series of vector parameters These parameters are always clustered in groups of nd where nd is the number of dimensions in the matrix For example the first vector parameter flags the data is real or complex for each dimension For a 2 dimensional real matrix there will be two successive 1 s stored and For a 3 dimensional real array there will be 3 successive 1 s stored Obviously where the storage of each vector param eter occurs in the header depends on how many matrix dimensions exist The following table de scribes the vector parameters Table 4 Felix mat File Header Vector Parameters Point Description of Vector Param
110. t be of the same size and this size must be a power of 2 64 128 256 If the any spectrum does not meet this latter requirement it will be padded with zeros until the size is a power of 2 Furthermore collectively the blocks must be either all real or all complex NMRi Data Structure SIZE Reals SIZE Imaginaries Optional Figure 29 3 Structure of NMRi 1D spectrum or block Again for consistency with the program description found in the supplied manuals the file struc ture will be discussed in terms of blocks of length 64 The data begins at block number 4 and the length of each 1D spectrum will be LENGTH SIZE 64 for a complex data set where LENGTH is given in blocks For a real data set this number will be halved 7 5 6 GAMMA Treatment of NMRi Files When creating NMRi files GAMMA will initially write an empty header 512 prior to any spec tral data After each 1D spectrum is written the header will be updated to reflect how many lines of 1D data are present That would be the variable SPECNUM shown in Figure 29 1 1 See the previous footnote This information is only useful in clarification of the manual description Copyright Scott A Smith May 22 1998
111. t the number of contours requested is reasonable steps 1 20 Then the input value of CPN sets how contouring is done is checked CPN 1 0 1 Based on the requested contours the input threshold initial contour is checked to insure that some contours will exist I At this point the function FM contour begins looping through the chosen contour levels Loop ing through positive or increasing contours is first performed if CPN gt 0 then looping is done for negative or decreasing contours if CPN 0 When taking positive or increasing contours searching begins at the value threshold Negative or decreasing contours start at either thresh old depending upon whether positive contours have be taken Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 59 Graphics amp I O FrameMaker Functions 3 4 Contours 1 1 0 8 0 8 0 6 0 6 0 4 0 4 0 2 0 2 0 0 2t7 0 2 CPN 210 CPN 1 1 threshold 0 1 threshold 0 6 threshold 0 1 Figure 4 26 The two plots above were contained in the file FM mif and imported directly to this document without further alteration The import command within FrameMaker is under the File option These plots were produced from the example code Before the contour looping begins the value of CLI is set so that successive contour levels are ei ther larger or increasing contours or smaller or decreasing contours Additionally the v
112. tes by input Euler angles clock wise relative to these stationary axes The axes sketched by this function are axes for the data absent in one function usage of the input coordinate vector not the overall static reference axis Thus the rotations of the plotted axes follow the rotation convention of the co ordinates themselves they rotate clockwise about the axes of rotation Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 49 Graphics amp I O FrameMaker Functions 3 4 entation proceeds via first rotating about the z axis with angle alpha in this case alpha 0 so not performed followed by rotation about the new x axis with angle beta in this case about the original x axis and then followed by rotation about the new z axis with angle gamma Looking from the positive axis toward the origin all rotations appear clock wise Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 50 Graphics amp I O FrameMaker Functions 3 4 Example 1 include lt gamma h gt main cout lt lt nPlease input a radius cm double radius cin gt gt radius cout lt lt nPlease input a Euler angle alpha deg double alpha cin gt gt alpha cout lt lt nPlease input a Euler angle beta deg double beta cin gt gt beta cout lt lt nPlease input a Euler angle gamma deg double gamma cin gt gt gamma cout lt
113. th Gnuplot or other plotting programs which take ASCII It will contain one or more plots depending on the value of N Example finclude gamma h main int i npts 101 Temp index points row vector data 3 datatmp npts Vector array temp vector for 120 1 3 i data 1 datatmp Initialize vectors in array double x Temp variable for 120 i lt npts i Fill up data blocks x double i npts 2 The x value data 0 put x x 2500 0 1 The value 1st vector data 1 put x x x 12500 0 1 The y value 2nd vector data 2 put x x x x 312500 0 1 The y value 3rd vector GP IDm plots asc data 3 Write real points to ASCII file cout lt lt n n Keep the screen nice Copyright Scott A Smith May 22 1998 GAMMA Gnuplot Output 12 Graphics amp I O Index of Figures amp Tables 2 3 Gnuplot Function GP 1Dm Example 20 10 0 50 100 150 200 250 300 350 Figure 4 2 Example program result from use of the GAMMA function GP 1Dm The plot above was incorporated directly into this file using the MIF export type in Gn uplot After the plot is displayed on the screen the commands set terminal MIF set output plot mif and replot were given to have Gnuplot produce the plot in MIF format in the file plot mif The file plot mif was imported to this document with the FrameMaker import command under the File option See Also
114. the header all real values fol lowed by all imaginary values If the data is not complex the imaginary values are absent from the file A two or multi dimensional spectrum is successive 1D spectra sharing the same header in formation as depicted in the figure below NMRi File Structure Header Spectrum 2 SIZE Reals Spectrum 2 SIZE Imaginaries Spectrum SPECNUM SIZE Reals Spectrum SPECNUM SIZE Imaginaries Figure 29 1 Overall file structure of a NMRi file containing SPECNUM 1D complex spectra each of length SIZE This file structure is described in the NMRi manual LAB ONE NMR2 USER MANUAL Release 3 5 on page 29 Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 124 User Documentation NMRifFile Figures and Tables 7 3 7 5 4 Header Structure A listing of the parameters contained in the header is given in the NURI USER MANUAL Ap pendix F and also in the VMR2 USER MANUALR Appendix A The parameters discussed in the two sources do not coincide exactly but the descriptions are suitable for GAMMA purposes Of the 512 parameters contained in the header few are useful outside of the NMRi programs Those ab solutely required are given in the NMR2 manual see the beginning section Data File Format and listed here Note that here numbers range from 1 to 512 not 0 511 100 First dimension size This is SIZE in Figure 29 1 101 First dimension spectral width 107
115. tion call and will remain open with the file pointer advanced to the file end at the function return The file should be closed externally as well The NMRi parameter block is updated with each function call An optional parameter in this function is zero which if non zero will set the count of 1D spectra present in the NMRi file to zero This is done automatically in most instances but should be used if multiple NMRi files are to be produced in a single program run it is necessary to re zero the count when writing the first spectrum of all NMRi files Note that NMRi can be called with a matrix instead of a block 2D or a row vector rather than a block 1D In these instances the parameter sets are not fully written into the NMRi file Return Value Nothing when producing a NMRi file Example include lt gamma hc gt main block_1D BLK1 128 Define a 1D data block Gaussian 128 64 42 46 Set 1D block to Gaussian NMRi NMRID tst BLK1 Output 1D BLK to NMRi file block_2D BLK2 128 128 Define a 2D data block for int 120 i lt 128 i Fill 2D block with 2D Gaussian for int j 0 j lt 128 j BLK2 ij BLK1 i BLK1 j NMRi NMR2D tst BLK2 Output 2D BLK to NMRi file File fp Specify a file pointer fp open NMRND tst io_writeonly a create Open file NMRND tst block 1D BLKA 128 BLKB 128 Define two more 1D data blocks BLKA sinc 128
116. tput The range of level 2 1 5 where 1 outputs only the essential parameters of the possible 512 values Return Value This function returns an output stream Example include lt NMRiFile h gt main NMRiFile file 1 oldfile dat Open an old NMRiFile filel external name oldfile dat cout filel print header cout Output the basic header parameters 7 4 10 rows Usage include lt NMRiFile h gt int NMRiFile rows Description The function rows is used to obtain the number of rows or data blocks the NMRi file contains Return Value An integer is returned Example include lt NMRiFile h gt main Copyright Scott A Smith May 22 1998 GAMMA NMRiFile 119 User Documentation NMRifFile Figures and Tables 7 3 NMRiFile file1 oldfile dat Open an old NMRiFile filel external name oldfile dat cout lt lt No of rows filel rows Output the number of rows contained in the file 7 4 11 Usage include lt NMRiFile h gt int NMRiFile cols Description The function cols is used to obtain the number of points that each row or data blocks of the NMRi file con tains Return Value An integer is returned Example finclude lt NMRiFile h gt main NMRiFile file1 oldfile dat Open an old NMRiFile filel external name oldfile dat cout lt lt No of columns filel cols Output the number of columns contain
117. trix Data Structure variable real data imaginary data name optional Figure 25 3 Matrix data structure of a MATLAB MAT file The three sections are construcated as follows var name namlen ASCII bytes characters The last is a NUL or 0 reals mrow mcol double precision floating point numbers 8 bytes each imags Stored identically as the real data Immediately following the last real point MATLAB matrices are stored column wise unless indicated otherwise by type This means that the first data point immediatly after the variable name will correspond to the matrix point 0 0 The second point is 1 0 the third 2 0 and so on For a general discussion on moving files in and out of MATLAB see Importing and exporting data Copyright Tilo Levante Scott A Smith May 22 1998 GAMMA MATLAB I O User Documenation Routines 72 4 5 in the Tutorial Chapter Section 12 on page 2 83 in PRO MATLAB August 1987 version Copyright Tilo Levante Scott A Smith May 22 1998 GAMMA Felix I O 73 Graphics amp I O 5 Felix I O 5 1 Overview The Felix I O routines are provided to allow the transfer of spectra between a Felix file and GAM MA A few routines for reading files from the predecessor of Felix FTNMR are also included here Felix I O routines will be preferentially enhanced and users should attempt to replace the use of FTNMR with Felix entirely WARNING Felix is a finicky program which is being constantl
118. ts The contouring function takes GAMMA matrix and slices through specified contours to produce a Gnuplot MIF output file An attempt is made to group all points for each specific contour line 27 2 Gnuplot Stack Plots The contouring function takes GAMMA matrix and slices through specified contours to produce a Gnuplot MIF output file An attempt is made to group all points for each specific contour line Copyright Scott A Smith May 22 1998 GAMMA FrameMaker Output Graphics amp I O 24 FrameMaker Output Sections In This Document 3 1 FrameMaker Overview 3 2 Index of GAMMA s FrameMaker Functions 3 3 Index of Figures amp Tables 3 4 FrameMaker Functions 3 5 Routines for Matrix Output in FM 3 6 Mathematical Details amp Code Specifics Copyright Tilo Levante Scott Smith Beat H Meier page 25 page 26 page 26 page 27 page 54 page 58 May 22 1998 GAMMA FrameMaker Output 25 Graphics amp I O FrameMaker Overview 3 1 3 1 FrameMaker Overview The FrameMaker output routines are provided to allow the transfer of simulated plot data into FrameMaker compatible files This is highly useful for the preparation of documents which are to contain plots of your GAMMA simulated spectra FrameMaker has the ability to blend text equa tions and graphics Using GAMMA s FrameMaker routines one may quickly produce publication quality documents transparencies HTML pages etc that contain simulated spectra dire
119. ts were produced from the example code See Also None Copyright Tilo Levante Scott Smith Beat H Meier May 22 1998 GAMMA FrameMaker Output 54 Graphics amp I O FrameMaker Functions 3 4 3 5 Routines for Matrix Output in FM 3 5 1 FM Matrix Usage include lt FrameMaker h gt void FM Matrix const char filename gen_op amp Op int prec 2 int threshold 0 001 void FM Matrix const char filename matrix amp mx int prec 2 int threshold 0 001 Description The function FM Matrix generates a FrameMaker Mathematical Language MML file which can be direct ly imported into a FrameMaker Document For floating numbers prec default 2 digits after the decimal point will be used If either the real or imaginary part has a norm of lower than threshold it will be left away on output If both the real and imaginary part are below threshold a simple 0 is written to Output If a floating number is closer then threshold to the nearest integer the integer is outputed See example be low Return Value Nothing A new disk file in the MMF is produced for incorporation into FrameMaker Example include gamma h main matrix C cin gt gt cout lt lt c FM Matrix Testal mmf c j Dialog From Program Execution 233 gt 1 0 0 0 21 001 0 0001 gt 0 0 00001 20 1 gt 10 gt 5 3 00001 244 gt 55 gt 66 3 x 3 full matrix Copyright Tilo Levante Scott Smith Beat H Me
120. tten as complex numbers If rc is set to zero only the real data of the block is output Any parameters in BLK compatible with the NMRi parameters will be automatically transferred into the NMRi file The file is closed upon the function return The func 1 NMR2 are a products of New Methods Research Inc 7 East Genesee Street Syracuse NY 13210 Phone 315 424 0329 FAX 315 424 0356 GAMMA was tested on Sun systems running the Sun views operating system NMRI1 release 3 8 and NMR2 release 3 5 were the manuals referred to during the programming Copyright Scott A Smith May 22 1998 GAMMA NMRi I O 107 User Documenation Routines 6 3 tion will overwrite any file filename previously in existence No other NMRi file should be open during the calling of this function 2 NMRi const char filename block 2D amp BLK int rc 1 This function is similar to the use above with 1D data blocks but writes the data contained in the 2 dimensional data block BLK This is done row wise i e first row 1 of BLK is written followed by row 2 and so on until the end of the data in BLK 3 NMRi File amp file block 1D amp BLK int rcz1 When NMRi is invoked with this argument list it writes the data contained in the 1 dimensional data block BLK in NMRi format to wherever the file point er file is at The file where file is pointing is assumed to be open opened explicitly sometime prior to the func
121. uble xsize 14 double ysize 14 Description The function FM stack creates a FrameMaker file called filename in the MIF format It contains a single stack plot of dimension xsize by ysize both given in centimeters default 14 cm The data is input in the form of a matrix and the plot is of the entire matrix real data The values xinc and yinc also given in centimeters are the amount to shift the next row in the horizontal and vertical directions respectively The rows which are to be plotted are specified by the value row inc e g a row increment of 3 causes the first fourth seventh etc until the end of the matrix is reached Plotting Parameters The total plot dimension is specified by the values of xsize and ysize the entire plot will be scaled to fit into this box The amount of skewing that the plane containing the baselines i e where the zero level of the rows lie is set by the values of xinc and yinc This plane is that which is horizontally striped in the figure The value of Ax is mxrows 1 xinc and the value of Ay is mxrows 1 yinc where mxrows are the total number of rows in the input matrix The 1 is added because there is a border drawn around the plane Peak intensities will then be scaled to fill the rest of the plot area Thus vertical peak scal ing is mainly determined by combination of yinc and ysize Stack Plot Perspective
122. wn in the previous figure the start of a Felix mat file contains 4096 storage locations for parameters These points are subdivided into four parts as shown in the following figure Felix mat File Header Structure GDIRIBGI Scalars 0 1 2 3 4 5 6 7 8 9 Vectors m m m m s 3i ccs Other pw ww VY Doe Dos e Last Point 4095 Figure 4 10 Header Structure of an Felix mat file Note that the index in FORTRAN the language in which Felix is written is shifted by 1 realative to the standard C indexing used in GAMMA that is vectors start at 21 and end at 100 etc Scalars The initial header parameters are scalar parameters in that they are global matrix val ues not assignable to any specific matrix dimension For example the flag indicating whether the data points are complex or real resides here The following table describes these parameters Table 2 Felix mat File Header Scalar Parameters Point Description of Scalar Paramters Values Variable 0 Matrix Dimensions Min 2 Max 8 nd 1 Matrix Data 1 Real 2 Complex cmplx 2 Total Number Bricks in the Matrix Includes 1 for Header brks 3 Bricks to Span Matrix Row Block blks 4 Unknown Usually 0 Copyright Scott A Smith May 22 1998 GAMMA Graphics amp I O Felix I O 97 Table 2 Felix mat File Header Scalar Parameters Unknown De
123. write command wr is one means to get Felix to output specific dat files which can then Copyright Scott A Smith May 22 1998 GAMMA Felix I O 86 Graphics amp I O be blended together with this function Return Value Nothing Felix header information is written to standard output Example The following program reads in a concatenated Felix dat file allows the user to manipulate it the outputs the result into a FrameMaker stack plot Note that the function is used early in the program the rest of the code simply manipulates the data and spits out a FrameMaker plot include lt gamma h gt main int argc char argv cout lt lt n tConcatonated Felix dat File gt FrameMaker mif Stack Plotin Read in Filename amp Felix File String filename Name of spin system file query parameter argc argv 1 Get filename from command n tFelix concatonated dat filename filename line or ask for it block 2D BLK Felix d 1 Read Concatonated Felix dat File Alter the Concatonated Matrix Dimensions If Desired int nc BLK cols int nr BLK rows char yn cout lt lt n tThe Concatonated Data Matrix is lt lt BLK rows lt lt By lt lt BLK cols cout lt lt n n tDo You Wish to Plot Only Some of the Columns y n cin gt gt yn int ic 0 ncols nc if yn y cout lt lt n tPlease Enter First Column Index 0 lt
124. x is used to write Felix dat or serial files The data to be written in is contained in either a one dimensional or two dimensional data block BLK The Felix output file is specified either by a file name filename or by a pointer to an open file fp The parameter rc specifies whether real or complex data is written For real rc 0 and for complex re 1 This will default to complex if left out of the function argument list 1 Felix const char filename block 1D amp BLK int re 1 When Felix is invoked with this argument list it writes the data contained in the 1 dimensional data block BLK to a newly constructed file filename in the Felix dat format If re is 1 default the data is written as complex numbers If rc is set to zero only the real data of the block is output Any parameters in BLK compatible with the Felix parameters will be automatically transferred into the Felix file The output file is closed upon the function return The function will overwrite any file filename previously in existence 2 Felix const char filename block 2D amp BLK int rc 1 This function is similar to the use above with 1D data blocks but writes the data contained in the 2 dimensional data block BLK This is done row wise i e first row of BLK is written followed by row 2 and so on until the end of the data in BLK 3 Felix File amp file block 1D amp BLK int rc 1 When Felix is invoked with this argument list it writes the data cont
125. y altered by its creators The file structures read and produced by Felix if altered may render many if not all of these functions useless on later Felix versions 5 2 Available Felix Functions Reading and Writing Felix dat Files Felix Write a Felix dat file page 75 Felix 1D Read a Felix dat file into GAMMA vector page 81 Felix 2D Read a Felix dat file into a GAMMA matrix page 82 Felix header Read the header of a Felix dat file page 84 Felix d cat Read a concatenated Felix dat file into GAMMA matrix page 85 Reading and Writing Felix mat Files Felix mat Write a Felix mat file page 90 Felix mat 1D Read a Felix dat file into GAMMA vector page 90 Felix mat header Read a Felix dat file into a GAMMA matrix page 91 5 3 Discussion of Felix 5 6 1 Felix dat File Structure page 92 5 6 2 Felix dat Data Structure page 94 5 6 3 Felix mat File Structure page 94 5 6 4 Felix mat File Header page 96 5 6 5 Felix mat Data Structure page 101 1 Felix is an data processing program from Hare Research Inc 14810 216th Avenue NE Woodinville WA 98072 USA Version 1 0 was used in preparation and testing of these subroutines All examples were performed on a SUN SPARCstation under SUNViews Any references to the Felix manual is for the March 1990 copy Copyright Scott A Smith May 22 1998 GAMMA Felix I O Graphics amp I O 74 5 4 Felix Figures amp Tables
126. yright Scott A Smith May 22 1998 GAMMA NMRi I O 106 User Documenation Overview 6 1 6 NMRiUI O 6 1 Overview The NMRi I O routines are provided to allow the transfer of data between GAMMA and the pro grams NMRI and NMR2 6 2 Available NMRi Functions NMRi Write an NMRi file page 106 NMRi 1D Read an NMRi file into GAMMA vector page 108 NMRi 2D Read an NMRi file into GAMMA matrix page 108 NMRi header Read the header of an NMRi file page 109 6 3 Routines 6 3 1 NMRi Usage include lt NMRi h gt void NMRi const char filename block_1D amp BLK int rc 1 void NMRi const char filename block 2D amp BLK int rc 1 void NMRi File amp file block 1D amp BLK int rc 1 int zero 0 Description The function NMRi is used to write files in the standard NMRi format The data is contained in the data block The file is specified by either the name filename or by the file pointer file The parameter rc indicates whether to write real or complex default data If rc is 0 only the real data will be output If rc is negative only the imaginary data is written as reals and if rc gt 0 the complex data is written 1 NMRi const char filename block 1D amp BLK int rcz1 When NMRi is invoked with this argument list it writes the data contained in the 1 dimensional data block BLK to a newly constructed file file name in the NMRi format If rc is 1 default the data is wri
Download Pdf Manuals
Related Search
Related Contents
cwx unite terminale cassette cassette terminal unit unità オートパイロット Chevy Truck Header instructions Afiscooter-C - Imperial Green 医療機器を安心・安全にご使用して頂くために (PDFファイル 2903kb) CardS12 Photoshop Elements 7 - Der Meisterkurs - *ISBN 978-3-8272-4416 主な故障状況と対処方法(取扱説明書より抜粋)pdf OWNER`S MANUAL PLASMA TV Copyright © All rights reserved.
Failed to retrieve file