Archives for posts with tag: WeatherSOS

Today I gave my presentation at useR! 2011. I am not satisfied with how it went – I ran over the time by 2 minutes (which is a lot considering it was supposed to be 17 minutes) and forgot to make a main point, which is showing the XML that goes in and out of the packages! So if you’re interested, be sure to run lines 72 to 75 of the code below.

Nevertheless, Read the rest of this entry »

It will be a bit quiet around sos4R for the rest of the year, so I’d like to share some older work today, one of the first plots I made based on ifgi’s WeatherSOS.  It is now part of a demo of the package, so it’s very easy for you to produce it yourself, and the demo even contains another plot.

# load sos4R package
library("sos4R")

# start the demo
demo("weathersos")

# press 'Enter' to go through the available plots

The first plot contains two lines showing the temperature in Münster and Kärnten for a week in August 2009:

WeatherSOS Temperatur in Münster and Kärnten

The second plot shows the station just in Münster for the month of September in 2010 together with a (polynomial) fitted line:

WeatherSOS Demo Plot 2, Temperatur in Münster with regression lineThere are more demos, which are currently the best way to get to know the package. Check them out!

Yesterday I successfully requested a time series from the WeatherSOS service! The code below shows how that works: First requesting the data (including using some help-functions to create time interval and access the features of the SOS), second plotting it using R’s plot function.

weathersos = SOS("http://v-swe.uni-muenster.de:8080/WeatherSOS/sos")
go.offering = sosOfferings(weathersos)[[4]] # ATHMOSPHERIC_TEMPERATURE
go.observedProperty = sosObservedProperties(weathersos)[[4]] # temperature urn
go.eventTime3 = sosCreateEventTime(sosCreateTimePeriod(sos = weathersos, begin = as.POSIXct("2010-09-16 18:00"), end = as.POSIXct("2010-09-20 18:00")))

obs3 <- getObservation(sos = weathersos,observedProperty = list(go.observedProperty),
procedure = list(sosProcedures(weathersos)[[1]]), eventTime = go.eventTime3, offering = go.offering@id)

obs3@result
# heureka!

summary(obs3@result) # finally!
plot(x = obs3@result[["Time"]], y = obs3@result[["urn:ogc:def:property:OGC::Temperature"]],
type = "l", main = "Temperature in Münster", xlab = "Time", ylab = "Temperature (°C)")

This is quite a milestone for the project, and a good start in this week. For today, spatial queries and testing (also other SOS instances) are on the agenda.

I write a work-logbook. It often helps me to resolve issues I know I had before, and allows me to look back and see what I did when, and how. It also helps me a lot to try to write down every day what I actually accomplished, and if not, why.

Why do I write about that now? Because when I opened it today, the last entry was for the 15th of  July. That’s A LONG TIME AGO. I was actually busy, partly working (OGC discussion papers for SOR and SIR – contact me if you want to know more!) and partly travelling (a little bit, but not too much…), so it’s not that bad, but still. Anyway: I want to get the project finished in September and will be working almost full time for sos4R in the next weeks.

Here are some milestones (just from the top of my head, so subject to change) I’d like to take: Read the rest of this entry »