A couple of weeks Tom (
tmabell) issued a challenge of sorts to come up with a script to display the Hourly RWR's. His old script from Curly wasn't working correctly. I innocently wandered in to take a look at it, and next thing I knew I was hooked by the challenge these RWR's present. It turns out 'tain't simple as you will see if you take a look at just the installation instructions in the main script, 'wxroundupsbystate-area.php':
// Enter Default Station
$state = "NE";
/* Setting the $state code:
If you reside in a state that's included in the $stateArray, just use the two letter abbreviation for your $state default.
Say, for example, you live in Ohio. Then you would probably want to use OH as your $state. If you live in Indiana, Kentucky,
Oregon, or Washington you may select either the state abbreviation or the 5 letter $oddWFOs designation as your $state.
Say you live in Oregon. You can use OR, or an oddWFOs code such as 'KFDT' (Pendleton) as your $state.
However, if you reside in a state that's included in the $stateAreas array, you will NEED to select as your default $state
one of the 5, 6, or 7 letter codes listed under your state in the $stateAreas array. For example, say you
live in Texas near Dallas. You would then probably want to use RWRTX as your $state. This is the Fort Worth code.
When residing in a state that appears in the $stateAreas array selecting the two letter state abbreviation as your $state
WILL PRODUCE AN ERROR and no RWR will display on initial script load.
The $stateArray contains states without multiple areas or with only one added $oddWFOs entry.
$stateArray = array(
'AK'=>'Alaska',
'AZ'=>'Arizona',
'AR'=>'Arkansas',
'CO'=>'Colorado',
'DE'=>'Delaware',
'HI'=>'Hawaii',
'ID'=>'Idaho',
'IL'=>'Illinois',
'IN'=>'Indiana',
'KY'=>'Kentucky',
'MI'=>'Michigan',
'MS'=>'Mississippi',
'NE'=>'Nebraska',
'NV'=>'Nevada',
'OH'=>'Ohio',
'OK'=>'Oklahoma',
'OR'=>'Oregon',
'PR'=>'Peurto Rico',
'VA'=>'Virginia',
'WA'=>'Washington',
'WV'=>'West Virginia',
'WY'=>'Wyoming'
);
The $stateAreas array contains states that have multiple areas which need to be displayed
$stateAreas = array(
'AL'=>array('RWRAL'=>'Birmingham','RWRHUN'=>'Huntsville','RWRMOB'=>'Mobile'),
'CA'=>array('RWRCA'=>'Sacramento','RWRSGX'=>'San Diego','RWRNV1'=>'Reno, NV'),
'CT'=>array('RWRBOX1'=>'Boston','RWROKX1'=>'New York, NY'),
'DC'=>array('RWRLWX1'=>'Baltimore, MD','RWRAKQ1'=>'Wakefield, VA'),
'FL'=>array('RWRMLB'=>'Melbourne','RWRKEY'=>'Key West','RWRFL'=>'Tampa Bay'),
'GA'=>array('RWRGA'=>'Atlanta','RWRCHS1'=>'Charleston, SC'),
'GM'=>array('RWRGUM'=>'Guam','RWRPQ'=>'Marianas/Micronesia'),
'IA'=>array('RWRIA'=>'Des Moines','RWREAX1'=>'Kansas City, MO'),
'KS'=>array('RWRKS'=>'Goodland','RWREAX'=>'Kansas City','RWRGLD'=>'Goodland Area'),
'LA'=>array('RWRSHV'=>'Shreveport','RWRLCH'=>'Lake Charles','RWRLA'=>'New Orleans'),
'MA'=>array('RWRBOX'=>'Boston','RWROKX2'=>'New York, NY','RWRGYX1'=>'Gray, ME'),
'MD'=>array('RWRLWX'=>'Baltimore','RWRPHI1'=>'Mount Holly, NJ','RWRAKQ2'=>'Wakefield, VA'),
'ME'=>array('RWRBOX2'=>'Boston, MA','RWRGYX'=>'Gray'),
'MN'=>array('RWRFSD1'=>'Sioux Falls, SD','RWRMN'=>'Twin Cities'),
'MO'=>array('RWRMO'=>'Springfield','RWREAX2'=>'Kansas City'),
'MT'=>array('RWRGGW'=>'Glasgow','RWRMT'=>'Great Falls'),
'NV'=>array('RWRNV'=>'Reno','RWRAZ1'=>'Phoenix, AZ'),
'NH'=>array('RWRBOX3'=>'Boston','RWRGYX2'=>'Gray, ME'),
'NJ'=>array('RWROKX3'=>'New York, NY','RWRPHI2'=>'Mount Holly, NJ'),
'NM'=>array('RWRNM'=>'Albuquerque','RWRAZ2'=>'Phoenix, AZ'),
'NC'=>array('RWRRAH'=>'Raleigh','RWRAKQ3'=>'Wakefield, VA'),
'ND'=>array('RWRBIS'=>'Bismarck','RWRND'=>'Grand Forks','RWRFGF'=>'Grand Forks Area'),
'NY'=>array('RWROKX'=>'New York','RWRALY'=>'Albany','RWRBGM'=>'Binghamton','RWRBOX4'=>'Boston, MA','RWRPHI3'=>'Philadelphia/Mount Holly','RWRGYX3'=>'Gray, ME'),
'PA'=>array('RWRPHI'=>'Philadelphia','RWRCTP'=>'State College','RWROKX4'=>'New York, NY'),
'RI'=>array('RWRBOX5'=>'Boston, MA','RWROKX5'=>'New York, NY'),
'SC'=>array('RWRCAE'=>'Columbia','RWRCHS'=>'Charleston, SC'),
'SD'=>array('RWRFSD'=>'Sioux Falls Area','RWRSD'=>'Sioux Falls'),
'TN'=>array('RWRTN'=>'Memphis','RWRMEG'=>'Memphis CWA'),
'TX'=>array('RWRMAF'=>'Midland','RWRSJT'=>'San Angelo','RWRTX'=>'Fort Worth'),
'UT'=>array('RWRUT'=>'Salt Lake City','RWRAZ3'=>'Phoenix Area'),
'VT'=>array('RWRBTV'=>'Burlington','RWRBOX6'=>'Boston, MA','RWRGYX4'=>'Gray, ME'),
'WI'=>array('RWRGRB'=>'Green Bay','RWRWI'=>'Milwaukee')
);
The $oddWFOs array contains WFO's that have RWR's that aren't accessed by just the $stateArray or the $stateAreas array
$oddWFOs = array(
'KIWX'=>'Northern Indiana',
'KLUB'=>'Lubbock',
'KLOX'=>'Los Angeles',
'KEKA'=>'Eureka',
'KJKL'=>'Jackson', // KY
'KOHX'=>'Nashville',
'KMHX'=>'Eastern North Carolina',
'KILM'=>'Wilmington',
'KPDT'=>'Pendleton',
'KOTX'=>'Spokane'
);
*/
Tom thinks he wants a list of all of the recent RWR's displayed at the bottom of the page, but until I can catch my breath this isn't happening. Instead there's current a link at the bottom of the page to the appropriate NWS page where these may be ferreted out.
The down side to this is that the current NWS RWR's may go the way of the dodo at some point in the future. Until then I learned a lot about array manipulation and had fun while I was doing it.
You can pick up the script from
my scripts page, and view it from there as well.