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
ba0d62ae
Commit
ba0d62ae
authored
8 years ago
by
Антон Кудряшов
Browse files
Options
Downloads
Patches
Plain Diff
fixed interpol with null index value
parent
f442cb8c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
WindStressPRM/Utils/Matrix.cs
+2
-2
2 additions, 2 deletions
WindStressPRM/Utils/Matrix.cs
WindStressPRM/WindStressPRM.cs
+4
-0
4 additions, 0 deletions
WindStressPRM/WindStressPRM.cs
with
6 additions
and
2 deletions
WindStressPRM/Utils/Matrix.cs
+
2
−
2
View file @
ba0d62ae
...
@@ -25,7 +25,7 @@ namespace WindStressPRM
...
@@ -25,7 +25,7 @@ namespace WindStressPRM
/// get index of cell for coordinate
/// get index of cell for coordinate
/// </summary>
/// </summary>
/// <param name="coordinate"></param>
/// <param name="coordinate"></param>
/// <returns></returns>
/// <returns>
null if it doesn't exist
</returns>
public
Index
ProjectionToCell
(
Coordinate
coordinate
)
public
Index
ProjectionToCell
(
Coordinate
coordinate
)
{
{
double
rwDiff
=
(
coordinate
.
X
-
Origin
.
X
)
/
Size
.
Width
;
double
rwDiff
=
(
coordinate
.
X
-
Origin
.
X
)
/
Size
.
Width
;
...
@@ -35,7 +35,7 @@ namespace WindStressPRM
...
@@ -35,7 +35,7 @@ namespace WindStressPRM
if
(
iRow
<
0
||
iCol
<
0
||
iRow
>=
RowsCount
()
||
iCol
>=
ColumnCount
())
if
(
iRow
<
0
||
iCol
<
0
||
iRow
>=
RowsCount
()
||
iCol
>=
ColumnCount
())
{
{
throw
new
Exception
(
"projectionToCell method trying to find uncorrect index"
)
;
return
null
;
}
}
return
new
Index
(
iRow
,
iCol
);
return
new
Index
(
iRow
,
iCol
);
}
}
...
...
This diff is collapsed.
Click to expand it.
WindStressPRM/WindStressPRM.cs
+
4
−
0
View file @
ba0d62ae
...
@@ -319,6 +319,10 @@ namespace WindStressPRM
...
@@ -319,6 +319,10 @@ namespace WindStressPRM
const
bool
normalX
=
true
;
// true - East, false West
const
bool
normalX
=
true
;
// true - East, false West
const
bool
normalY
=
false
;
// true - North, false South
const
bool
normalY
=
false
;
// true - North, false South
Index
rc
=
matrix
.
ProjectionToCell
(
coords
);
Index
rc
=
matrix
.
ProjectionToCell
(
coords
);
if
(
rc
==
null
)
{
// return NaN, because there is no correct index
return
Double
.
NaN
;
}
Coordinate
center
=
matrix
.
CellToProjection
(
rc
);
Coordinate
center
=
matrix
.
CellToProjection
(
rc
);
double
xDiff
=
coords
.
X
-
center
.
X
;
double
xDiff
=
coords
.
X
-
center
.
X
;
double
yDiff
=
coords
.
Y
-
center
.
Y
;
double
yDiff
=
coords
.
Y
-
center
.
Y
;
...
...
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