Page 1 of 1

WXSIM Storm Forecast

Posted: Mon 31 Dec 2018 12:42 am
by Mapantz
Hi Ken

I saw this thread over at WXF: http://www.wxforum.net/index.php?topic=34216.msg347547

I took the opportunity to download it, as Henkka removed the link (I'm a latecomer to WXSIM)

- Love Meteograms!

I've got it running absolutely fine, but i've noticed that the units are not being pulled from the CSV files. I thought it was me, but I see the same on your meteogram as well.

https://warehamwx.co.uk/meteogram/

I think it's down to this:

Code: Select all

$csv = preg_replace("/mi\/hr/", " mph", $csv);
$csv = preg_replace("/km\/hr/", " kph", $csv);
$csv = preg_replace("/pct/", " %", $csv);
$csv = preg_replace( '/\(/', '.', $csv );
$csv = preg_replace( '/\)/', '.', $csv );
$csv = preg_replace("/mb/", "hPa", $csv);
$csv = preg_replace("/deg/", " °", $csv);
$csv = preg_replace("/m\/sec/", "m/s", $csv);
$csv = preg_replace( '/\ ,/', ';', $csv ); // replace space+comma with ;
$csv = preg_replace(  '/\s/', '', $csv ); // remove white space
$csv = preg_replace( '/\,/', '.', $csv ); // replace , with . for decimal spaces
$csv = preg_replace("/RN\/SNW/", "SLEET", $csv);
$csv = preg_replace("/SNW\/RN/", "SLEET", $csv);

$tot = count($csv);

Code: Select all

$uoms = explode(',', $csv[1]);
I just bodged it for the time being :lol:

Code: Select all

$uoms = array('','','','','','°C','','','','','','','mph','hPa','mm');