Forum > Other

Weather forecasting in Pascal

<< < (2/5) > >>

winni:
Hi!

For the base data:

meteostat  offers the hourly data for 16.000 worldwide station.

Each record consist of

Date
UTC
Air °C
Dewpoint °C
Humidity %
Precipitation mm
Snow mm
Wind degrees
Wind km/h
Wind peak speed km/h
Air pressure
Sunshine minutes/hour
Coco - the describing weather code (1..27)

If you use the data of some surrounding stations then you could make a local map of your position

meteostat has a site for developers:

https://dev.meteostat.net/


Your need the WMO code of the stations (5 digits)

Then you do this sniplet:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---DecodeDate(NowUTC,year,month,day);  //    https://bulk.meteostat.net/v2/hourly/{year}/{station}.csv.gz  URL := 'https://bulk.meteostat.net/v2/hourly/'+IntToStr(year)+'/'+wmo+'.csv.gz';  fname := wmo+'.csv.gz';   try      try       ht := TFPHttpClient.Create(nil);       ht.AllowRedirect := true;       ht.get(URL,fname);     finally       ht.free;     end;   except      on E: Exception do begin                        showMessage ('http error! No Data!');                         Label3.caption := 'No Data';                        exit; end;   end;                                       

Winni

wp:
Great link, winni.

MarkMLl:
Thanks for the link, looks useful.

There's still the troublesome analysis stage: interpolating, locating local pressure minima, orbiting them to find airmass transitions, and then working out an approximate- and I must stress approximate at this stage- presentation of fronts based on Beziers or whatever.

I don't see anybody doing this, except for the national met offices for their own region (which is, after all, what they're being paid for). I have in the past distorted a UK Met Office map from their chosen conformal conic projection to Google Earth's "Web Mercator", but although useful it's hardly pretty and only covers a small fraction of the globe.

MarkMLl

SymbolicFrank:
You can use vectors, starting at the lowest and highest pressure. Divide the difference into an amount of steps and draw your fronts there. At certain intervals along those fronts you draw a new vector and interpolate them for the next "frame". Relatively easy to do (2D), but not very accurate. You need to add radar images and such for the best results.

You can also use finite-element analysis, where you divide the air mass into cubes. This is what they do with clouds, for example, but you need a supercomputer to run a relatively small-scale simulation. Good for understanding the mechanics, but not very practical.

An additional problem is the coverage: weather stations aren't distributed uniformly. So you have to come up with a method to smear that data out in an uniform way.

MarkMLl:
I suspect that in practical terms- and considering that the intended result is a display rather than a derivative dataset- it would be useful to interpolate onto a grid with the final resolution early.

That would undoubtedly lose subtlety. My suspicion is that professionally it's an iterative process: estimate (pressure etc.) gradients from features in the raw information and use that to guide interpolation: that would prevent high-impact features (e.g. a region of high-speed wind on the offshore side of a low pressure area) being smeared out.

MarkMLl

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version