Go to the documentation of this file.
13 Raster::Raster(
int NROWS,
int NCOLS,
double XLL,
double YLL,
double CELLSIZE ,
int NODATA,
double VALUE)
19 xur=XLL+NCOLS*CELLSIZE;
20 yur=YLL+NROWS*CELLSIZE;
23 std::vector<double> rasterRow(NCOLS,VALUE);
24 std::vector< std::vector<double> > newRaster(NROWS, rasterRow);
39 std::vector<double> rasterRow(
ncols,value);
40 std::vector< std::vector<double> > newRaster(
nrows, rasterRow);
55 std::vector< std::vector<double> > newRaster(
nrows, rasterRow);
67 fout <<
"nrows "<<
nrows <<
"\n";
68 fout <<
"ncols "<<
ncols <<
"\n";
69 fout <<
"xllcorner "<<
xll <<
"\n";
70 fout <<
"yllcorner "<<
yll <<
"\n";
71 fout <<
"cellsize "<<
cellsize <<
"\n";
72 fout <<
"NODATA_value -9999"<<
"\n";
74 std::vector< std::vector<double> >::iterator
row;
75 std::vector<double>::iterator col;
79 for(col=
row->begin();col!=
row->end();col++)
96 std::ifstream fin(fileName);
98 fin>>tmp; fin >>
ncols;
99 fin>>tmp; fin >>
nrows;
100 fin>>tmp; fin >>
xll;
101 fin>>tmp; fin >>
yll;
114 std::vector<double> rowVector;
115 for(
int col=0;col<
ncols;col++)
118 rowVector.push_back(value);
120 data.push_back(rowVector);
141 std::vector< std::vector<double> > newRaster(
nrows, rasterRow);
144 for(
int col=0;col<this->
ncols;col++)
178 std::cout<<
"Value in "<<
x<<
","<<
y<<
" is outside of raster boundaries";
202 for(
int col=0;col<
ncols;col++)
219 for(
int col=0;col<
ncols;col++)
236 for(
int col=0;col<
ncols;col++)
248 for(
int col=0;col<
ncols;col++)
259 std::vector<double> vals,dists;
264 std::cout<<
"Value is outside of raster boundaries";
274 else if(
y>=this->
getY(row))
280 int row1,row2,row3,row4,col1,col2,col3,col4;
295 if (row2<0 or col4>=this->
ncols)
297 std::cout<<
"Value is outside of raster boundaries";
313 std::cout<<
"Value is outside of raster boundaries";
328 if (row2>=this->
nrows or col3<0)
330 std::cout<<
"Value is outside of raster boundaries";
346 if (row2<0 or col3<0)
348 std::cout<<
"Value is outside of raster boundaries";
357 vals.push_back(
data[row1][col1]);
361 vals.push_back(
data[row2][col2]);
365 vals.push_back(
data[row3][col3]);
370 vals.push_back(
data[row4][col4]);
380 a=a+vals[j]/
pow(dists[j],2);
381 b=
b+1./
pow(dists[j],2);
396 double xrest=xsteps-floor(xsteps);
397 double yrest=ysteps-floor(ysteps);
398 if(xrest!=0 or yrest!=0)
418 for(
int col=0;col<
ncols;col++)
440 for(
int col=0;col<temp.
ncols;col++)
456 for(
int col=0;col<temp.
ncols;col++)
473 for(
int col=0;col<temp.
ncols;col++)
488 for(
int col=0;col<temp.
ncols;col++)
502 for(
int col=0;col<temp.
ncols;col++)
516 for(
int col=0;col<temp.
ncols;col++)
530 for(
int col=0;col<temp.
ncols;col++)
544 for(
int col=0;col<temp.
ncols;col++)
558 for(
int col=0;col<temp.
ncols;col++)
572 for(
int col=0;col<temp.
ncols;col++)
586 for(
int col=0;col<temp.
ncols;col++)
601 for(
int col=0;col<temp.
ncols;col++)
615 for(
int col=0;col<temp.
ncols;col++)
629 for(
int col=0;col<temp.
ncols;col++)
643 for(
int col=0;col<temp.
ncols;col++)
657 for(
int col=0;col<temp.
ncols;col++)
671 for(
int col=0;col<temp.
ncols;col++)
bool conformal(const Raster &rast)
bool inside(double x, double y)
int write(const char fileName[])
double getValue(double x, double y)
Raster operator<=(const Raster &rast, const double value)
std::vector< std::vector< double > > data
Raster operator-(const Raster &rast1, const Raster &rast2)
void translate(const double &x, const double &y)
Raster operator+(const Raster &rast1, const Raster &rast2)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
int read(const char fileName[])
double interpValue(double x, double y)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Raster intersect(const Raster &rast1, const Raster &rast2)
Raster operator>(const Raster &rast, const double value)
void whereAdd(const Raster &rast, double value)
Raster & operator=(const Raster &rast)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Raster operator/(const Raster &rast1, const Raster &rast2)
Raster operator<(const Raster &rast, const double value)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Raster operator>=(const Raster &rast, const double value)
Raster where(const Raster &rast, const double &val1, const double &val2)
Raster operator*(const Raster &rast1, const Raster &rast2)
int getIndex(double x, double y, int &row, int &col)
Raster operator==(const Raster &rast, const double value)
bool match(const Raster &rast)