<?php
require_once "../../config/settings.inc.php";
require_once "../../include/myview.php";
$t = new MyView();

define("IEM_APPID", 67);
$t->title = "HRRR Reflectivity Information";

$d = date("Y/m/d");
$eburl = IEMConfig::EXTERNAL_BASEURL;
$t->content = <<<EOM
<nav aria-label="breadcrumb">
    <ol class="breadcrumb mb-4">
        <li class="breadcrumb-item"><a href="radview.phtml">IEM RadView Mainpage</a></li>
        <li class="breadcrumb-item active" aria-current="page">HRRR Reflectivity</li>
    </ol>
</nav>

<div class="mb-4">
    <h1 class="h3 mb-3">IEM Provided NCEP HRRR Forecasted Simulated Reflectivity</h1>
</div>

<div class="row g-4 align-items-start mb-4">
    <div class="col-lg-7">
        <p class="lead mb-0">Since 2003, the IEM has been providing GIS web services providing NEXRAD composite and single site products. A common feature request made is for forecasted reflectivity to be made as well. Thanks to some simulated reflectivity products from the NCEP HRRR Model, this is now possible.</p>
    </div>
    <div class="col-lg-5">
        <div class="card shadow-sm">
            <div class="card-body">
                <h2 class="h6 text-uppercase text-muted mb-3">Latest Examples</h2>
                <a href="/data/gis/images/4326/hrrr/refd_0060.png">
                    <img class="img-fluid border rounded mb-2" src="/data/gis/images/4326/hrrr/refd_0060.png" alt="Latest HRRR 1 Hour Forecast REFD image">
                </a>
                <p class="small mb-3">Latest HRRR 1 Hour Forecast (<code>REFD</code>)</p>
                <a href="/data/gis/images/4326/hrrr/refp_0060.png">
                    <img class="img-fluid border rounded mb-2" src="/data/gis/images/4326/hrrr/refp_0060.png" alt="Latest HRRR 1 Hour Forecast REFP image">
                </a>
                <p class="small mb-0">Latest HRRR 1 Hour Forecast with Precipitation Type (<code>REFP</code>)</p>
            </div>
        </div>
    </div>
</div>

<div class="card mb-4">
    <div class="card-body">
        <h2 class="h5 card-title">Quick Overview</h2>
        <ul class="mb-0">
            <li><strong>Archive Begins:</strong> 14 Jul 2017 00 UTC</li>
            <li><strong>Imagery Resolution:</strong> 0.02x0.02 degree lat/lon</li>
            <li><strong>Current raw RASTERs:</strong> <a href="/data/gis/images/4326/hrrr/">here</a>, JSON metadata files are available for each file there</li>
            <li><strong>Archived raw RASTERs:</strong> <a href="/archive/data/2017/07/14/GIS/hrrr/00/">here</a> based on UTC timestamps</li>
        </ul>
    </div>
</div>

<div class="card mb-4">
    <div class="card-body">
        <h2 class="h5 card-title">Changelog</h2>
        <ul class="mb-0">
            <li><strong>25 Nov 2024:</strong> Initial support for HRRR Reflectivity with a precipitation type color ramp applied. The hope is to backfill the archive with this eventually.</li>
        </ul>
    </div>
</div>

<h2 class="h4 mt-4">Tile Map Service (TMS)</h2>

<p>You can call the TMS with either model initialization time explicitly set or latest run processed by the IEM. For the explicit time set, the URL form looks like so:</p>

<div class="bg-light border rounded p-3 mb-3">
    <code class="d-block mb-2">{$eburl}/cache/tile.py/1.0.0/hrrr::REFD-F0000-201707140100/6/15/24.png</code>
    <code class="d-block">{$eburl}/cache/tile.py/1.0.0/hrrr::REFP-F0000-201707140100/6/15/24.png</code>
</div>

<p>The important parts here are <i>hrrr::REFD-F0000-201707140100</i> which equates to HRRR model reflectivity for forecast <strong>minute</strong> 0000 (needs to be 4 characters) for model initialization on 14 July 2017 at 01 UTC. Whew, that's a mouthful. HRRR forecasts are available every 15 minutes between initialization and forecast hour 18. <strong>Again, this F**** value is in minutes, not hours!</strong></p>

<p>You can also specify <i>0</i> as the model initialization time, of which the last run processed by the IEM will be picked. For example:</p>

<div class="bg-light border rounded p-3 mb-4">
    <code class="d-block mb-2">{$eburl}/cache/tile.py/1.0.0/hrrr::REFD-F0000-0/6/15/24.png</code>
    <code class="d-block">{$eburl}/cache/tile.py/1.0.0/hrrr::REFP-F0000-0/6/15/24.png</code>
</div>

<h2 class="h4 mt-4">Suggested TMS Usage for Realtime</h2>

<p>To avoid any caching ugliness on the IEM's end, it is always best to use the explicit TMS URLs that specify the HRRR model initialization time. A simple query you can do to figure out the latest run is to fetch the 18-hour (1080 minute) forecast JSON metadata file:</p>

<div class="bg-light border rounded p-3 mb-3">
    <a href="/data/gis/images/4326/hrrr/refd_1080.json">/data/gis/images/4326/hrrr/refd_1080.json</a>
</div>

<p>The <code>model_init_utc</code> value in that file would be the latest run available.</p>

<h2 class="h4 mt-4">Web Map Service (WMS)</h2>

<p>There is also a standard WMS located at:</p>

<div class="bg-light border rounded p-3 mb-3">
    <code class="d-block mb-2">{$eburl}/cgi-bin/wms/hrrr/refd.cgi</code>
    <div>The individual forecast hours have individual LAYERS defined like so <code>refd_0000</code> where 0000 is the forecast time in <strong>minutes</strong>.</div>
</div>

<div class="bg-light border rounded p-3 mb-3">
    <code class="d-block mb-2">{$eburl}/cgi-bin/wms/hrrr/refp.cgi</code>
    <div>The individual forecast hours have individual LAYERS defined like so <code>refp_0000</code> where 0000 is the forecast time in <strong>minutes</strong>.</div>
</div>

<p>Here's a legend for the <code>REFP</code> product:</p>

<p><img class="img-fluid border rounded" src="legends/REFP.png" alt="HRRR Reflectivity with Precip Type" /></p>

<h2 class="h4 mt-4">FAQ</h2>

<ol class="ps-3">
    <li>How soon is the latest run made available?
    <br />At :40 minutes after the hour, a process starts that looks for the HRRR run initialized for the previous hour. This processing takes about 10 minutes, so at for example 01:50 UTC, the 00 UTC run should be available.</li>

    <li>What color index to reflectivity value scale is used for the <code>REFD</code> RASTERS?
    <br />These images should match the <a href="/GIS/rasters.php?rid=2">IEM N0Q Composites</a>.</li>

    <li>What color index to reflectivity value scale is used for the <code>REFP</code> RASTERS?
    <br />These images use a 22-color per precipitation type scale. This RASTER is not intended to be used as data within a GIS.</li>

    <li>What exact dataset is being shown here?
    <br />This is the production NCEP HRRR "REFD" variable, "1000 m above ground" simulated RADAR reflectivity. The <code>REFP</code> applies a color ramp to the reflectivity to indicate if it is rain, snow, freezing rain, and finally ice.</li>

    <li>Am I free to use this service for lucrative commercial interests?
    <br />You betcha, but don't sue us and also send us <a href="/info/contacts.php">feedback</a> on how things can be improved for better usage.</li>
</ol>

EOM;
$t->render('single.phtml');
