magnetic_scattrelease-4.2.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249unittest-saveload
Last change
on this file since c7634fd was
d85c194,
checked in by Piotr Rozyczko <piotr.rozyczko@…>, 9 years ago
|
Remaining modules refactored
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[aa639ea] | 1 | /** \file iq.cc */ |
---|
| 2 | |
---|
| 3 | #include "iq.h" |
---|
| 4 | #include <fstream> |
---|
| 5 | #include <iostream> |
---|
| 6 | |
---|
| 7 | using namespace std; |
---|
| 8 | |
---|
| 9 | IQ::IQ(int numI){ |
---|
| 10 | |
---|
| 11 | numI_ = numI; |
---|
| 12 | |
---|
| 13 | Array2D<double> iq1(numI, 2, 0.0); |
---|
| 14 | |
---|
| 15 | iq_data = iq1; |
---|
| 16 | } |
---|
| 17 | |
---|
| 18 | IQ::IQ(int numI,double qmin, double qmax){ |
---|
| 19 | |
---|
| 20 | numI_ = numI; |
---|
| 21 | qmin_ = qmin; |
---|
| 22 | qmax_ = qmax; |
---|
| 23 | |
---|
| 24 | Array2D<double> iq1(numI, 2, 0.0); |
---|
| 25 | |
---|
| 26 | iq_data = iq1; |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | void IQ::SetQmin(double qmin){ |
---|
| 30 | qmin_ = qmin; |
---|
| 31 | |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | void IQ::SetQmax(double qmax){ |
---|
| 35 | qmax_ = qmax; |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | void IQ::SetContrast(double delrho){ |
---|
| 39 | delrho_ = delrho; |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | void IQ::SetVolFrac(double vol_frac){ |
---|
| 43 | vol_frac_ = vol_frac; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | double IQ::GetQmin(){ |
---|
| 47 | return qmin_; |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | double IQ::GetQmax(){ |
---|
| 51 | return qmax_; |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | double IQ::GetContrast(){ |
---|
| 55 | return delrho_; |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | double IQ::GetVolFrac(){ |
---|
| 59 | return vol_frac_; |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | int IQ::GetNumI(){ |
---|
| 63 | return numI_; |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | void IQ::OutputIQ(string fiq){ |
---|
| 67 | ofstream outfile(fiq.c_str()); |
---|
| 68 | if (!outfile) { |
---|
| 69 | cerr << "error: unable to open output file: " |
---|
| 70 | << outfile << endl; |
---|
| 71 | exit(1); |
---|
| 72 | } |
---|
| 73 | for (int i = 0; i < iq_data.dim1(); ++i){ |
---|
| 74 | outfile << iq_data[i][0] << " " << iq_data[i][1] << endl; |
---|
| 75 | } |
---|
| 76 | // fprintf(fp,"%15lf%15lf%15lf\n", (j+1)*rstep, cor[j]/cormax, "0"); |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.