Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingleData.java @ 8554:3a0522f1a532
Morphological width imported and stored with heights is redundant to table morphologic_width.
author | "Tom Gottfried <tom@intevation.de>" |
---|---|
date | Mon, 16 Feb 2015 09:00:08 +0100 |
parents | 856701739443 |
children |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4533
diff
changeset
|
9 package org.dive4elements.river.artifacts.model.minfo; |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
11 import gnu.trove.TDoubleArrayList; |
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
12 |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 |
7391
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6149
diff
changeset
|
14 public class BedHeightSingleData |
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6149
diff
changeset
|
15 extends BedHeightData |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 { |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
7894
diff
changeset
|
17 protected Integer year; |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
18 protected TDoubleArrayList data_gap; |
7828
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7391
diff
changeset
|
19 protected TDoubleArrayList soundingWidth; |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 |
7391
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6149
diff
changeset
|
21 public BedHeightSingleData() { |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 super(); |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
23 data_gap = new TDoubleArrayList(); |
7828
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7391
diff
changeset
|
24 soundingWidth = new TDoubleArrayList(); |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 } |
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 |
7391
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6149
diff
changeset
|
27 public BedHeightSingleData(String name) { |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 super(name); |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
29 data_gap = new TDoubleArrayList(); |
7828
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7391
diff
changeset
|
30 soundingWidth = new TDoubleArrayList(); |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 } |
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 |
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 public void add( |
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 double value, |
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 double station, |
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 double gap, |
7829
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
37 double sounding, |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
7894
diff
changeset
|
38 Integer year |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 ) { |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
40 super.add(value, station); |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
7894
diff
changeset
|
41 if (year != null) { |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
7894
diff
changeset
|
42 this.year = year; |
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
7894
diff
changeset
|
43 } |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
44 this.data_gap.add(gap); |
7829
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
45 this.soundingWidth.add(sounding); |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 } |
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 |
8169
856701739443
Handle missing years in bed height differences without assuming an unknown year to be BC 1.
"Tom Gottfried <tom@intevation.de>"
parents:
7894
diff
changeset
|
48 public Integer getYear() { |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 return this.year; |
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 } |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
51 |
7828
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7391
diff
changeset
|
52 public double getSoundingWidth(int idx) { |
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7391
diff
changeset
|
53 return this.soundingWidth.getQuick(idx); |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
54 } |
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
55 |
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
56 public double getDataGap(int idx) { |
6149
3c8147ba35a6
Bed height: Removed braindead index determination code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
57 return this.data_gap.getQuick(idx); |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
58 } |
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
59 |
7828
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7391
diff
changeset
|
60 public double getSoundingWidth(double station) { |
6149
3c8147ba35a6
Bed height: Removed braindead index determination code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
61 int index = this.station.indexOf(station); |
7828
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7391
diff
changeset
|
62 return index >= 0 ? soundingWidth.getQuick(index): Double.NaN; |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
63 } |
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
64 |
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
65 public double getDataGap(double station) { |
6149
3c8147ba35a6
Bed height: Removed braindead index determination code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
66 int index = this.station.indexOf(station); |
3c8147ba35a6
Bed height: Removed braindead index determination code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
67 return index >= 0 ? data_gap.getQuick(index) : Double.NaN; |
3897
bce2dd4310a6
MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3886
diff
changeset
|
68 } |
4533
0a0ab6909cd8
Add method to get all morph width of a BedHeigthSingle object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3897
diff
changeset
|
69 |
7828
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7391
diff
changeset
|
70 public double[] getSoundingWidths() { |
8faa8cfd2385
Renamed the incorrectly named morph width to sounding width.
Raimund Renkert <rrenkert@intevation.de>
parents:
7391
diff
changeset
|
71 return this.soundingWidth.toNativeArray(); |
4533
0a0ab6909cd8
Add method to get all morph width of a BedHeigthSingle object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3897
diff
changeset
|
72 } |
7829
1aba75321441
Added morph. active width to bed height difference calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
7828
diff
changeset
|
73 |
3886
633fbb61a0cc
Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 } |