(View the complete code for this example.)
This example retrieves tornado vortex signature data statistics for the range from May 5 to May 16, 2009, but only returns the actual NX3TVS data for 11 days starting on May 5, 2006.
Note: The NOAA SWDI web service allows a range longer than one year for statistics reporting, but it allows only up to a year for the range of data that you retrieve. The SASENOAA engine uses the specified start and end dates unless the range exceeds one year (of data retrieval). When the range exceeds one year, the SASENOAA engine issues an invalid range warning and defaults to a different end date. The new end date uses an end year that matches the start date’s year. Sometimes this default behavior might generate an end date that precedes the start date, resulting in only one day (corresponding to the start date) of data retrieved for the OUTXML= options results file.
This example generates an 11-day default range when the end year is changed to 2006 (from 2009); the results in the Mytile data set are shown in Output 50.7.1. The Mytile_S data set shows the recorded feature (tornado vortex signature) count for the specified tile in the tile summary specification, and it includes the centerlat, centerlon, day (date), fcount (feature count for that day), and shapefile. The count represents the number of tornado vortex signatures detected within the tile summary coordinates. This information can be helpful for determining which geographic area and dates to focus on.
options validvarname=any;
title 'Retrieve NOAA NX3TVS Tile Summary Statistics and Data for Date Range';
libname mylib "/sasusr/noaa/doc/";
libname noaa sasenoaa "%sysget(NOAA_DATA)"
noaaset=nx3tvs
range='20060505:20090516'
stat='tilesum:-102.0,32.7'
outXml=mytile
automap=replace
mapref=MyMap
xmlmap="%sysget(NOAA_DATA)mytile.map";
format=xml
;
data mylib.stattil;
set noaa.mytile;
run;
proc contents data=mylib.stattil; run;
proc print data=mylib.stattil(obs=10); run;
Output 50.7.1: Retrieve NOAA NX3TVS Tile Summary Statistics and Data for Date Range
| Retrieve NOAA NX3TVS Tile Summary Statistics and Data for Date Range |
| Obs | ztime | wsr_id | cell_id | cell_type | range | azimuth | max_shear | mxdv | shape |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 2006-05-05T00:05:50 | KBMX | Q0 | TVS | 7 | 217 | 403 | 116 | POINT (-86.8535716274277 33.0786326913943) |
| 2 | 2006-05-05T00:10:02 | KBMX | Q0 | TVS | 5 | 208 | 421 | 120 | POINT (-86.8165772540846 33.0982820681588) |
| 3 | 2006-05-05T00:12:34 | KSJT | P2 | TVS | 49 | 106 | 17 | 52 | POINT (-99.5771091971025 31.1421609654838) |
| 4 | 2006-05-05T00:17:31 | KSJT | B4 | TVS | 40 | 297 | 25 | 62 | POINT (-101.188161700093 31.672392833416) |
| 5 | 2006-05-05T00:29:13 | KMAF | H4 | TVS | 53 | 333 | 34 | 111 | POINT (-102.664426480293 32.7306917937698) |
| 6 | 2006-05-05T00:31:25 | KLBB | N0 | TVS | 51 | 241 | 24 | 78 | POINT (-102.70047613441 33.2380072329615) |
| 7 | 2006-05-05T00:33:25 | KMAF | H4 | TVS | 52 | 334 | 46 | 145 | POINT (-102.6393683028 32.7226656893341) |
| 8 | 2006-05-05T00:37:37 | KMAF | H4 | TVS | 50 | 334 | 34 | 107 | POINT (-102.621904684258 32.6927081076156) |
| 9 | 2006-05-05T00:41:51 | KMAF | H4 | TVS | 51 | 335 | 29 | 91 | POINT (-102.614794815627 32.714139844846) |
| 10 | 2006-05-05T00:44:33 | KLBB | N0 | TVS | 46 | 245 | 35 | 100 | POINT (-102.643380529494 33.3266446067682) |
Note: The date range that is specified in the RANGE= option is invalid for the OUTXML data because it spans more than one year, but the STAT= option can use the longer range (as specified) to report the tile summary statistics. For the file specified in the OUTXML= option, the SASENOAA engine issues a warning that the range is invalid, and it changes the end year to the same year as the start year in an attempt to keep the range under one year. In this example, for brevity, OBS=10 is specified in the PROC PRINT statement. You can use the following statements to generate the statistics results, which are shown in Output 50.7.2. Note: The data that are shown in Output 50.7.2 are restricted only by the date range, not by the tile summary coordinates. To restrict the data results by the coordinates of a tile, use the TILE= option as shown in Example 50.8.
libname mystats "/sasusr/noaa/test/";
proc contents data=mystats.mytile_S; run;
proc print data=mystats.mytile_S; run;
Output 50.7.2: Tornado Vortex Signature Statistics Using the STAT=TILESUM Option
| Retrieve NOAA NX3TVS Tile Summary Statistics and Data for Date Range |
| Obs | day | centerlat | centerlon | fcount | shape |
|---|---|---|---|---|---|
| 1 | 2007-03-29 | 32.7 | -102 | 2 | POLYGON ((-102.05 32.65, -102.05 32.75, -101.95 32.75, -101.95 32.65, -102.05 32.65)) |
| 2 | 2007-09-07 | 32.7 | -102 | 1 | POLYGON ((-102.05 32.65, -102.05 32.75, -101.95 32.75, -101.95 32.65, -102.05 32.65)) |
| 3 | 2008-05-27 | 32.7 | -102 | 4 | POLYGON ((-102.05 32.65, -102.05 32.75, -101.95 32.75, -101.95 32.65, -102.05 32.65)) |
| 4 | 2008-06-20 | 32.7 | -102 | 2 | POLYGON ((-102.05 32.65, -102.05 32.75, -101.95 32.75, -101.95 32.65, -102.05 32.65)) |
| 5 | 2009-04-11 | 32.7 | -102 | 1 | POLYGON ((-102.05 32.65, -102.05 32.75, -101.95 32.75, -101.95 32.65, -102.05 32.65)) |
Note: You can get one day of results for the OUTXML= option by using an end date that is earlier than the start date specified in the RANGE= option. Furthermore, in this example, because both the specified start and end dates are in May, if the specified end date had been May 1, 2009, instead of May 16, 2009, then the statistics results would have been very similar, but the XML file would contain only the results for May 5, 2006. The SASENOAA engine forces the range to use the same year when the specified range exceeds one year. This can sometimes result in an invalid end date that precedes the start date, but the SASENOAA engine then discards the end date so that the range spans only one day, which is the start date.