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
7a72d260
Commit
7a72d260
authored
8 years ago
by
Антон Кудряшов
Browse files
Options
Downloads
Patches
Plain Diff
- fixed noninterpolated values
- fixed cell checking
parent
93302d6b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
WindStressPRM/WindStressPRM.cs
+25
-18
25 additions, 18 deletions
WindStressPRM/WindStressPRM.cs
with
25 additions
and
18 deletions
WindStressPRM/WindStressPRM.cs
+
25
−
18
View file @
7a72d260
...
...
@@ -121,7 +121,7 @@ namespace WindStressPRM
return
false
;
}
// пустые данные
if
(
res1
)
{
if
(
res1
==
res2
==
true
)
{
return
true
;
}
///Скорость ветра на высоте 10м от поверхности на Земле не может превышать 70м/c
...
...
@@ -178,17 +178,23 @@ namespace WindStressPRM
/// <returns></returns>
public
bool
CheckValue
()
{
bool
c5
=
Double
.
IsNaN
(
Wind5
);
bool
c10
=
Double
.
IsNaN
(
Wind10
);
bool
c15
=
Double
.
IsNaN
(
Wind15
);
if
(
c5
!=
c10
||
c5
!=
c15
||
c5
!=
c10
)
{
return
false
;
double
w5
=
Wind5
;
double
w10
=
Wind10
;
double
w15
=
Wind15
;
if
(
Double
.
IsNaN
(
w5
))
// if is Nan - zerofied it.
{
w5
=
0
;
}
if
(
c5
)
{
return
true
;
if
(
Double
.
IsNaN
(
w10
))
{
w10
=
0
;
}
if
(
Double
.
IsNaN
(
w15
))
{
w15
=
0
;
}
// ветер по модулю не должен превышать 70м/с
return
Math
.
Abs
(
Wind
5
)
<
70
&&
Math
.
Abs
(
Wind
10
)
<
70
&&
Math
.
Abs
(
Wind
15
)
<
70
;
return
Math
.
Abs
(
w
5
)
<
70
&&
Math
.
Abs
(
w
10
)
<
70
&&
Math
.
Abs
(
w
15
)
<
70
;
}
}
/// <summary>
...
...
@@ -523,14 +529,7 @@ namespace WindStressPRM
//fill output
Output
output
=
new
Output
();
output
.
DisabledStations
=
new
List
<
PowerStation
>();
output
.
DisabledLines
=
new
List
<
Powerline
>();
foreach
(
Powerline
line
in
input
.
PowerLines
)
{
if
(
line
.
IsBroken
)
{
output
.
DisabledLines
.
Add
(
line
);
}
}
output
.
DisabledLines
=
prmBrokenLines
;
foreach
(
PowerStation
powerStation
in
input
.
PowerStations
)
{
//stations of type pole can be disabled if the line is broken
...
...
@@ -720,6 +719,13 @@ namespace WindStressPRM
double
uwind
=
interpol
(
coords
,
FunctionType
.
FunctionVelocityX
);
double
vwind
=
interpol
(
coords
,
FunctionType
.
FunctionVelocityY
);
double
climwind
=
interpol
(
coords
,
climateType
);
if
(
Double
.
IsNaN
(
uwind
)
||
Double
.
IsNaN
(
vwind
)
||
Double
.
IsNaN
(
climwind
))
{
// interpolation fail. we can't say everything about here
// discussion: also we can save these points for detail analysis
res
=
false
;
continue
;
}
double
umod
=
Math
.
Sqrt
(
uwind
*
uwind
+
vwind
*
vwind
);
;
double
angleline
=
Math
.
Atan2
((
coord2
.
Y
-
coord1
.
Y
),
(
coord2
.
X
-
coord1
.
X
));
double
anglewind
=
Math
.
Atan2
(
vwind
,
uwind
)
-
angleline
;
...
...
@@ -954,7 +960,8 @@ namespace WindStressPRM
// tests indicates that value at test-cell is missed.
if
(
testTopRight
&&
testTopLeft
&&
testBotLeft
&&
testBotRight
)
{
throw
new
Exception
(
"Current value in such a bad place, you need to fill these place with raster values"
);
// Current value in such a bad place, you need to fill these place with raster values
return
Double
.
NaN
;
}
int
count
=
0
;
if
(
testBotLeft
)
...
...
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