Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MES_Wind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debolskiy Andrey
MES_Wind
Commits
4adcb310
Commit
4adcb310
authored
8 years ago
by
Debolskiy Andrey
Browse files
Options
Downloads
Patches
Plain Diff
addded 25 clim check
parent
77df24fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MES_Wind/frmMain.cs
+5
-3
5 additions, 3 deletions
MES_Wind/frmMain.cs
WindStressPRM/WindStressPRM.cs
+7
-6
7 additions, 6 deletions
WindStressPRM/WindStressPRM.cs
with
12 additions
and
9 deletions
MES_Wind/frmMain.cs
+
5
−
3
View file @
4adcb310
...
...
@@ -85,6 +85,7 @@ namespace MES_Wind
map1
.
AddLayer
(
file_path
+
"1977\\clim5_test.asc"
);
map1
.
AddLayer
(
file_path
+
"1977\\clim10_test.asc"
);
map1
.
AddLayer
(
file_path
+
"1977\\clim15_test.asc"
);
map1
.
AddLayer
(
file_path
+
"1987\\clim25_test.asc"
);
map1
.
AddLayer
(
file_path
+
"reslines.shp"
);
//map1.ZoomToMaxExtent();
}
...
...
@@ -99,6 +100,7 @@ namespace MES_Wind
IMapRasterLayer
clim5RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim10RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim15RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim25RasterLayer
=
default
(
IMapRasterLayer
);
if
(
map1
.
GetRasterLayers
().
Count
()
==
1
)
{
MessageBox
.
Show
(
"Please add a raster layer"
);
...
...
@@ -110,6 +112,7 @@ namespace MES_Wind
clim5RasterLayer
=
map1
.
GetRasterLayers
()[
2
];
clim10RasterLayer
=
map1
.
GetRasterLayers
()[
3
];
clim15RasterLayer
=
map1
.
GetRasterLayers
()[
4
];
clim25RasterLayer
=
map1
.
GetRasterLayers
()[
5
];
//get the powerline line layer
IMapLineLayer
pwlLayer
=
default
(
IMapLineLayer
);
if
(
map1
.
GetLineLayers
().
Count
()
==
0
)
...
...
@@ -175,8 +178,7 @@ namespace MES_Wind
double
clim5
=
clim5RasterLayer
.
DataSet
.
Value
[
i
,
j
];
double
clim10
=
clim10RasterLayer
.
DataSet
.
Value
[
i
,
j
]
+
1
;
double
clim15
=
clim15RasterLayer
.
DataSet
.
Value
[
i
,
j
];
// TODO: Add clim25 layer
double
clim25
=
0
;
double
clim25
=
clim25RasterLayer
.
DataSet
.
Value
[
i
,
j
];
if
(
Math
.
Abs
(
clim5
-
RasterMissingValue
)
<
eps
)
{
clim5
=
Double
.
NaN
;
...
...
@@ -204,7 +206,7 @@ namespace MES_Wind
WindStressPRM
.
Powerline
dummyline
=
new
WindStressPRM
.
Powerline
();
DataRow
featureData
=
feature
.
DataRow
;
dummyline
.
Identifier
=
feature
.
Fid
;
dummyline
.
Year
=
int
.
Parse
(
featureData
[
"Year"
].
ToString
());
dummyline
.
Year
=
1990
;
//
int.Parse(featureData["Year"].ToString());
dummyline
.
Height
=
double
.
Parse
(
featureData
[
"HeightOffs"
].
ToString
());
dummyline
.
Voltage
=
int
.
Parse
(
featureData
[
"Voltage"
].
ToString
());
dummyline
.
PointFromID
=
int
.
Parse
(
featureData
[
"PointFrom"
].
ToString
());
...
...
This diff is collapsed.
Click to expand it.
WindStressPRM/WindStressPRM.cs
+
7
−
6
View file @
4adcb310
...
...
@@ -145,7 +145,7 @@ namespace WindStressPRM
double
y1
=
points
[
i
-
1
].
Y
;
double
x2
=
points
[
i
].
X
;
double
y2
=
points
[
i
].
Y
;
bool
result
=
linearLineIsBroken
(
points
[
i
-
1
],
points
[
i
],
powerCurve
.
Height
,
powerCurve
.
Voltage
);
bool
result
=
linearLineIsBroken
(
points
[
i
-
1
],
points
[
i
],
powerCurve
.
Height
,
powerCurve
.
Voltage
,
powerCurve
.
Year
);
checkList
.
Add
(
result
);
}
foreach
(
bool
chkpnt
in
checkList
)
...
...
@@ -174,7 +174,7 @@ namespace WindStressPRM
/// <param name="heightLine">height</param>
/// <param name="power">power for climatology switches</param>
/// <returns>true if line is broken false otherwise</returns>
private
bool
linearLineIsBroken
(
Coordinate
coord1
,
Coordinate
coord2
,
double
heightLine
,
int
power
)
private
bool
linearLineIsBroken
(
Coordinate
coord1
,
Coordinate
coord2
,
double
heightLine
,
int
power
,
int
year
)
{
double
distance
=
Math
.
Sqrt
((
coord2
.
X
-
coord1
.
X
)
*
(
coord2
.
X
-
coord1
.
X
)
+
(
coord2
.
Y
-
coord1
.
Y
)
*
(
coord2
.
Y
-
coord1
.
Y
));
double
distpropD
=
distance
/
Input
.
DistThreshold
;
...
...
@@ -204,10 +204,11 @@ namespace WindStressPRM
pointlist
.
Add
(
midpoint
);
}
Func
<
ClimateCell
,
double
>
climateClosure
=
delegate
(
ClimateCell
cell
)
{
// if year > 1987
// clim type = 25
//
if
(
power
>
5
&&
power
<
330
)
if
(
year
>=
1987
)
{
return
cell
.
Wind25
;
}
else
if
(
power
>
5
&&
power
<
330
)
{
return
cell
.
Wind10
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment