Disclaimers

I make no guarantees about the accuracy or longevity of this service! It is free for non-commercial use. For any other use please make contact.

Overview

Radarmatic runs on a Mac mini with 4GB of RAM colocated in Las Vegas. It's written in Ruby using Sinatra and served by nginx/passenger. It also makes use of rack::cache, memcached, and a custom utility called radarparse to convert binary weather radar files to JSON. The entire source is available under the MIT license at github.com/jstn/Radarmatic

URLs

To get the most recent image from (for example) the radar site krtx, request radarmatic.com/krtx.json

A list of the all the available radar sites can be found at radarmatic.com/sites_object.js

To get the “nth” image previous to the current one add a parameter called index to your query string. For example, to retrieve the 7th most recent image before the current one for KNQA, request radarmatic.com/knqa.json?index=7

The default product type is ‘p19r0’ but you can select any of the base reflectivity products using the same codes as the NWS. The other options are p19r1, p19r2, p19r3, and p20-r. Use the product parameter, for example: radarmatic.com/kgld.json?index=42&product=p20-r

Format

The NIDS format is poorly documented, but you can find the interface control documents here. The JSON is an almost direct translation and looks like this:

{
    "wmo_header":"SDUS51 KOKX 020416",
    "awips_id":"N0ROKX",
    "message_code":19,
    "message_time":1283401067,
    "source_id":515,
    "destination_id":0,
    "sequence_number":5226,
    "radar_latitude":40.865,
    "radar_longitude":-72.864,
    "radar_altitude":198,
    "product_code":19,
    "operational_mode":1,
    "volume_coverage_pattern":32,
    "volume_scan_number":27,
    "volume_scan_time":1283400991,
    "product_generation_time":1283400995,
    "elevation_number":1,
    "elevation_angle":0.5,
    "maximum_reflectivity":64,
    "calibration_constant":194,
    "threshold_1":"ND",
     //...thresholds 2-15,
    "threshold_16":"+28",
    "layers":[
        {
            "index_of_first_range_bin":0,
            "range_bin_count":230,
            "i_center_of_sweep":256,
            "j_center_of_sweep":280,
            "scale_factor":0.999,
            "radial_count":360,
            "radials":[
                {
                    "start_angle":1.7,
                    "angle_delta":1.0,
                    "range_bins": [19,10,9,8,9,9,8,9,8,8...]
                },
                {
                    "start_angle":2.7,
                    "angle_delta":1.0,
                    "range_bins": [0,8,0,0,8,0,7,7,0,7,0...]
                },
                        ...
            ]
        }
    ]
}

Each image has 360 radials. Each radial has a start angle, an angle delta, and 230 range bins that correspond to 1km increments radiating outward from the center. The values correspond to the threshold values from the header.

One way to draw the image is to iterate over each radial, sweeping out clockwise arcs starting from start_angle and ending at start_angle+delta_angle. Each bin value in the array is one 1km further than the last, and the values range from 0 to 15.

I realize this is a woefully sparse introduction and plan to improve this documentation soon. In the meantime, contact me with questions or suggestions.