<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" id="owaParaStyle">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Verdana;color: #000000;font-size: 12pt;">
Dear list users,<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<div>
<div style="direction:ltr; font-family:Verdana; color:#000000; font-size:12pt">I implemented a code for creation of snowfall isohyets through the inverse distance method applied to a Digital Elevation Model.
<br>
Within a big area (approximatively 2.000 km2) I use only six stations, I would expect the snowfall esteem getting smaller with higher distances from the stations.<br>
In my case the snowfall values remain constant all over the area.<br>
<br>
This is the relevant part of my code (df_prec is the data frame that contains the coordinates of the stations and the snowfall cumulates).
<br>
Could somebody be so patient to spot where is my (big) mistake? (Here attached - as exception - the file picture1.pdf is an example of the result.)<br>
<br>
Thank you for your attention and your help<br>
Stefano Sofia<br>
<br>
<br>
<br>
## LOADING SHAPEFILE FOR AREA5<br>
Shape_area <- readOGR(dsn="area.shp", layer="area")<br>
Shape_area_projection <- "+init=epsg:32633 +proj=utm +zone=33 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0"<br>
Shape_area <- spTransform(Shape_area, CRS(Shape_area_projection))<br>
<br>
## LOADING DEM<br>
area_DEM raster("dem.tif")<br>
area_DEM <- projectRaster(area_DEM, crs = CRS("+init=epsg:32633"))<br>
<br>
## EXTRACTING THE ELEVATION VALUES TO MY POINTS<br>
df_prec$ExtractedElevationValues <- extract(x=area_DEM, y=df_prec)<br>
<br>
## CREATING A NEW GRID<br>
newgrid <- as(area_DEM, "SpatialGridDataFrame")<br>
newgrid <- raster(newgrid)<br>
names(newgrid) <- "ExtractedElevationValues"<br>
<br>
## Inverse Distance Weighted<br>
if (sum(df_prec$Cumulata) > 0)<br>
{<br>
OK_rain <- gstat(formula=snowfall_cumulate~ExtractedElevationValues, data=df_prec, locations=newgrid)<br>
rain_rast <- interpolate(newgrid, OK_rain, xyOnly=FALSE, na.rm=FALSE)<br>
<br>
} else<br>
{<br>
rain_rast <- raster(df_prec)*0<br>
}<br>
<br>
<br>
<br>
<div><br>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="PlainText"> (oo)<br>
--oOO--( )--OOo----------------<br>
Stefano Sofia PhD<br>
Area Meteorologica e Area nivologica - Centro Funzionale<br>
Servizio Protezione Civile - Regione Marche<br>
Via del Colle Ameno 5<br>
60126 Torrette di Ancona, Ancona<br>
Uff: 071 806 7743<br>
E-mail: stefano.sofia@regione.marche.it<br>
---Oo---------oO----------------</div>
</span></font></div>
</div>
</div>
</div>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
AVVISO IMPORTANTE: Questo messaggio di posta elettronica può contenere informazioni confidenziali, pertanto è destinato solo a persone autorizzate alla ricezione. I messaggi di posta elettronica per i client di Regione Marche possono contenere informazioni
confidenziali e con privilegi legali. Se non si è il destinatario specificato, non leggere, copiare, inoltrare o archiviare questo messaggio. Se si è ricevuto questo messaggio per errore, inoltrarlo al mittente ed eliminarlo completamente dal sistema del proprio
computer. Ai sensi dell’art. 6 della DGR n. 1394/2008 si segnala che, in caso di necessità ed urgenza, la risposta al presente messaggio di posta elettronica può essere visionata da persone estranee al destinatario.<br>
IMPORTANT NOTICE: This e-mail message is intended to be received only by persons entitled to receive the confidential information it may contain. E-mail messages to clients of Regione Marche may contain information that is confidential and legally privileged.
Please do not read, copy, forward, or store this message unless you are an intended recipient of it. If you have received this message in error, please forward it to the sender and delete it completely from your computer system.<br>
</font>
<p>-- <br /><span style="color: #999999; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;"> Questo messaggio è stato analizzato con Libra ESVA ed è risultato non infetto.<br /> This message has been checked by Libra ESVA and is believed to be clean.</span></p>
</body>
</html>