ARTS
2.0.49
Main Page
Classes
Class List
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
Related Functions
a
c
i
l
m
o
p
s
t
v
x
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
i
j
l
m
n
o
p
r
s
t
v
w
x
y
z
Variables
a
b
c
d
e
f
g
h
j
k
l
m
n
o
p
r
s
t
v
w
Typedefs
a
c
d
e
f
g
h
i
j
k
l
m
n
p
r
s
u
v
z
Enumerations
Enumerator
a
e
f
g
i
m
n
p
s
u
v
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
test_gridded_fields.cc
Go to the documentation of this file.
1
#include "
matpack.h
"
2
#include "
make_array.h
"
3
#include "
gridded_fields.h
"
4
5
int
main
(
void
)
6
{
7
// Creating two gridded fields
9
GriddedField1
gfone(
"I'm a GriddedField1"
);
10
GriddedField2
gftwo;
11
12
gftwo.
set_name
(
"I'm a GriddedField2"
);
13
14
15
// Initializing the grids
17
Vector
gfonegrid(1,5,1);
// gfonegrid = [1,2,3,4,5]
18
gfone.
set_grid
(0, gfonegrid);
// Set grid for the vector elements.
19
20
Vector
gftwogrid0(1,5,1);
// gftwogrid0 = [1,2,3,4,5]
21
MakeArray<String>
gftwogrid1(
"Chan1"
,
"Chan2"
,
"Chan3"
);
22
23
gftwo.
set_grid
(0, gftwogrid0);
// Set grid for the matrix rows.
24
gftwo.
set_grid
(1, gftwogrid1);
// Set grid for the matrix columns.
25
26
gfone.
set_grid_name
(0,
"Pressure"
);
27
28
gftwo.
set_grid_name
(0,
"Pressure"
);
29
gftwo.
set_grid_name
(1,
"Channel"
);
30
31
// Initializing the data
33
Vector
avector(1,4,0.5);
// avector = [1,1.5,2,2.5]
34
35
gfone.
data
= avector;
36
37
cout << gfone;
38
39
Matrix
amatrix(5,3,4.);
// amatrix = [[4,4,4],[4,4,4],...]
40
41
gftwo.
data
= amatrix;
42
43
// Consistency check
45
46
if
(!gfone.checksize())
47
cout << gfone.get_name() <<
": Sizes of grid and data don't match"
<< endl;
48
49
// This should fail!
50
if
(!gftwo.
checksize
())
51
cout << gftwo.
get_name
() <<
": Sizes of grids and data don't match"
<< endl;
52
53
// Output
55
56
cout <<
"GriddedField1: "
<< gfone << endl;
57
cout <<
"GriddedField2: "
<< gftwo << endl;
58
59
return
0;
60
}
61
GriddedField2
Definition:
gridded_fields.h:230
Matrix
The Matrix class.
Definition:
matpackI.h:767
gridded_fields.h
Implementation of gridded fields.
GriddedField::set_grid_name
void set_grid_name(Index i, const String &s)
Set grid name.
Definition:
gridded_fields.h:161
matpack.h
main
int main(void)
Definition:
test_gridded_fields.cc:5
GriddedField1::data
Vector data
Definition:
gridded_fields.h:225
GriddedField2::data
Matrix data
Definition:
gridded_fields.h:269
GriddedField::set_name
void set_name(const String &s)
Set name of this gridded field.
Definition:
gridded_fields.h:169
make_array.h
Implements the class MakeArray, which is a derived class of Array, allowing explicit initialization.
GriddedField::get_name
const String & get_name() const
Get the name of this gridded field.
Definition:
gridded_fields.h:148
GriddedField2::checksize
virtual bool checksize() const
Consistency check.
Definition:
gridded_fields.h:244
GriddedField::set_grid
void set_grid(Index i, const Vector &g)
Set a numeric grid.
Definition:
gridded_fields.cc:223
GriddedField1
Definition:
gridded_fields.h:189
MakeArray
Explicit construction of Arrays.
Definition:
make_array.h:52
Vector
The Vector class.
Definition:
matpackI.h:555
src
test_gridded_fields.cc
Generated by
1.8.20