Author Topic: OBSOLETE! Scripts to Display CDC Influenza Maps  (Read 12702 times)

0 Members and 1 Guest are viewing this topic.

Offline Silversword

  • --Stan Y.
  • Forecaster
  • *****
  • Posts: 560
    • Up Country Maui Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #25 on: January 24, 2015, 06:56:25 PM »
Hi Jerry,

Thanks for the updates.  I still have not have a chance to install this on my site.  Hope to work on it after I get some other things out of the way.

Noticed that your latest version is looking good but there seems to be one error for being compliant with W3C that shows:

 Line 1093, Column 376: there is no attribute "onerror"

…2007-2008/images/usmap02.jpg" onerror="replaceImage(this, 'ajax-images/missing…

Otherwise, can't see a difference on viewing this page.

Just an observation.

Thanks for all for this project.

--Stan Y.
   Maui, Hawaii
Stan Y. - KH6HHG - Maui, Hawaii
 --- Blitzortung ID: 993
 --- FlightRadar24 ID: F-PHOG1

WDL 6.05
MS Windows 7 Pro
Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Davis Vantage Pro 2+ Wireless
Webcam: Axis 211

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #26 on: January 24, 2015, 10:31:12 PM »
There's a switch in 'wxflumap. php'  to turn off validation,  but I have left it set to 'invalid-ok'.  This renders the script invalid when checked as you know. ☺
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline CamarilloWX

  • CamarilloWX
  • Senior Contributor
  • ****
  • Posts: 184
    • Camarillo Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #27 on: January 30, 2015, 05:10:46 PM »
Very cool script, thanks for sharing.  It appears to be having issues with the new map.  The image source is:

Code: [Select]
http://www.cdc.gov/flu/weekly/weeklyarchives2014-2015/images/usmap3.jpg
It should be:

Code: [Select]
http://www.cdc.gov/flu/weekly/weeklyarchives2014-2015/images/usmap03.jpg
I took a look at the script to see if I could find a fix but it is beyond my skill level.  :-)
Eric

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #28 on: January 30, 2015, 05:25:14 PM »
Very cool script, thanks for sharing.  It appears to be having issues with the new map.  The image source is:

Code: [Select]
http://www.cdc.gov/flu/weekly/weeklyarchives2014-2015/images/usmap3.jpg
It should be:

Code: [Select]
http://www.cdc.gov/flu/weekly/weeklyarchives2014-2015/images/usmap03.jpg
I took a look at the script to see if I could find a fix but it is beyond my skill level.  :-)
I've been working on a fix for the past hour or so, and I think I've finally got it in V5c, in the top post above and here.

Edit 2015 Feb 11:  No biggie right now, but the Past Flumaps display for the 2014-2015 season would have failed next year without modification.  This version, 5D, is supposed to avoid that eventuality.  Time will tell.
« Last Edit: February 11, 2015, 12:17:24 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Breezy

  • Indian Trail Weather
  • Forecaster
  • *****
  • Posts: 325
    • Indian Trail Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #29 on: January 31, 2015, 10:34:58 AM »
Jerry,

Looking good !!!!!!!!!!!    \:D/

Thanks much for your time and effort.

Jeff
Jeff

W7-64, Intel Z170A 16 GB RAM
Davis VP2 Plus, Davis Soil Moisture/Temp Sensors, Laser Snow Depth Sensor LR4/Fluke 414D

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #30 on: January 31, 2015, 12:30:08 PM »
+1

Just installed 5c and it looks great to me. No issues detected, so far.

GREAT JOB  =D> =D> =D>
Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline CamarilloWX

  • CamarilloWX
  • Senior Contributor
  • ****
  • Posts: 184
    • Camarillo Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #31 on: January 31, 2015, 10:12:52 PM »
Works great!  Thanks again for sharing.
Eric

Offline SteveJ

  • Senior Member
  • **
  • Posts: 95
    • My Blog
Re: Scripts to Display CDC Influenza Maps
« Reply #32 on: February 02, 2015, 12:42:34 AM »
Downloaded, unzipped, uploaded...

and it JUST WORKS!

http://weather.lakewebster.com/wxflumap.php

Nicely done and thank you!
My LinkedIn

Weather.LakeWebster.com

WU: KMAPLE47 | PWS: JNKNS | CWOP: EW6690 | WXBug: p22113


Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #33 on: February 11, 2015, 12:14:57 PM »
Trying to get ahead of the game here...

The Past Flumaps display for the 2014-2015 season would have failed next year without modification.  The version 5D, in the first post of this thread, is supposed to avoid that eventuality.  Time will tell.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #34 on: May 22, 2015, 08:03:40 AM »
As anticipated, there are 'end-of-season' problems with this script.  The first problem so far is that the logic that indicated the end of the current flu season has proven to be flawed.  Version 5E in the first post corrects this problem, for now at least.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Breezy

  • Indian Trail Weather
  • Forecaster
  • *****
  • Posts: 325
    • Indian Trail Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #35 on: May 23, 2015, 08:12:21 AM »
Thanks for the update, Jerry.   :grin:  Much appreciated !!!

Jeff
Jeff

W7-64, Intel Z170A 16 GB RAM
Davis VP2 Plus, Davis Soil Moisture/Temp Sensors, Laser Snow Depth Sensor LR4/Fluke 414D

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #36 on: May 29, 2015, 12:29:59 PM »
The final version of the 'Flumaps' for this season, 5F, is now attached to the first post of this thread.  It was no surprise when the end-of-season logic fell over again today.  Version 5F should display the current week 20 correctly.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Breezy

  • Indian Trail Weather
  • Forecaster
  • *****
  • Posts: 325
    • Indian Trail Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #37 on: May 30, 2015, 08:44:07 AM »
Thanks Jerry ...  :-)  Will next year's flu maps require as many updates  :?: This is a lot of work on your part .

Your efforts are much appreciated  =D>

Jeff
Jeff

W7-64, Intel Z170A 16 GB RAM
Davis VP2 Plus, Davis Soil Moisture/Temp Sensors, Laser Snow Depth Sensor LR4/Fluke 414D

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #38 on: May 30, 2015, 09:07:40 AM »
My problem has been trying to fathom the CDC's use of weeks and the fact that some seasons, like this one, include a 53rd week.  :-)  In addition there isn't absolute consistency regarding leading zeroes in their filenames.  There can be leading zero differences season by season and the scripts will need to keep up with them.

The next issue will be displaying the 2014-2015 season in 'Past Seasons' when this season is over.  I made a premature stab at it yesterday, but the results weren't pretty!
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Breezy

  • Indian Trail Weather
  • Forecaster
  • *****
  • Posts: 325
    • Indian Trail Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #39 on: May 30, 2015, 09:28:40 AM »
Geeeez Jerry,

With all of the issues not within your control, maybe you should consider putting this project on the shelf.  :-k, but you're the type that thrives on challenges ...
A really nice script  \:D/


Jeff

W7-64, Intel Z170A 16 GB RAM
Davis VP2 Plus, Davis Soil Moisture/Temp Sensors, Laser Snow Depth Sensor LR4/Fluke 414D

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #40 on: May 30, 2015, 09:55:51 AM »
Geeeez Jerry,

With all of the issues not within your control, maybe you should consider putting this project on the shelf.
"Software is never finished, only abandoned", to paraphrase Leonardo da Vinci as many have done.
Quote
:-k, but you're the type that thrives on challenges ...
Yes, I do like puzzles...
Quote
A really nice script  \:D/
:oops:
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #41 on: June 07, 2015, 09:39:38 PM »
With the end of the current flu season now past, I wanted to revise the past flu map script so that it would display the season just ended as well as all other prior seasons.  It turned out to be a messy problem, but Version 6 in the top post contains a past flu map version that does the trick.  I'm leaving Version 5f up as well because its past flu map script will see all prior seasons except the one just ended.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Breezy

  • Indian Trail Weather
  • Forecaster
  • *****
  • Posts: 325
    • Indian Trail Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #42 on: June 08, 2015, 09:47:36 AM »
Thanks Jerry   :!:

Jeff
Jeff

W7-64, Intel Z170A 16 GB RAM
Davis VP2 Plus, Davis Soil Moisture/Temp Sensors, Laser Snow Depth Sensor LR4/Fluke 414D

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #43 on: October 19, 2015, 10:32:19 AM »
With the influenza season upon us it was time to check these scripts again, and to no one's surprise they came up wanting.  The problems had largely to do with the CDC's use of 'week 53' which made their 'week 1' what is 'week 2' by everyone else's reckoning.  The current season that 'wxflumap.php' was trying to display was this week a non-existent 'Week 41'.  This has been fixed in the current version on my site.  Download the main script here by Right clicking on the source, selecting 'Save as...', and saving without the '.txt'.  The selection script and include script can be similarly saved.

The past season flu map scripts were also broken, primarily because the 'week 53' problem.  It too has been fixed.  The primary script can be downloaded here, as can the selection script and the include script.

All these scripts are now versioned with the year with 'a' for Spring and 'b' for Fall followed by a version number for that season.  The scripts are still a bit gnarly-looking, but hopefully over time they can be smoothed out. :-)
« Last Edit: October 19, 2015, 10:34:51 AM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Breezy

  • Indian Trail Weather
  • Forecaster
  • *****
  • Posts: 325
    • Indian Trail Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #44 on: October 19, 2015, 03:27:29 PM »
Jerry,

Thanks for all of the updates. Much appreciated ...  \:D/

Jeff
Jeff

W7-64, Intel Z170A 16 GB RAM
Davis VP2 Plus, Davis Soil Moisture/Temp Sensors, Laser Snow Depth Sensor LR4/Fluke 414D

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #45 on: October 19, 2015, 03:42:39 PM »
Jerry,

Thanks for all of the updates. Much appreciated ...  \:D/

Jeff
You're welcome, Jeff.  Just FYI because it won't matter this year, I just now changed the '$outOfSeason' logic from
Code: [Select]
$outOfSeason = ($currentWeek>(20+$SaturdayJan3[date("Y")]) && $currentWeek<41));
to
Code: [Select]
$outOfSeason = ($currentWeek>(20+$SaturdayJan3[date("Y")]) && $currentWeek<(40+$SaturdayJan3[date("Y")]));
in order to correct this for future years.  It was 'Jerry-rigged' to work, but the why was missing.  You can just redownload the main 'wxflumap.php' script above.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Breezy

  • Indian Trail Weather
  • Forecaster
  • *****
  • Posts: 325
    • Indian Trail Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #46 on: October 19, 2015, 03:50:02 PM »
Done ... All set ...  =D&gt;

Jeff
Jeff

W7-64, Intel Z170A 16 GB RAM
Davis VP2 Plus, Davis Soil Moisture/Temp Sensors, Laser Snow Depth Sensor LR4/Fluke 414D

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #47 on: January 16, 2016, 09:28:25 AM »
There were more bugs in the CDC Flu Map scripts that showed up during the transition from 2015 into 2016.  The modified scripts are available on my web site via the '?sce=view' download technique.  They might get through the rest of this season and beyond, but experience tells me that's probably not going to happen. ](*,) :-)  Here is the current script's output.

Current Flu Season Scripts Version 20160116:
  wxflumap.php
  flumap-select.php
  inc-flumap.php

The Past Flu Season Scripts are unchanged from Oct. 2015
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #48 on: January 23, 2016, 10:17:53 AM »
One more bug not surprisingly emerged yesterday in this script - the current week's map wasn't referenced by the '2015-2016' link although it did display on initial page load.  The only modification was to 'inc-flumaps.php', but I've updated the version on all three scripts to today's date for consistency's sake.  Here is the current script's output.

Current Flu Season Scripts Version 20160123:
  wxflumap.php
  flumap-select.php
  inc-flumap.php

The Past Flu Season Scripts are unchanged from Oct. 2015

New bugs probably won't emerge until the end of the Flu Season, and hopefully not even then. :-|
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Breezy

  • Indian Trail Weather
  • Forecaster
  • *****
  • Posts: 325
    • Indian Trail Weather
Re: Scripts to Display CDC Influenza Maps
« Reply #49 on: January 24, 2016, 09:35:08 AM »
Jerry,

Thanks for keeping your great script updated !!!  \:D/

Jeff
Jeff

W7-64, Intel Z170A 16 GB RAM
Davis VP2 Plus, Davis Soil Moisture/Temp Sensors, Laser Snow Depth Sensor LR4/Fluke 414D

 

anything