Skip to content
Snippets Groups Projects
Commit be1acdd0 authored by Debolskiy Andrey's avatar Debolskiy Andrey :bicyclist_tone5:
Browse files

added some value checkers to prmWindstress classes. Check for main algorithm...

added some value checkers to prmWindstress classes. Check for main algorithm to work on all lines (one need to set prognostic wind values over 90m/s)
parent 46441915
No related branches found
No related tags found
No related merge requests found
<ColoringScheme SchemeType="Grid" GridName="u_test" GroupName="Data Layers">
<GridColoringScheme AmbientIntensity="0,7" Key="" LightSourceAzimuth="90" LightSourceElevation="45" LightSourceIntensity="0,7" NoDataColor="-16777216" ImageLayerFillTransparency="1" ImageUpsamplingMethod="None" ImageDownsamplingMethod="None">
<GridColoringScheme AmbientIntensity="0,7" Key="" LightSourceAzimuth="90" LightSourceElevation="45" LightSourceIntensity="0,7" NoDataColor="-16777216" ImageLayerFillTransparency="1" ImageUpsamplingMethod="Bilinear" ImageDownsamplingMethod="None">
<Break Caption="" LowValue="-16,646" HighValue="11,677" LowColor="-16096246" HighColor="-6718183" ColoringType="0" GradientModel="1" />
<Break Caption="" LowValue="11,677" HighValue="40" LowColor="-6718183" HighColor="-1" ColoringType="0" GradientModel="1" />
</GridColoringScheme>
......
<ColoringScheme SchemeType="Grid" GridName="v_test" GroupName="Data Layers">
<GridColoringScheme AmbientIntensity="0,7" Key="" LightSourceAzimuth="90" LightSourceElevation="45" LightSourceIntensity="0,7" NoDataColor="-16777216" ImageLayerFillTransparency="1" ImageUpsamplingMethod="None" ImageDownsamplingMethod="None">
<GridColoringScheme AmbientIntensity="0,7" Key="" LightSourceAzimuth="90" LightSourceElevation="45" LightSourceIntensity="0,7" NoDataColor="-16777216" ImageLayerFillTransparency="1" ImageUpsamplingMethod="Bilinear" ImageDownsamplingMethod="None">
<Break Caption="" LowValue="0" HighValue="9,9995" LowColor="-13399600" HighColor="-1907802" ColoringType="0" GradientModel="1" />
<Break Caption="" LowValue="9,9995" HighValue="19,999" LowColor="-1907802" HighColor="-6843787" ColoringType="0" GradientModel="1" />
</GridColoringScheme>
......
......@@ -142,8 +142,9 @@ namespace MES_Wind
{
Coordinate dummyRCoords = uRasterLayer.Bounds.CellCenter_ToProj(i,j);
WindStressPRM.Coordinate cellCoords =new WindStressPRM.Coordinate(dummyRCoords.X,dummyRCoords.Y);
WindStressPRM.PrognosticCell dummyPrognosticCell = new WindStressPRM.PrognosticCell(cellCoords, uRasterLayer.DataSet.Value[j, i], vRasterLayer.DataSet.Value[j, i]);
progWindRow.Add(dummyPrognosticCell);
WindStressPRM.PrognosticCell dummyPrognosticCell = new WindStressPRM.PrognosticCell(cellCoords, uRasterLayer.DataSet.Value[j, i], vRasterLayer.DataSet.Value[j, i]);
//WindStressPRM.PrognosticCell dummyPrognosticCell = new WindStressPRM.PrognosticCell(cellCoords, 100, 100);
progWindRow.Add(dummyPrognosticCell);
}
prognosticWind.Add(progWindRow);
//prog_wind_row.Clear();
......@@ -162,8 +163,10 @@ namespace MES_Wind
{
Coordinate dummyCellCoords = clim15RasterLayer.Bounds.CellCenter_ToProj(i,j);
WindStressPRM.Coordinate dummyClimCoords = new WindStressPRM.Coordinate(dummyCellCoords.X,dummyCellCoords.Y);
WindStressPRM.ClimateCell dummyClim = new WindStressPRM.ClimateCell(dummyClimCoords, clim5RasterLayer.DataSet.Value[j, i], clim10RasterLayer.DataSet.Value[j, i]-5, clim15RasterLayer.DataSet.Value[j, i]);
climWindRow.Add(dummyClim);
//add or substruct in range 0 - 27 to change what lines will be broken
WindStressPRM.ClimateCell dummyClim = new WindStressPRM.ClimateCell(dummyClimCoords, clim5RasterLayer.DataSet.Value[j, i], clim10RasterLayer.DataSet.Value[j, i] - 10, clim15RasterLayer.DataSet.Value[j, i]);
//WindStressPRM.ClimateCell dummyClim = new WindStressPRM.ClimateCell(dummyClimCoords, 0, 0, 0);
climWindRow.Add(dummyClim);
}
climWind.Add(climWindRow);
//clim_wind_row.Clear();
......@@ -240,12 +243,12 @@ namespace MES_Wind
Coordinate coords = new Coordinate(disabledStation.coords.X, disabledStation.coords.Y);
DotSpatial.Topology.Point disabledPoint = new DotSpatial.Topology.Point(coords);
Feature disabledPointFeature = new Feature(disabledPoint);
disabledPointFeature.DataRow["ID"] = disabledStation.identifier;
//disabledPointFeature.DataRow["ID"] = disabledStation.identifier;
disabledPointSet.AddFeature(disabledPointFeature);
}
//add result layer to the map
IMapPointLayer resultPointLayer = (MapPointLayer)map1.Layers.Add(disabledPointSet);
PointSymbolizer symbol = new PointSymbolizer('a', "serif", Color.Blue, 4);
PointSymbolizer symbol = new PointSymbolizer('a', "serif", Color.Blue, 14);
resultPointLayer.Symbolizer = symbol;
resultPointLayer.LegendText = "Disabled TransStations";
......
......@@ -50,8 +50,24 @@ namespace WindStressPRM
/// <param name="Y"></param>
public Coordinate(double X, double Y)
{
this.X = X;
this.Y = Y;
if (!(this.CheckValue()))
{
throw new System.ArgumentException("Passed coordinates are not valid!");
}
else
{
this.X = X;
this.Y = Y;
}
}
public bool CheckValue()
{
bool checker = true;
if (X != null) { checker = true; }
else { checker = false; }
if (Y != null) { checker = true; }
else { checker = false; }
return checker;
}
}
/// <summary>
......@@ -79,9 +95,25 @@ namespace WindStressPRM
/// <param name="vY"> V component</param>
public PrognosticCell(Coordinate coord, double vX, double vY)
{
this.coords = coord;
this.velocityX = vX;
this.velocityY = vY;
if (!(this.CheckValue()))
{
throw new System.ArgumentException("Prognostic wind velocities are incorrect");
}
else
{
this.coords = coord;
this.velocityX = vX;
this.velocityY = vY;
}
}
public bool CheckValue()
{
bool checker = false;
if (Math.Abs(velocityX) < 70) { checker = true; }
else { checker = false; }
if (Math.Abs(velocityY) < 70) { checker = true; }
else { checker = false; }
return checker;
}
}
/// <summary>
......@@ -114,10 +146,24 @@ namespace WindStressPRM
/// <param name="w15"></param>
public ClimateCell(Coordinate coord, double w5, double w10, double w15)
{
this.coords = coord;
this.wind5 = w5;
this.wind10 = w10;
this.wind15 = w15;
if (!(this.CheckValue()))
{
throw new System.ArgumentException("Climate wind value is not correct");
}
else
{
this.coords = coord;
this.wind5 = w5;
this.wind10 = w10;
this.wind15 = w15;
}
}
public bool CheckValue()
{
bool checker = true;
if (Math.Abs(wind5) < 70 && Math.Abs(wind10) < 70 && Math.Abs(wind15) < 70) { checker = true; }
else { checker = false; }
return checker;
}
}
/// <summary>
......@@ -132,6 +178,17 @@ namespace WindStressPRM
{
this.width = wdh;
this.height = hgh;
if (!(this.CheckValue()))
{
throw new System.ArgumentException("Cell width or height values are incorrect!");
}
}
public bool CheckValue()
{
bool checker = true;
if (width > 0 && height > 0) { checker = true; }
else { checker = false; }
return checker;
}
}
/// <summary>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment