<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.e-ecology.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Willem+bouten</id>
		<title>ecology - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.e-ecology.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Willem+bouten"/>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php/Special:Contributions/Willem_bouten"/>
		<updated>2026-05-06T18:44:40Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.e-ecology.nl/index.php?title=ECMWF&amp;diff=1268</id>
		<title>ECMWF</title>
		<link rel="alternate" type="text/html" href="https://wiki.e-ecology.nl/index.php?title=ECMWF&amp;diff=1268"/>
				<updated>2015-10-06T16:38:23Z</updated>
		
		<summary type="html">&lt;p&gt;Willem bouten: /* FORECAST and UVA_FORECAST */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMWF == &lt;br /&gt;
&lt;br /&gt;
Datamodel for the tables in the ECMWF schema. &lt;br /&gt;
&lt;br /&gt;
Data is created by the ECMWF and retrieved from the KNMI ftp site as GRIB files. The original GRIB files can also be  retrieved from the flysafe server from :&lt;br /&gt;
&lt;br /&gt;
[https://flysafe-pps.grid.sara.nl/archive/knmi/ecmwf/ ECMWF Data Archive]&lt;br /&gt;
&lt;br /&gt;
More information about the parameters in these GRIB files can be retrieved from the [http://www.ecmwf.int/services/dissemination/3.1/Products_in_GRIB_code.html ECMWF website].&lt;br /&gt;
&lt;br /&gt;
== INVARIABLE == &lt;br /&gt;
&lt;br /&gt;
The INVARIABLE table contains data that is invariant over time. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''LATITUDE''' || degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|'''LONGITUDE''' || degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|Z || 129 Z Geopotential surface/model orography 				&lt;br /&gt;
|-&lt;br /&gt;
|LSM || 172 LSM	Land sea mask				&lt;br /&gt;
|-&lt;br /&gt;
|LOCATION || Latitude/longitude as GIS location  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The GIS LOCATION is only added to this table. This is because always the same values for latitude and  longitude are used and then if the GIS location is required for the ANALYSIS or FORECAST tables it can be retrieved by joining to this table on the LATITUDE, LONGUTUDE fields.&lt;br /&gt;
&lt;br /&gt;
== FORECAST and UVA_FORECAST == &lt;br /&gt;
&lt;br /&gt;
The FORECAST table contains predicted values in steps of 3 hours till 72 hours ahead. The MODELTS is the timestamp for which this prediction applies. Two times a day new Forecast GRIB files will arrive. The newer FORECAST data that arrives for the same timestamp will overwrite the older data.&lt;br /&gt;
&lt;br /&gt;
The FORECAST (and UVA_FORECAST) table itself is a master table that does not contain any data. The inherited tables &lt;br /&gt;
FORECAST&amp;lt;YEAR&amp;gt;&amp;lt;MONTH&amp;gt; contain the data, but the master FORECAST or UVA_FORECAST table can be used to SELECT the data. &lt;br /&gt;
&lt;br /&gt;
Data till 2009-09 is owned by the UvA and can be accessed by anybody with ECMWF_READ rights by using the FORECAST_UVA table. The FORECAST table itself also references data after 2009-09 that is owned by RNLAF for which special access rights ECMWF_RNLAF_READ are required. &lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|'''MODELTS'''||Time for which this forecast applies = model run + step hours&lt;br /&gt;
|-&lt;br /&gt;
|'''LATITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|'''LONGITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|STEP||model step (smaller is more recent forecast)&lt;br /&gt;
|-&lt;br /&gt;
|SSRD||169 SSRD	surface solar radiation downwards accumulated			&lt;br /&gt;
|-&lt;br /&gt;
|TP||228 TP	total precipitation accumulated			&lt;br /&gt;
|-&lt;br /&gt;
|SP||134 SP	surface pressure		&lt;br /&gt;
|-&lt;br /&gt;
|BLH||159 BLH	boundary layer height		&lt;br /&gt;
|-&lt;br /&gt;
|TCC||164 TCC	total cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|U10||165 10U	10 meters wind U-component m/s		&lt;br /&gt;
|-&lt;br /&gt;
|V10||166 10V	10 meters wind V-component	 m/s	&lt;br /&gt;
|-&lt;br /&gt;
|T2||167 2T	2 metres air temperature		&lt;br /&gt;
|-&lt;br /&gt;
|D2||168 2D	2 metres dew point temperature		&lt;br /&gt;
|-&lt;br /&gt;
|LCC||186 LCC	low cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 1000''||&lt;br /&gt;
|-&lt;br /&gt;
|T_1000||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_1000||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_1000||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_1000||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_1000||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 925''||&lt;br /&gt;
|-&lt;br /&gt;
|T_925 real||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_925 real||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_925 real||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_925 real||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_925 real||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 850''||&lt;br /&gt;
|-&lt;br /&gt;
|T_850||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_850 real||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_850 real||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_850 real||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_850 real||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 700''||&lt;br /&gt;
|-&lt;br /&gt;
|T_700 real||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_700 real||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_700 real||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_700 real||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_700 real||157 R	relative humidity	&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ANALYSIS and UVA_ANALYSIS ==&lt;br /&gt;
&lt;br /&gt;
The ANALYSIS and UVA_ANALYSIS table contains values from the Analysis GRIB files at 18, 00, 06 and 12 UTC&lt;br /&gt;
&lt;br /&gt;
Data till 2009-09 is owned by the UvA and can be accessed by anybody with ECMWF_READ rights by using the ANALYSIS_UVA table. The ANALYSIS table itself also references data after 2009-09 that is owned by RNLAF for which special access rights ECMWF_RNLAF_READ are required. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{|border=1&lt;br /&gt;
|'''MODELTS'''||Time for which this forecast applies = model run&lt;br /&gt;
|-&lt;br /&gt;
|'''LATITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|'''LONGITUDE'''||degrees * 100 to make this a integer&lt;br /&gt;
|-&lt;br /&gt;
|SP||134 SP	surface pressure		&lt;br /&gt;
|-&lt;br /&gt;
|TCC||164 TCC	total cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|U10||165 10U	10 meters wind U-component		&lt;br /&gt;
|-&lt;br /&gt;
|V10||166 10V	10 meters wind V-component		&lt;br /&gt;
|-&lt;br /&gt;
|T2||167 2T	2 metres air temperature		&lt;br /&gt;
|-&lt;br /&gt;
|D2||168 2D	2 metres dew point temperature		&lt;br /&gt;
|-&lt;br /&gt;
|LCC||186 LCC	low cloud coverage		&lt;br /&gt;
|-&lt;br /&gt;
|''Pressure level 1000''||&lt;br /&gt;
|-&lt;br /&gt;
|T_1000||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_1000||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_1000||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_1000||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_1000||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|Pressure level 925||&lt;br /&gt;
|-&lt;br /&gt;
|T_925||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_925||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_925||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_925||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_925||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|Pressure level 850||&lt;br /&gt;
|-&lt;br /&gt;
|T_850||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_850||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_850||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_850||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_850||157 R	relative humidity	&lt;br /&gt;
|-&lt;br /&gt;
|Pressure level 700||&lt;br /&gt;
|-&lt;br /&gt;
|T_700||130 T	temperature	&lt;br /&gt;
|-&lt;br /&gt;
|U_700||131 U	U-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|V_700||132 V	V-wind component	&lt;br /&gt;
|-&lt;br /&gt;
|GH_700||156 GH	geopotential height	&lt;br /&gt;
|-&lt;br /&gt;
|R_700||157 R	relative humidity&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== COMBINED == &lt;br /&gt;
&lt;br /&gt;
If you want to use Analysis data if available for a timestimp but otherwise Forecast, the COMBINED VIEW can be used. If a ANALYSIS value is available for a timestamp and latitude/longitude the ANALYSIS value will be used, otherwise the FORECAST value is given.&lt;br /&gt;
&lt;br /&gt;
== Historical data == &lt;br /&gt;
&lt;br /&gt;
In addition ongoing process of adding ECMWF data since November 11 2007, a historical data set has been loaded.  That historical dataset is stored in additional inherited tables FORECASTHISTORY and&lt;br /&gt;
ANALYSISHISTORY which inherit from FORECAST and ANALYSIS respectively. &lt;br /&gt;
&lt;br /&gt;
The FORECASTHISTORY does not always contain TP (228 TP total precipitation accumulated).  Instead of this it contains the following values :&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|LSP||142 LSP Large scale precipitation&lt;br /&gt;
|-&lt;br /&gt;
|CP||143 CP Convective precipitation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The historical dat sets span the following periods and locations &lt;br /&gt;
&lt;br /&gt;
{|border=1 &lt;br /&gt;
|'''Start'''||'''End'''||'''Area'''||'''Grid'''&lt;br /&gt;
|-&lt;br /&gt;
|2007-01-01||2007-11-15||62degN 10degW 335degN 20degE||0.25x0.25deg&lt;br /&gt;
|-&lt;br /&gt;
|2003-02-15||2003-06-15||62degN 10degW 335degN 20degE||0.5x0.5deg&lt;br /&gt;
|-&lt;br /&gt;
|2005-01-01||2006-12-31||62degN 10degW 335degN 20degE||0.5x0.5deg&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Helpful Functions &amp;amp; Queries == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following functions have been defined in Postgres to select the nearest gridpoint in spacetime for the ECMWF analysis and forecast tables. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are '''ecmwf.forecast_nearest''' and '''ecmwf.analysis_nearest''' and they take a latitude, longitude and timestamp as parameter. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They can be used in the following way, which will return all the fields in the relevant ECMWF data:&lt;br /&gt;
&lt;br /&gt;
  SELECT * FROM ecmwf.forecast_nearest( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
   &lt;br /&gt;
  SELECT * FROM ecmwf.analysis_nearest( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
&lt;br /&gt;
Note that the model latitude and model longitude are returned as integers and multiples of 100.  To return latititude and longitude as a decimal (for example to compare to the latitude and longitude of your GPS data) you need to first convert these fields to decimals:&lt;br /&gt;
&lt;br /&gt;
  SELECT f.latitude/100::decimal, f.longitude/100::decimal&lt;br /&gt;
  FROM ecmwf.forecast_nearest( 52.35983, 5.615, timestamp '2008-05-19 13:34:00') f;&lt;br /&gt;
&lt;br /&gt;
These function can for example be used in a join as follows :&lt;br /&gt;
&lt;br /&gt;
  SELECT g.ptt_id&lt;br /&gt;
       , g.date_time&lt;br /&gt;
       , g.latitude&lt;br /&gt;
       , g.longitude&lt;br /&gt;
       , g.speed&lt;br /&gt;
       , g.course&lt;br /&gt;
       , g.altitude&lt;br /&gt;
       , (ecmwf.forecast_nearest( g.latitude, g.longitude,g.date_time)).*&lt;br /&gt;
  FROM gps.gps_tracking_data g&lt;br /&gt;
     , gps.individual i&lt;br /&gt;
     , gps.track_session t&lt;br /&gt;
  WHERE g.ptt_id = t.ptt_id &lt;br /&gt;
    AND g.date_time &amp;gt;= t.start_date &lt;br /&gt;
    AND i.ring_number = t.ring_number &lt;br /&gt;
    AND g.parser_qc = 1 &lt;br /&gt;
    AND g.ptt_id = 41745 &lt;br /&gt;
    AND g.latitude &amp;lt;&amp;gt; 0&lt;br /&gt;
  ORDER BY g.date_time;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Although these functions were converted to PLPgSQL to speed them up, a faster ways to retrieve the same data is with (thanks to Floris Sluiters): &lt;br /&gt;
&lt;br /&gt;
  SELECT ptt_id, date_time, latitude, longitude, speed, course, altitude, (x::ecmwf.forecast).*&lt;br /&gt;
  FROM (SELECT &lt;br /&gt;
       g.*&lt;br /&gt;
       ,((SELECT f &lt;br /&gt;
            FROM ecmwf.forecast f&lt;br /&gt;
           WHERE f.latitude = round(g.latitude * 100 / 25)::integer * 25&lt;br /&gt;
             AND f.longitude =  round(g.longitude * 100 / 25)::integer * 25&lt;br /&gt;
             AND f.modelts = TIMESTAMP 'epoch' + round(EXTRACT(EPOCH FROM g.date_time) &lt;br /&gt;
                 / (60*60*3))::integer * INTERVAL '3 hours' limit 1)::ecmwf.forecast) as x &lt;br /&gt;
        FROM   gps.gps_tracking_data g&lt;br /&gt;
             , gps.individual i&lt;br /&gt;
             , gps.track_session t&lt;br /&gt;
        WHERE g.ptt_id = t.ptt_id &lt;br /&gt;
          AND g.date_time &amp;gt;= t.start_date &lt;br /&gt;
          AND i.ring_number = t.ring_number &lt;br /&gt;
          AND g.parser_qc = 1 &lt;br /&gt;
          AND g.ptt_id = 41745&lt;br /&gt;
          AND g.latitude &amp;lt;&amp;gt; 0&lt;br /&gt;
          ORDER BY g.date_time) t&lt;br /&gt;
&lt;br /&gt;
Below is example query that retrieves data for a model grid point closest to user provided coordinates and for one model time stamp (eg. 12:00) for a series of consecutive days&lt;br /&gt;
&lt;br /&gt;
  SELECT f.modelts, f.latitude, f.longitude, f.blh&lt;br /&gt;
  FROM ecmwf.forecast as f&lt;br /&gt;
  WHERE f.latitude = round(42.718104*100/25)::integer*25 AND f.longitude = round(11.517727*100/25)::integer*25 and &lt;br /&gt;
    f.modelts &amp;gt;= '2007-08-01 12:00' and f.modelts &amp;lt;= '2008-08-01 12:00' and date_part('hour', f.modelts) = 12&lt;br /&gt;
  ORDER BY f.modelts   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Interpolation ===&lt;br /&gt;
&lt;br /&gt;
The following functions are added so that simple linear interpolation for a specific point in space and time can be done in Postgres. &lt;br /&gt;
&lt;br /&gt;
These are '''ecmwf.forecast_interpolate''' and '''ecmwf.analysis_interpolate''' and they take a latitude, longitude and timestamp as parameter. &lt;br /&gt;
&lt;br /&gt;
They can be used in the same way:&lt;br /&gt;
&lt;br /&gt;
  select * from ecmwf.forecast_interpolate( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
   &lt;br /&gt;
  select * from ecmwf.analysis_interpolate( 52.35983, 5.615, timestamp '2008-05-19 13:34:00');&lt;br /&gt;
&lt;br /&gt;
And they can also be used in joins as above. These functions select the 8 surrounding points in latitude, longitude and date_time and interpolate linear in latitude, longitude and date_time successively. The '''interpolate''' functions are much slower then the '''nearest''' functions.&lt;/div&gt;</summary>
		<author><name>Willem bouten</name></author>	</entry>

	</feed>