Template talk:Weather box/Archive 1

Unit order

 * metric_first = Yes

This will swap the unit order to metric first then Imperial. See Montreal for an example.

Template:Infobox Weather metric, for the same box but with metric listed first. —The preceding unsigned comment was added by CambridgeBayWeather (talk • contribs) 11:45, 13 December 2006 (UTC).
 * In order to maintain just one standard infobox, I have added the metric first option. By entering Yes this will swap the order of the units to well metric first.  &mdash;MJCdetroit 15:29, 13 December 2006 (UTC)

Comments
It looks good and the weatherbase source looks good as well. It appears that they are using Toronto/Pearson Airport at Environment Canada as the source. I wonder if people would be interested in the maximum/minimums for the town as well? CambridgeBayWeather (Talk) 03:17, 6 November 2006 (UTC)
 * I don't know. They can always be optional for a town.  Where editors may want an expanded version for say an article that was specifically about the climate of a location.  In any case thanks.  &mdash;MJCdetroit 03:46, 6 November 2006 (UTC)

Precipitation unit change
I think the units should change from cm to mm. Total precipitation is always in mm; only snowfall is listed in cm because it takes 10 times as much snow to equal the same amount of rainfall but total precipitation is always in mm. Making this change will make the infobox more consistent within the articles they are placed within. With millimetres you also avoid the decimal point- so no fractions making it easier to read and it is preferred to have units in multiples of 1000 (ie mm, m, km etc.). Samy23 03:02, 16 December 2006 (UTC)
 * I debated this when I developed this template. I even mentationed it to User:CambridgeBayWeather a few days ago . I settled with centimetres because the main website that I kept seeing used with this type of table was www.weatherbase.com and they used cm.  However, I think that I am going to expand this template in the future to include an option for having millimetres displayed if the that's what the source unit is.  It will take some time to put together because it would have to be able to display mm or cm but not both.  &mdash;MJCdetroit 04:53, 16 December 2006 (UTC)

Yes having both cm and mm would indeed be a bad idea but as you can see most articles have -total- precipitation listed as mm. Samy23 00:52, 17 December 2006 (UTC)


 * I'll see what I can do. It will probably be at least a week or two if not more.  &mdash;MJCdetroit 04:46, 17 December 2006 (UTC)


 * Done. It was easier than I thought. Now there is the option to report in whatever metric unit (cm or mm) the source reports without converting. If you enter a value for Jan_Precip_mm, then all precipitation values must be in millimeters.  The reverse in regards to centimeters is also true.  That way it is either millimeters (mm) or centimeters (cm), but not both.  Just as the manual of style states please use the source's reported unit.  If the source reports in centimeters please report centimeters in the infobox and don't convert to millimeters. &mdash;MJCdetroit 02:09, 18 December 2006 (UTC)
 * Because Toronto's source was in millimeters I changed that weatherbox. Please see that acticle for an example. &mdash;MJCdetroit 02:37, 18 December 2006 (UTC)


 * It looks good. Should have thought about that myself. Slight correction though Samy23, there will still be the decimal point with mm. Quoting from MANOBS "3.7.2 Unit of Measurement. The millimetre is the unit of measurement of liquid precipitation. The vertical depth of water or water equivalent is normally expressed to the nearest 0.2mm." I think that most countries report/record in mm. If you go to the US Govt. weather site, precpitation shows up in inches but if you click on metric you get mm. CambridgeBayWeather (Talk) 04:11, 18 December 2006 (UTC)
 * What is the US government's weather website? The one that I found I wasn't very impressed with it.  Just wondering.  &mdash;MJCdetroit 16:32, 18 December 2006 (UTC)


 * The National Oceanic and Atmospheric Administration has several free products. This is a list of their most popular. For use in cities, etc, you would want Climate normals. After that you want Monthly Station Normals - CLIM81 and pick the state. It will give you all (a lot) the stations for that state in Imperial meaure only but a choice of PDF or ASCII. If you look at the small print it says that 1 year "unlimited access" can be purchased. Ignore it, when clickd on it tells you subscription already purchased. It says that a CD can be purchased, the Environment Canada site also has that and it has downloadable CD image files which have more information than the web site. CambridgeBayWeather (Talk) 18:38, 18 December 2006 (UTC)


 * I just looked at the PDF and ASCII for Alaska, the normals (PDF) has the headers that explain what the abbreviations mean while the ASCII one is missing them. CambridgeBayWeather (Talk) 18:46, 18 December 2006 (UTC)

Added an option to compact the infobox vertically
I added an option to compact the infobox if desired. Just add the line |single_line= Yes and this will compact the infobox. See Chicago for an example. &mdash;MJCdetroit 16:37, 6 January 2007 (UTC)
 * It may make the infobox longer in the horizontal direction. &mdash;MJCdetroit 20:29, 6 January 2007 (UTC)
 * And less tall. --Paul 17:50, 7 January 2007 (UTC)
 * I made the font size to equal 83%. This will help with the elongation. If single_line does not equal yes then it will default to 90%. &mdash;MJCdetroit 02:41, 22 January 2007 (UTC)

Added option of displaying record tempertures and a second source.
I added the option of showing record temperatures for the various months. I would careful about adding this data to general articles. It would probably look best in an article about the climate of a certain place, but then again, it is optional so we'll let the editors of individual articles decide. I also added an optional second source line. &mdash;MJCdetroit 21:25, 12 January 2007 (UTC)

An example can be seen at Kuala Lumpur. &mdash;MJCdetroit 01:58, 13 January 2007 (UTC)

Add colors?
Recently, I noticed other weather infoboxes for other cities have a gradient of colors, depending upon the temperature. For instance, London's climate section includes this. I think this adds a nice visual touch to correspond with the varying temperatures. What does anyone think? &mdash;Un sogno modesto 01:28, 20 February 2007 (UTC)

RE: Add colours
We totally agree with Un sogno modesto.

Me and another user have put colours on many weatherboxes in the UK and South Africa, such as Template:Weymouth weatherbox, Template:Cape Town weatherbox, Template:Port Elizabeth weatherbox, Template:Durban weatherbox, Template:Johannesburg weatherbox, Template:Wye weatherbox. We have made a reference table for the colours for variables such as Temperature, Rainfall, Sunshine hours and Rainy days to refer to for consistency between weatherboxes so climate comparisons are easy. We think that this table with these (or very similar) colours should be used in weatherboxes, because there's no point in having a coloured table if the colours don't mean anything!  Bennelliott •  Talk  •  Contribs  and Rossenglish 15:54, 17 June 2007 (UTC)


 * Here's the reference table with the colours shown.  Bennelliott •  Talk  •  Contribs 


 * Could the color be automatically chosen by the template depending on what temperature or amount of precip in entered? &mdash;MJCdetroit 17:58, 17 June 2007 (UTC)


 * We were thinking about that, it is possible. There are so many variables, it would be very time consuming. I'll have a think about how it could be done, and get back to you.  Bennelliott •  Talk  •  Contribs  18:59, 17 June 2007 (UTC)


 * I would if I knew how, but I don't know about the s and s of the syntax.  Bennelliott •  Talk  •  Contribs  20:54, 17 June 2007 (UTC)


 * My concern would be that the way you have the test templates set up makes it very difficult and tedious to edit the information in the future. For instance, with Cape Town, if one of you installed the box perfectly, what's to say a year from now someone updates the box with new information but doesn't change the colors.  The colors then are pointless. The point of a template should be to make it easier for the average Joe editor to edit to and to provide a consistent look from page to page. If the color could somehow be automatic, I'd be ok with such a change.


 * I came across Toronto's weather box and I thought that looked sharp. I like the collapsibility of it.  &mdash;MJCdetroit 04:25, 18 June 2007 (UTC)


 * Yeah, it does look good. There's the same problem with the Toronto weatherbox though; the syntax is almost identical - just different colours - and more rows for info. It would be good if we create "Template:Weatherbox" with the table format and all the s etc. Problem is, each box with a value in it would have to have all the representative colour parameters for every single temperature / rainfall/ etc., unless theres a way of only having to define all the variables once and have each cell refer back to that. I don't know about the wiki formulae all that much.  Bennelliott •  Talk  •  Contribs 
 * It's easy enough in Microsoft Excel rofl! Maybe we should consult a wiki formula expert to see someone would give it a go? Unless of course you are MJCdetroit?  Bennelliott •  Talk  •  Contribs 
 * I'm a chemist, not a computer programmer. It would take a lot of trial and error for me. My thinking would be that using #switch might work.  It's just piecing it all together.  I'll ask over at the infobox project. &mdash;MJCdetroit 17:50, 18 June 2007 (UTC)
 * How about this: User:Doron/test5? It's not ready yet, though.--Doron 19:35, 18 June 2007 (UTC)


 * That's exactly what we're looking for! You are brilliant! Now, to get it into the mainspace templates... shall we try it out? We could make User:Doron/test5 into the main weatherbox template, and then perhaps User:Doron/test and User:Doron/test3 into subpages of that template?

 Bennelliott •  Talk  •  Contribs  19:51, 18 June 2007 (UTC)
 * Thanks. Well, I'd like to work on it for another day or so to clean up the code and add colors for precipitation, if that's OK. By the way, we only need test (as the weatherbox) and test3 (as a subpage), test5 is just a demonstration.--Doron 20:03, 18 June 2007 (UTC)


 * Gathered that it wasn't finished, just had a quick glance through. Take as long as you want matey, no rush, it's your project :)  Bennelliott •  Talk  •  Contribs  20:06, 18 June 2007 (UTC)
 * Test the code a few different ways for a few day then let's swap the code! I did a few tests and everything looks great.  Again, nice work and fast, Doron.&mdash;MJCdetroit 02:56, 19 June 2007 (UTC)

Hmm.. I was looking at the tests, I'm not sure about the black for uber high rainfall (and for the "year" rainfall). What does everyone else think? This is what I mean  Bennelliott •  Talk  •  Contribs  12:33, 20 June 2007 (UTC)
 * Dark grey would be fine, but I'm a little indifferent. &mdash;MJCdetroit 13:47, 20 June 2007 (UTC)


 * I do not like the black either - it stands out too much - dark navy or grey should be the limit. Rossenglish 14:28, 20 June 2007 (UTC)
 * What I meant by the year bit is that it should just be white bg, because it is always going to be a high number, not relative to each month.  Bennelliott •  Talk  •  Contribs  16:56, 20 June 2007 (UTC)

I have slightly altered the colours to make their hex values more mathematically perfect, which solves the problem above of having black at the high end of the scale. (We did skip #0000DC because it was too similar to #0000FF)  Bennelliott •  Talk  •  Contribs  17:23, 20 June 2007 (UTC)

Just an update: I've run into some minor difficulty which may be related to a bug in the wiki parser. It is very obscure and can be avoided, but I'd still like to do some more testing before releasing the code. I see you're already assessing the new design. I was also concerned about the colors, I agree with both points you brought up above -- I'll update the color scheme for precipitation and remove the color from the year column. An alternative could be to set the yearly precipitation by dividing the value by 12 -- which would produce a meaningful color for this column.--Doron 09:12, 21 June 2007 (UTC)


 * "An alternative could be to set the yearly precipitation by dividing the value by 12" - Another brilliant idea Doron! It would then mean something, along with the "year" for highest temperature, lowest temperature etc.  Bennelliott •  Talk  •  Contribs  12:23, 21 June 2007 (UTC)


 * With Doron making awesome progress on the color stuff, I thought I would go ahead and install dual Automatic Unit Conversion on his Doran/test code (but in my sandbox). This will make it so that a person can enter only metric values, or only imperial values and the entered values' counterpart will get converted and displayed.  A person can still enter both metric and imperial values which would override the AUC.  So far it works pretty well but I am only about halfway done (my real job keeps getting in the way...lol).  This will make it a much more functional and user friendly template.&mdash;MJCdetroit 17:22, 21 June 2007 (UTC)

I overcame some difficulties with the new colored infobox, and I think it's ready. Before proceeding to replace the existing infobox, I'd still like some comments from you guys. I still haven't incorporated the automatic unit conversion, though, this will come next. Below are a couple more extreme examples taken directly from their respective articles:

Personally, I find these colors a bit strong. Check out the color schemes at Template:Infobox Weather/colp and Template:Infobox Weather/colt.--Doron 14:19, 1 July 2007 (UTC)


 * Perhaps it would look better if the minus temperature range was extended with more blues from the Template:Infobox Weather/colp; at the moment the steps are every three degrees below zero, and skip one or two hex values in order of Template:Infobox Weather/colp. Maybe that'll sort it out for the more extreme examples, but that's the problem, extremes are rare, so the wider the range is stretched, the subtler the colour changes when it only varies by a degree or so.  Bennelliott •  Talk  •  Contribs  16:00, 1 July 2007 (UTC)


 * Looks good but perhaps the precip colors could be a color other than blue, but admittedly I don't have any suggestions. I'll sleep on it (it's almost midnight) and maybe I'll have a suggestion tomorrow. zzzzzz&mdash;MJCdetroit 03:56, 2 July 2007 (UTC)

New weatherbox
Finally got around to finish the new weatherbox, sorry about the long delay. I think I'm done, it is currently invoked by Infobox Weather/new, and eventually would be copied into the main template. The template introduces two new features:
 * background color of table cells according to displayed value
 * automatic unit translation (imperial <=> metric) when data is specified in only one unit

I'd appreciate it if some of you could take the time to test it with various localities. One thing to look out for is that all fields must be given as numbers, no "n/a", no "---" and no numbers with commas, such as "2,257". The latter should be given as "2257", and if it represents annual precipitation, it would be displayed by the template as "2,257" (other fields are not likely to reach the thousands). If there are no objections, I'll copy the code from the temporary location into the main template in a few days.--Doron 07:39, 17 July 2007 (UTC)
 * At first, I was going to say that, I couldn't get the automatic unit translation to work:
 * imperial-->metric (metric not displaying)


 * metric --->imperial (imperial not displaying)


 * However, I found that in order for conversion to work, one can not even have the opposing systems parameters left in the syntax. Here's with the °F parameters completely taken out of the syntax and the conversion works and I left the inch parameters in the syntax to show how that doesn't work.


 * If this is not a bug and it is to stay as such then we'll have to have 3 sets of empty syntaxes.


 * It looks as if in this occurrence that the conversion from imperial to metric has a typo. The table displays cm and the values are actually millimeters

I only experimented with the new infobox for a few minutes. Other than the one quirk (which we can live with) and the one typo, I think we have an excellent infobox. &mdash;MJCdetroit 12:35, 17 July 2007 (UTC)
 * Fixed the typo bug. As for your other concern, it can be solved, but it would make the code even more unreadable than it already is (too many features in this template for such a primitive programming language!). Do you think it's worth the trouble?--Doron 23:15, 21 July 2007 (UTC)
 * Like I said, we can live with it as long as we make an effort to let folks know about it and supply three different empty syntaxes (Imperial, Metric, and both). That should cover all the bases.  I say&mdash;GO LIVE!.  &mdash;MJCdetroit 05:57, 22 July 2007 (UTC)
 * Nice job on the template, wish I'd known about it earlier. Heh. Quick question though, why is it necessary to have fields for Metric and Imperial? Seems to be opening us up to stupid math errors (of which I make many). Why not just eliminate the reference to units in the fields and use the Metric_first field to determine if the values in the fields are metric or imperial, and add a "Metric_in_CM" field to determine which metric unit? --Bobblehead (rants) 22:09, 23 July 2007 (UTC)
 * Two reasons: (a) backward compatibility; (b) sometimes an editor might want to enter both (e.g., because of rounding), while one can always choose to enter just one of them (to avoid errors).--Doron 00:19, 24 July 2007 (UTC)
 * There are less than a hundred articles in which this template is used so it should be rather easy and quick to convert to the new template, so I'm not sure how much of a hurdle backward compatibility is. But good point on the rounding, the auto-convert doesn't seem to maintain rounding. --Bobblehead (rants) 00:46, 24 July 2007 (UTC)

As we started above ages ago in "RE: Add colours" - what a good idea this turned out to be. Well done  Bennelliott •  Talk  •  Contribs  and Rossenglish 15:22, 24 July 2007 (UTC)


 * I added an imperial only and a metric only empty syntaxes to speed up editing. I implemented it on the Johannesburg article. &mdash;MJCdetroit 16:41, 26 July 2007 (UTC)

Well, if there are no objections, I'd like to archive the color discussion above, since it clutters this talk page and makes it slow...--Doron 14:55, 29 July 2007 (UTC)
 * More than agree, sections 7, 9 and 12.  Bennelliott •  Talk  •  Contribs  15:52, 29 July 2007 (UTC)

Sister Template Infobox Weather2
After, trying many different ways to hide the 14th column, "Year", I just created the a sister template: Infobox Weather2. This sister template does not have the year column. Any changes to this template should also be applied to the sister template and vise-versa. &mdash;MJCdetroit 20:15, 22 May 2007 (UTC)
 * With Doron's fix below, this sister template is no longer needed. Therefore...speedy deletion requested. &mdash;MJCdetroit 03:02, 19 June 2007 (UTC)

Year column
I made the year column appear only if it contains data, thus rendering Template:Infobox Weather2 redundant.--Doron 10:56, 18 June 2007 (UTC)
 * Good job! You may have the honor of TfD'ing it! &mdash;MJCdetroit 17:52, 18 June 2007 (UTC)
 * Thanks... It would be easier, though, if you nominated it for speedy deletion, since you created it.--Doron 19:27, 18 June 2007 (UTC)

°F
Is this weathbox intended for use throughout the world? Because if it was, why is °F at the top, if the USA is the only country that primarily uses °F? 87.127.169.155 12:36, 18 June 2007 (UTC)


 * Oh i see lol, never mind me, I skipped that Unit order section above.....