Point Weather Forecast API Guide

Summary:

This document explains how to access the Point Weather Forecast (derived from BoM's ADFD - Australian Digital Forecast Database) data hosted on the Senaps platform. In particular this document focuses on using the THREDDS Data Manager (TDM) API provided by Eratos Senaps to extract specific point locations and return the data as JSON time series.

Prerequisites:

  • Authorisation and license agreement. You can purchase a subscription through our AgData Shop

  • An Understanding of how BoM ADFD data is structured. Please see the BoM ADFD User Guide document for details.


Please refer to the shop Terms and Conditions for specific terms relating to accessing ADFD data. 

Introduction

Senaps provides an API called TDM (THREDDS Data Manager) which allows for extracting point (longitude, latitude) location forecasts for ADFD data, sometimes referred to as 'drilling' the dataset.

TDM is a REST API with JSON encoded responses. 

Senaps provides a drill operation as part of the TDM API to provide an easy to use end-point for drilling gridded datasets. 

Authentication

All Ag Climate Data Shop API products are authenticated using the process described in Authentication for AgDataShop product APIs. After this process you will have obtained an Access Token which must be applied to every API request as a HTTP Authorization Bearer token. Please note tokens expire as per standard OAuth2 Client Credentials flow.

Authorization: Bearer <INSERT TOKEN>

ADFD data availability

Currently the ADFD data is being synchronised from the BoM twice daily at 00:00Z (10am AEST) and 12:00Z (10pm AEST).

The latest set of files will always be available in the THREDDS data server catalog at consistent URLs. 

The listing of latest files is available as a web page:
https://senaps.eratos.com/thredds/catalog/org_catalogs/csiro/BoM_ADFD/latest/catalog.html

and also as an XML catalog:

https://senaps.eratos.com/thredds/catalog/org_catalogs/csiro/BoM_ADFD/latest/catalog.xml

ADFD Variables

Variable Name

Reporting Period**

Dataset Path

Variable Name

Reporting Period**

Dataset Path

T_SFC

hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71000_AUS_T_SFC.nc

Td_SFC

hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71001_AUS_Td_SFC.nc

MaxT_SFC

daily, 7-day

/csiro/BoM_ADFD/latest/IDZ71002_AUS_MaxT_SFC.nc

MinT_SFC

daily, 7-day

/csiro/BoM_ADFD/latest/IDZ71003_AUS_MinT_SFC.nc

Precip_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71004_AUS_Precip_SFC.nc

DailyPrecip_SFC

daily, 7-day

/csiro/BoM_ADFD/latest/IDZ71005_AUS_DailyPrecip_SFC.nc

Wind_Mag_SFC

hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71006_AUS_Wind_Mag_SFC.nc

PoP_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71013_AUS_PoP_SFC.nc

DailyPrecip25Pct_SFC

daily, 7-day

/csiro/BoM_ADFD/latest/IDZ71014_AUS_DailyPrecip25Pct_SFC.nc

DailyPrecip50Pct_SFC

daily, 7-day

/csiro/BoM_ADFD/latest/IDZ71015_AUS_DailyPrecip50Pct_SFC.nc

DailyPrecip75Pct_SFC

daily, 7-day

/csiro/BoM_ADFD/latest/IDZ71016_AUS_DailyPrecip75Pct_SFC.nc

Sky_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71017_AUS_Sky_SFC.nc

RH_SFC

hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71018_AUS_RH_SFC.nc

WindGust_SFC

hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71021_AUS_WindGust_SFC.nc

WindWaveHgt_SFC

3 hourly, 3.5-day*

/csiro/BoM_ADFD/latest/IDZ71022_AUS_WindWaveHgt_SFC.nc

Swell_Mag_SFC

3 hourly, 3.5-day*

/csiro/BoM_ADFD/latest/IDZ71023_AUS_Swell_Mag_SFC.nc

Swell2_Mag_SFC

3 hourly, 3.5-day*

/csiro/BoM_ADFD/latest/IDZ71024_AUS_Swell2_Mag_SFC.nc

DailyPrecip10Pct_SFC

daily, 7-day

/csiro/BoM_ADFD/latest/IDZ71030_AUS_DailyPrecip10Pct_SFC.nc

Precip10Pct_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71031_AUS_Precip10Pct_SFC.nc

Precip25Pct_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71032_AUS_Precip25Pct_SFC.nc

Precip50Pct_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71033_AUS_Precip50Pct_SFC.nc

WxIcon_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71034_AUS_WxIcon_SFC.nc

ApparentT_SFC

hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71068_AUS_ApparentT_SFC.nc

SigWaveHgt_SFC

3 hourly, 3.5-day*

/csiro/BoM_ADFD/latest/IDZ71069_AUS_SigWaveHgt_SFC.nc

WindMagKmh_SFC

hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71071_AUS_WindMagKmh_SFC.nc

WindGustKmh_SFC

hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71072_AUS_WindGustKmh_SFC.nc

Wind_Dir_SFC

hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71089_AUS_Wind_Dir_SFC.nc

DailyPoP_SFC

daily, 7-day

/csiro/BoM_ADFD/latest/IDZ71090_AUS_DailyPoP_SFC.nc

RestOfDayPoP_SFC

3 hourly, 1 day

/csiro/BoM_ADFD/latest/IDZ71091_AUS_RestOfDayPoP_SFC.nc

Swell_Dir_SFC

3 hourly, 3.5-day*

/csiro/BoM_ADFD/latest/IDZ71092_AUS_Swell_Dir_SFC.nc

Swell2_Dir_SFC

3 hourly, 3.5-day*

/csiro/BoM_ADFD/latest/IDZ71093_AUS_Swell2_Dir_SFC.nc

WxThunderstorms_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71094_AUS_WxThunderstorms_SFC.nc

WxPrecipitationFrozen_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71096_AUS_WxPrecipitationFrozen_SFC.nc

WxPrecipitation_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71097_AUS_WxPrecipitation_SFC.nc

WxFog_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71102_AUS_WxFog_SFC.nc

WxFrost_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71107_AUS_WxFrost_SFC.nc

MixHgt_SFC

hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71109_AUS_MixHgt_SFC.nc

DF_SFC

3 hourly, 7-day

/csiro/BoM_ADFD/latest/IDZ71127_AUS_DF_SFC.nc

DailyWxIcon_SFC

daily, 7-day

/csiro/BoM_ADFD/latest/IDZ71152_AUS_DailyWxIcon_SFC.nc

HWA_SFC

today, one point

/csiro/BoM_ADFD/latest/IDZ71153_AUS_HazWind.nc

* only available at some coastal areas

** Refer to ADFD documentation from the bureau to confirm.



Full catalog details

The BoM ADFD data set has one variable per file. The variable name can usually be derived from the file name - the bit between the "_AUS_" and the ".nc" i.e. in this case it is MaxT_SFC.
The one exception is the HazWind file who's variable name is HWA_SFC. The variable names are described in detail in the BoM ADFD user guide (http://www.bom.gov.au/catalogue/adfdUserGuide.pdf).

Drilling ADFD - Example Test 

As an example, we can use the interactive API documentation to test the drill operation.  You will need a HTTP Bearer Authentication token to run through these steps, see above. 

The TDM drill API operation is documented here: https://senaps.eratos.com/api-docs/#/.  To access the correct API select THREDDS Data Manager API from the drop down box at the top left.  Use the Authorise button to set the HTTP Bearer Authentication token obtained above.

image-20240729-000513.png

ie. if we want to drill the MaxT_SFC variable we need to:

Step 1: Find the dataset path of the latest MaxT ADFD forecast from the table above.

MaxT_SFC

/csiro/BoM_ADFD/latest/IDZ71002_AUS_MaxT_SFC.nc

Step 2: Use the APIDocs to query the drill API 

  • Expand the GET /drill operation, by clicking on the 'GET' button.

  • Click the "Try it out" button to allow data to be entered 

  • Fill in the mandatory path, longitude, latitude and variable fields as shown below (full dataset path is /csiro/BoM_ADFD/latest/IDZ71002_AUS_MaxT_SFC.nc)

image-20240729-000532.png



Step 3: Execute request

Press the Execute button.  

If the request is successful the status code will be 200 and the response will contain the JSON encoded response similar to below.  The values for the slices at the nearest grid cell are contained in the 'results' array. The values are extracted directly from the netCDF file and are not manipulated at all by the drill operation.

{ "datasetpath": "csiro/BoM_ADFD/latest/IDZ71002_AUS_MaxT_SFC.nc", "variable": "MaxT_SFC", "results": [ { "t": "2019-05-15T00:00:00.000Z", "v": { "v": 17.2 } }, { "t": "2019-05-16T00:00:00.000Z", "v": { "v": 17.800001 } }, { "t": "2019-05-17T00:00:00.000Z", "v": { "v": 18 } }, { "t": "2019-05-18T00:00:00.000Z", "v": { "v": 17 } }, { "t": "2019-05-19T00:00:00.000Z", "v": { "v": 15.7 } }, { "t": "2019-05-20T00:00:00.000Z", "v": { "v": 17.1 } }, { "t": "2019-05-21T00:00:00.000Z", "v": { "v": 17.2 } } ] }

Directly using the API endpoint:

(Most of this can be deduced from the API Docs example above.)

a. The URL for the request is https://senaps.eratos.com/tdm/drill 
b. The request method is GET
c. Every request needs authenticating. Using the HTTP Bearer Authentication header. The header must be of the format "Authorization: Bearer <token>"
d. Example parameters can be seen in the api-docs and the above example.

The equivalent call to above is:

https://senaps.eratos.com/tdm/drill?path=%2Fcsiro%2FBoM_ADFD%2Flatest%2FIDZ71002_AUS_MaxT_SFC.nc&longitude=147.3&latitude=-42.99&variable=MaxT_SFC

The Docs provide examples of making the API calls using the common command line tool curl.

API fair usage limits

To maintain quality and low cost service the ADFD-P product includes a fair use policy for API requests.

A single subscription of the ADFD-P product entitles the subscriber to 1000 requests per day to the TDM /drill end-point described in this document.

Please contact the AgData Shop to discus options for higher usage.