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
4bd177f8
Commit
4bd177f8
authored
8 years ago
by
Антон Кудряшов
Browse files
Options
Downloads
Patches
Plain Diff
- check in interpolation for missing values
parent
1d6b37b6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
WindStressPRM/WindStressPRM.cs
+66
-1
66 additions, 1 deletion
WindStressPRM/WindStressPRM.cs
with
66 additions
and
1 deletion
WindStressPRM/WindStressPRM.cs
+
66
−
1
View file @
4bd177f8
...
...
@@ -502,6 +502,18 @@ namespace WindStressPRM
return
500
;
}
}
/// <summary>
/// missing raster value for cells, if you haven't normal value use this one.
/// потерянное значение для растрового объекта; Если Вы не имеете данных - используйте это значение
/// </summary>
public
double
kMissingRasterValue
{
get
{
return
-
9999
;
}
}
}
/// <summary>
/// Output
...
...
@@ -980,7 +992,60 @@ namespace WindStressPRM
double
valTopLeft
=
valueForFunction
(
functionType
,
rcTopLeft
);
double
valTopRight
=
valueForFunction
(
functionType
,
rcTopRight
);
Coordinate
origin
=
cellToProjection
(
rcBotLeft
,
functionType
);
//PRM_coordinate last = cellToProjection(rcTopRight, functionType);//test only
bool
testBotLeft
=
valBotLeft
==
Input
.
kMissingRasterValue
;
bool
testBotRight
=
valBotRight
==
Input
.
kMissingRasterValue
;
bool
testTopLeft
=
valTopLeft
==
Input
.
kMissingRasterValue
;
bool
testTopRight
=
valTopRight
==
Input
.
kMissingRasterValue
;
if
(
testBotLeft
||
testBotRight
||
testTopLeft
||
testTopRight
)
{
// 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"
);
}
int
count
=
0
;
if
(
testBotLeft
)
{
valBotLeft
=
0
;
count
++;
}
if
(
testBotRight
)
{
valBotRight
=
0
;
count
++;
}
if
(
testTopLeft
)
{
valTopLeft
=
0
;
count
++;
}
if
(
testTopRight
)
{
valTopRight
=
0
;
count
++;
}
//of course there is count not 0;
if
(
count
==
0
)
{
throw
new
Exception
(
"Interpolation Logic Error"
);
}
double
average
=
(
valTopLeft
+
valTopRight
+
valBotLeft
+
valBotRight
)/
count
;
if
(
testBotLeft
)
{
valBotLeft
=
average
;
}
if
(
testBotRight
)
{
valBotRight
=
average
;
}
if
(
testTopLeft
)
{
valTopLeft
=
average
;
}
if
(
testTopRight
)
{
valTopRight
=
average
;
}
}
// sizes for cell
double
hx
=
cellSizeForFunction
(
functionType
).
Width
;
double
hy
=
cellSizeForFunction
(
functionType
).
Height
;
...
...
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