Sunday, February 8, 2009

OpenOffice and Charts

Finally I got the way to save an OpenOffice Calc chart as an image... easy but not quick... Here a short description.

You can export charts using OpenOffice Draw.
  1. select the chart so it has green handles
  2. copy it
  3. paste it into Draw
  4. then while still selected do File -> Export and choose your favorite format
  5. take care of having the chart in the Draw page, all the region outside the Page will not be exported
Have fun with OpenOffice and Charts... :D

If you would like to save all the charts in a spreadsheet... so take a look at this link... here is a macro that does it.

http://www.oooforum.org/forum/viewtopic.phtml?t=60155&start=0&postdays=0&postorder=asc&highlight=&sid=bf3f571e41e622368b27df716d413d07

Geostatistic and JGrass



JGrass implements two basic geostatisics modules:
  • h.variogram
  • h.kriging
The two modules are correlated because the kriging algorithm needs an input variogram and the h.variogram allows the user to calculate the variogram of some measured data.

h.variogram
Output of this module is the experimental semivariogram for the data measured in the monitoring points.
The inputs are:
- feature of monitoring point
- the measured data
- the amplitude of distance classes
The syntax is the following:
jgrass { h.variogram --idfield "NETNUM" --iscalar-inputvalues "/Users/silli/rain_variogram" --iflayer-positions stazioni_rain_all --oscalar-cloud "CONSOLE" --distance 3000 }

and the output is the complete semivariogram for each timestep of rain data in the input values file. I think this is amazing becuase you can just collect some timestep values and with just a command create the semivariograms.
The output is a table with:
- distance
- semivariogram
- Moran index
- Geary index
for each timestep in the input file.

After having the experimental semivariogram it is possible to calculate the fitted one using a spreadsheet. After plotting the semivariogram points the parameters needed for the kriging module are:
  • nugget
  • sill
  • range
  • model type
The model type can be:
  1. spherical
  2. exponential
  3. gaussian
  4. sillian
And the other parameters are desumed from the semivariogram chart as explained in the following picture.

And the variogram's types are in the next picture.


h.kriging
This modules interpolate with the kriging algorithm a quantity in either specific points or over an area. The output of this module can be:
  • a value of the quantity for each input point feature
  • a raster with the quantity over the surface
jgrass {
h.kriging
--idfield "NETNUM"
--maxpoints 4 --minpoints 2 --model 1 --nugget 0
--sill 0.12 --range 25000 --dovariance "true" --searchradius 100000
--itscalar-inputvalues "/Users/silli/rain_2005.csv"
--iflayer-positions "stazioni_rain_all"
--iflayer-interpolatedpositions "bacini_bz_idlikedb0"
--oscalar-outputvalues "CONSOLE"
}

where:
  • idfield is the name of the field in the shapefiles with the idvalue, it has to have the same name for the measured position layer and for the interpolated position layer
  • itscalar-inputvalues: is the input file with the measured data in the monitoring points, this has to be in the form: a line for each timestep and for each line the monitoring point id and the mesured data, all separated by a space
  • iflayer-positions: is the layer with the monitoring points (feature's type: points)
  • iflayer-interpolatedpositions: is the layer with the outupt position (feature: points or polygons)
  • the output can be written in console or in a table or file as usual in JGrass