Author Topic: Support of "Leuven" WeatherUnderground scripts  (Read 8973 times)

0 Members and 1 Guest are viewing this topic.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #50 on: March 07, 2021, 06:29:40 AM »
I would like to raise a new issue and that is combining historic data from 2 wunderground stations. I moved last summer about 1.5 km and, maybe naively, created a new station under wunderground. My old station IVOSSEM2 and my new station ITERVU1. This results of course in a break in my WU history and therefore in the coloured table in the Leuven template (https://weer.heerschap.net/). The quick fix I try is renaming all my old files in the cache from IVOSSEM2-year-2020.txt to ITERVU1-year-2020.txt etc and changing the my_settings.php file to ITERVU1 but having an earlier starting date to ensure earlier years are selectable. The latter does not seem to work but the data for 2020 does come up (not in the 2nd half of the year but that is as  I had not changed the station name in my_settings.php after moving the station).  Renaming caches files seems too simple to be true or isn't it?

kind regards Jean-Paul

It is not trivial, and it was not designed this way.
All data of the stations is in ./wudata/  in the arrays.
https://weer.heerschap.net/weather28/wudata/
Backup that folder and save on your PC.

You could rename and combine those arrays => used for period data.
Rename all IVOSSEMmetric arrays to the new name.
The problem with 2020 first half year IVOSSEM and second half ITERVU1 is far more difficult. I will think how to do that.

But the detailed data / day in history can not be solved that way.
That data is dynamically loaded.

Maybe the best solution is to have one extra set of scripts for the "old" WU-ID using an override of the settings.
And the normal set of scripts for the new WU-ID

Wim

Offline heersje

  • Member
  • *
  • Posts: 7
    • Tervuren Duisburg
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #51 on: March 07, 2021, 07:01:14 AM »
Dear Wim,

many thanks for that super rapid response. It is not a problem for me not to have the dynamic day details but would like to have the colourful annual overviews as they provide great insight in how the weather developed in the year.
So I downloaded the folder to my computer and renamed the arr files from IVOSSEM to ITERV except for 2020 in the wudata folder on the server. It does not have an immediate effect but I suppose the cache needs to be updated at one point. (or do I need to run a script?)

I do have all that missing 2020 data in MySQL and in fact I also imported it now in my new Meteobridge NanoSD. I know nothing about json but it may be possible to do an extraction of data in the right format. After all it is a text file the array so cut and past the new data in the existing IVOSSEM2-2020.arr may work?     

keeping fingers crossed!

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #52 on: March 07, 2021, 07:16:36 AM »
Dear Wim,

many thanks for that super rapid response. It is not a problem for me not to have the dynamic day details but would like to have the colourful annual overviews as they provide great insight in how the weather developed in the year.
So I downloaded the folder to my computer and renamed the arr files from IVOSSEM to ITERV except for 2020 in the wudata folder on the server. It does not have an immediate effect but I suppose the cache needs to be updated at one point. (or do I need to run a script?)

I do have all that missing 2020 data in MySQL and in fact I also imported it now in my new Meteobridge NanoSD. I know nothing about json but it may be possible to do an extraction of data in the right format. After all it is a text file the array so cut and past the new data in the existing IVOSSEM2-2020.arr may work?     

keeping fingers crossed!

You have to delete all previous years cached .txt files also. From the wudata/ folder and from the cache/ folder.
It is a big task.

Wim

Offline heersje

  • Member
  • *
  • Posts: 7
    • Tervuren Duisburg
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #53 on: March 07, 2021, 09:44:33 AM »
Thanks Wim,

so I saved the text files in cache and wudata folder on my computer and subsequently deleted all of them on the server. Now I get all the days for ITERVU1 for the 2nd half of 2020 which was not visible before, However no previous years are loaded and also the first half collected as IVOSSEM2 is missing. Copying pasting that part in the cache/ITERVU1-2020.txt file shows the full year  in the color overview(minus my removal and some date no WU data may have been stored), I am not sure if that cache file once created will remain untouched. (otherwise I could try to merge the data in the 2 arr files I now have for 2020)

However, I cannot select 2019 and before from the dropdown selecter on the colour page. I left the *.arr files for those years in the wudata folder (renamed to ITERVU1xxxx) and I set my_settings.php to start from Dec 2016 but they are not taken into account.

Am I overlooking something or do I need to go to plan B?
Quote
Maybe the best solution is to have one extra set of scripts for the "old" WU-ID using an override of the settings.
I would probably address that by studying how the weather in color page extracts data from the cache and then hard code it for 2019 and before in another page using the save text files I have with the data.
I hope there is a more simple solution

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #54 on: January 15, 2022, 08:57:45 PM »
Thanks Wim,


Sorry for posting on a wrong thread yesterday.

anyways Its working now, I forgot to change:

for ($i = $firstYear; $i <= $lastYear; $i++) {
   $fileNames[]   = $wuData.$SITE['wuID'].'-year-'.$i.'.txt';   // IVLAAMSG47-year-2014.txt
   $wuURLs[]   = 'http://your_site_name_here/WXDailyHistory.php?ID='.$SITE['wuID'].'&month=01&day=01&year='.$i.'&format=1&graphspan=year';
}

to

$wuURLs[]   = 'http://www.pimohweather.com/WXDailyHistory.php?ID='.$SITE['wuID'].'&month=01&day=01&year='.$i.'&format=1&graphspan=year';


that is why it keeps showing errors, after changing it, it refreshes all arrays and normally shown now to my page

Regards


-Mike-