python-awips/examples/GetGridNames.md

49 lines
906 B
Markdown
Raw Normal View History

2015-06-29 15:51:41 -06:00
#### Using the DAF to get all of the available grids
2015-06-29 15:30:33 -06:00
2015-06-29 15:51:41 -06:00
```python
2015-06-29 15:30:33 -06:00
#!python
2016-03-11 15:05:01 -07:00
from awips.dataaccess import DataAccessLayer
2015-06-29 15:30:33 -06:00
#Initiate a new DataRequest
request = DataAccessLayer.newDataRequest()
#Set the datatype to grid so it knows what plugin to route the request too
request.setDatatype("grid")
#getAvailableLocationNames method will return a list of all available models
#LocationNames mean different things to different plugins beware...radar is icao,
#satellite is sector, etc
available_grids = DataAccessLayer.getAvailableLocationNames(request)
for grid in available_grids:
print grid
2015-06-29 15:43:20 -06:00
```
2015-06-29 15:30:33 -06:00
And the output of the print grid statement would look something like this:
2015-06-29 15:51:41 -06:00
```python
2015-06-29 15:30:33 -06:00
RUC236
SREF216
ENSEMBLE
RTOFS-WestAtl
AKwave10
HiResW-NMM-AK
QPE-KRF
AK-NamDNG5
GFS160
FFG-TIR
GFS254
SPCGuide
RFCqpf
RTMA-Mosaic
QPE-RFC-RSA
UKMET40
MPE-Local-MSR
gefs
WNAwave4
GFS201
QPE-XNAV-ALR
AK-RTMA3
GFS212
...
2015-06-29 15:43:20 -06:00
```