When do maximum/minimum temperature forecasts cover?

  • 1
  • Question
  • Updated 5 months ago
I am trying to find out "when" the forecasts are for? Is a maximum temperature forecast midnight to midnight, 9 am to 9 am, daylight hours or some other period? Similar for minimum temperature and 24 hour QPF. And are those times defined locally or by UTC? ...

And for hourly forecasts, are the time periods "forwards" or "backwards" - i.e. is "2pm" 2:00-2:59 or 1:01-2:00? 
Photo of Thomas Pagano

Thomas Pagano

  • 17 Posts
  • 7 Reply Likes

Posted 5 months ago

  • 1
Photo of Thomas Pagano

Thomas Pagano

  • 17 Posts
  • 7 Reply Likes
After looking into it some more, my latest understanding is that maximum and minimum temperature are related to daytime/nighttime hours shown by the gray/white bars on graphs like these https://www.wunderground.com/forecast/us/mt/absarokee/KMTABSAR2 ... I'm not quite sure how that works when your days are really short or long, i.e. at high latitudes like Iceland. 
Photo of Mike C

Mike C

  • 9 Posts
  • 0 Reply Likes

Hello Thomas, I am working on a project to find the Max temperatures of a specific day in the ten day forecast. However it seems that when I code it to product results I am not finding these being populated. Are you finding high temperatures in the Forecase10day ?


Photo of Thomas Pagano

Thomas Pagano

  • 17 Posts
  • 7 Reply Likes
Hi Mike, 
I think you're asking one of four questions...
1. You're getting the hourly forecast e.g. http://api.wunderground.com/api/[ YOUR API KEY HERE] /hourly10day/q/-15.51,128.15.xml and that says the hourly temperature but it doesn't say the forecast max or min temperature. The answer is to replace "hourly10day" in the address with "forecast10day". 
2. You're already asking for forecast10day but sometimes the results come back blank in the xml file. Sometimes the forecast is mostly there but what you want is listed as ""... Other times entire sections of the xml file don't come back. When I get this, I ask for the result again and sometimes that works. 
3. You're looking for the observed high temperature to compare the forecasts to... "forecast10day" is only forecasts. History or Yesterday might give you the observed.
4. You have a script to process the xml files. The forecasts are in the xml files but your script is not processing them correctly. You would probably need to post your script to get help debugging. 
Hope that helps! 
Tom 
Photo of Mike C

Mike C

  • 9 Posts
  • 0 Reply Likes

Hello Tom, I really appreciate you getting back to me. Ok, I solved one of my problems, I am now able to get the data I was looking for in the Forecast10day. However it has ten days of data. I am not sure if you use =FILTERXLS in excel to capture data or not. There are ten periods/days of information. If I want to return a specific day, I am not sure how to write the string to filter out only that data. For example, here is my script to return the high temp, however with this , it grabs the period 1 info, how would I be more specific to return the  period 5 info. I tried various options and it returns a # VALUE! response. I almost there, just need to figure out this last piece of the puzzle. Thank you again for your help. 

=FILTERXML(D16,"//high/fahrenheit")

Regards,

Mike

(Edited)
Photo of Thomas Pagano

Thomas Pagano

  • 17 Posts
  • 7 Reply Likes
Hi Mike, 
This sounds like more of an excel question than an API question.

Looking at the excel help for filterxml, there's a bit that says "Cells B7:B9 contain the formula =FILTERXML(B3,"//rc/@title"), which needs to be entered as an array formula in those cells. Select B7:C9, enter the formula, and press Ctrl+Shift+Enter. Cells C7:C9 contain the formula =FILTERXML(B3,"//rc/@timestamp"), and also needs to be entered as an array formula." ...

Your issue could be that you're putting your formula in one cell whereas what you want is an array formula over several cells like the above. Notice how the above example talks about getting the values but also the timestamp (e.g. timestamps in column A, values in column B) You might try the same, then you can find the date you want using a =VLOOKUP(my_date,A:B,2,FALSE) on the cells containing your array formulas. 

You might also think about trying this in a language like python or R which have packages that make parsing the xml very easy. 

Tom
Photo of Mike C

Mike C

  • 9 Posts
  • 0 Reply Likes
Tom, Thank you for your reply. I am looking into easier methods to parse out this info. I appreciate you taking the time to look into this for me. Have a great weekend.