Download GAMMA Graphics Documentation
Transcript
GAMMA
Graphics & I/O
Felix I/O
86
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 <gamma.h>
main (int argc, char* argv[])
{
cout << “\n\tConcatonated Felix (.dat) File -> FrameMaker (.mif) Stack Plot\n”;
//
Read in Filename & 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_cat(filename, 1);
// Read Concatonated Felix .dat File
//
Alter the Concatonated Matrix Dimensions If Desired
int nc = BLK.cols();
int nr = BLK.rows();
char yn;
cout << “\n\tThe Concatonated Data Matrix is “ << BLK.rows() << “ By “ << BLK.cols();
cout << “\n\n\tDo You Wish to Plot Only Some of the Columns [y/n]? “;
cin >> yn;
int ic=0, ncols=nc;
if(yn == ‘y’)
{
cout << “\n\tPlease Enter First Column Index [0, “ << nc-2 << “]: “;
cin >> ic;
cout << “\n\tPlease the Number of Colums [2, “ << nc-ic << “]: “;
cin >> ncols;
}
cout << “\n\tDo You Wish to Plot Only Some of the Rows [y/n]? “;
cin >> yn;
int ir=0, nrows=nr;
if(yn == ‘y’)
{
cout << “\n\tPlease Enter First Row Index [0, “ << nr-2 << “]: “;
cin >> ir;
Copyright Scott A. Smith
May 22, 1998