ropensci / weatherOz

An API Client for Australian Weather and Climate Data Resources
https://docs.ropensci.org/weatherOz/
GNU General Public License v3.0
23 stars 9 forks source link

Add meta-information to coastal forecasts and precis forecasts #5

Closed bozaah closed 1 year ago

bozaah commented 1 year ago

As with ag bulletins, we need to extend the weatherOz_tbl print function to include these other functions to return meta-information in the console for users to refer to.

bozaah commented 1 year ago

Commit dc7d0f0 address this issue. weatherOZ_print_functions functionally was expanded to incorporate Coastal Water and Précis forecasts outputs. Feedback appreciated before closing this issue.

# Example for South Australia
library(weatherOz)
coastal_for <- get_coastal_forecast(state = "SA")
coastal_for

  -----------  Australian Bureau of Meteorology (BOM) Coastal Waters Forecast. -----------
  Please note information at the foot of:
  <http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDS11072.html>
  the HTML version of Coastal Waters Forecast for 
  SA.
  Also see 
  <http://www.bom.gov.au/catalogue/observations/about-coastal-observations.shtml>.
  ----------------------------------------------------------------------------------------- 
    index product_id type state_code                                           dist_name
 1:  <NA>   IDS11072 <NA>         SA                                     South Australia
 2:     0   IDS11072 <NA>         SA         Far West Coast: WA-SA Border to Fowlers Bay
 3:     1   IDS11072 <NA>         SA         Far West Coast: WA-SA Border to Fowlers Bay
 4:     2   IDS11072 <NA>         SA         Far West Coast: WA-SA Border to Fowlers Bay
 5:     0   IDS11072 <NA>         SA           Upper West Coast: Fowlers Bay to Elliston
---                                                                                     
27:     1   IDS11072 <NA>         SA  Upper South East Coast: Murray Mouth to Cape Jaffa
28:     2   IDS11072 <NA>         SA  Upper South East Coast: Murray Mouth to Cape Jaffa
29:     0   IDS11072 <NA>         SA Lower South East Coast: Cape Jaffa to SA-VIC Border
30:     1   IDS11072 <NA>         SA Lower South East Coast: Cape Jaffa to SA-VIC Border
31:     2   IDS11072 <NA>         SA Lower South East Coast: Cape Jaffa to SA-VIC Border 

And an example of the précis forecast for all Australia:

wa_precis <- get_precis_forecast(state = "AUS")
wa_precis

  -----------  Australian Bureau of Meteorology (BOM) précis Forecast. -----------
  The HTML version of Short Form (précis) Forecast for
  NSW, NT, QLD, SA, TAS, VIC, and WA can be found at:
  <www.bom.gov.au/nsw/forecasts/state.shtml>
   <www.bom.gov.au/nt/forecasts/state.shtml>
   <www.bom.gov.au/qld/forecasts/state.shtml>
   <www.bom.gov.au/sa/forecasts/state.shtml>
   <www.bom.gov.au/tas/forecasts/state.shtml>
   <www.bom.gov.au/vic/forecasts/state.shtml>
   <www.bom.gov.au/wa/forecasts/state.shtml>
  Please note information at the page 
  <http://www.bom.gov.au/catalogue/data-feeds.shtml#precis>
  --------------------------------------------------------------------------------  
      index product_id state        town       aac       lat      lon elev    start_time_local
   1:     0   IDN11060   NSW Albion Park NSW_PT001 -34.56380 150.7900  8.0 2023-03-29 05:00:00
   2:     1   IDN11060   NSW Albion Park NSW_PT001 -34.56380 150.7900  8.0 2023-03-30 00:00:00
   3:     2   IDN11060   NSW Albion Park NSW_PT001 -34.56380 150.7900  8.0 2023-03-31 00:00:00
   4:     3   IDN11060   NSW Albion Park NSW_PT001 -34.56380 150.7900  8.0 2023-04-01 00:00:00
   5:     4   IDN11060   NSW Albion Park NSW_PT001 -34.56380 150.7900  8.0 2023-04-02 00:00:00
  ---                                                                                         
4784:     2   IDW14199    WA   Lombadina  WA_PT283 -16.51507 122.8979 22.9 2023-03-31 00:00:00
4785:     3   IDW14199    WA   Lombadina  WA_PT283 -16.51507 122.8979 22.9 2023-04-01 00:00:00
4786:     4   IDW14199    WA   Lombadina  WA_PT283 -16.51507 122.8979 22.9 2023-04-02 00:00:00
4787:     5   IDW14199    WA   Lombadina  WA_PT283 -16.51507 122.8979 22.9 2023-04-03 00:00:00
4788:     6   IDW14199    WA   Lombadina  WA_PT283 -16.51507 122.8979 22.9 2023-04-04 00:00:00
adamhsparks commented 1 year ago

This looks great, thank you @bozaah! I'll close this now since I opened the initial one in our GitLab.