-
Notifications
You must be signed in to change notification settings - Fork 2
/
LSDGrainMatrix.hpp
83 lines (71 loc) · 2.19 KB
/
LSDGrainMatrix.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/// LSDGrainMatrix.hpp
/// HEADER FILE
/*
* SUMMARY
*
* LSDGrainMatrix is a class that defines an object to store data
* about the surface and subsurface layers of raster or catchment.
* It stores the grainsize fractions (of n fractions) for a given number
* of surface and n subsurface layers. Be warned it is quite a large object
* if you wish to define multiple fractions and multiple
* subsurface layers!
*
* @author Declan Valters
* @date 2016
* University of Manchester
* @contact declan.valters@manchester.ac.uk
* @version 0.01
*
* Released under the GNU v2 Public License
*
*/
#include <string>
#include <fstream>
#include <sstream>
#include "TNT/tnt.h"
#ifndef LSDGrainMatrix_H
#define LSDGrainMatrix_H
/// @brief This class is used primarily for the LSDCatchmentModel, to package up data
/// about the stratigraphy and grain fraction data into neat objects.
class LSDGrainMatrix
{
public:
friend class LSDRaster;
/*
LSDGrainMatrix()
{
create(); //throws an error -- we don't want an empty object
}
*/
/*
/// Create a GrainMatrix object by reading in a file
LSDGrainMatrix(std::string fname, std::string fname_extension)
{
create(fname, fname_extension);
}
*/
/// Create a GrainMatrix object from references to arrays (in LSDCatchmentModel, though needn't be this object)
LSDGrainMatrix( int imax, int jmax, int NoDataVal, int G_MAX,
TNT::Array2D<int>& indexes,
TNT::Array2D<double>& graindatas,
TNT::Array3D<double>& stratadatas)
: rasterIndex(indexes), grainData(graindatas), strataData(stratadatas)
{
create(imax, jmax, NoDataVal, G_MAX);
}
/// Writes the GrainMatrix object to an output text file (Warning: large file!)
void write_grainMatrix_to_ascii_file(std::string filename, std::string fname_extension);
protected:
TNT::Array2D<int>& rasterIndex;
TNT::Array2D<double>& grainData;
TNT::Array3D<double>& strataData;
int NCols;
int NRows;
int NoData;
int GrainFracMax;
private:
//void create();
//void create(std::string fname, std::string fname_extension);
void create(int imax, int jmax, int NoDataVal, int G_MAX);
};
#endif // LSDGRAINMATRIX_HPP