Brian Blaylock
April 28, 2021

β˜” Precipitation Variables#

Why is accumulated precipitation always zero for the model analysis? Check out this discussion.

Accumulated Precipitation#

NOTE: When cfgrib reads a grib file with more than one accumulated precipitation field, it will not read all the fields. I think this is an issue with cfgrib (see issue here). The way around this is to key in on a single APCP field, or to specify the stepRange in the backend kwargs. In Herbie, you can set the search to be more specific regarding the ACPC line to aquire.

[1]:
from herbie import Herbie
from toolbox import EasyMap, pc
[2]:
# Analysis accumulated precip (always zero everywhere)
h00 = Herbie("2021-04-28", fxx=0).xarray(":APCP:")

# Accumulated precip
# Note the different search syntax needed to get the 1hr precip versus the 6hr precip

# Accumulation for 1 hour
h06_1hr = Herbie("2021-04-28", fxx=6).xarray(":APCP:.*:(?:0-1|[1-9]\d*-\d+) hour")

# Accumulation since initialization time
h06_6hr = Herbie("2021-04-28", fxx=6).xarray(":APCP:surface:0-[1-9]*")
βœ… Found β”Š model=hrrr β”Š product=sfc β”Š 2021-Apr-28 00:00 UTC F00 β”Š GRIB2 @ aws β”Š IDX @ aws
βœ… Found β”Š model=hrrr β”Š product=sfc β”Š 2021-Apr-28 00:00 UTC F06 β”Š GRIB2 @ aws β”Š IDX @ aws
βœ… Found β”Š model=hrrr β”Š product=sfc β”Š 2021-Apr-28 00:00 UTC F06 β”Š GRIB2 @ aws β”Š IDX @ aws
[3]:
print(f"{h00.tp.GRIB_stepRange=}")
print(f"{h06_1hr.tp.GRIB_stepRange=}")
print(f"{h06_6hr.tp.GRIB_stepRange=}")
h00.tp.GRIB_stepRange='0'
h06_1hr.tp.GRIB_stepRange='5-6'
h06_6hr.tp.GRIB_stepRange='0-6'
[4]:
def get_ax():
    defaults = dict(
        scale="50m",
        dpi=150,
        figsize=(10, 5),
        crs=h00.herbie.crs,
    )
    return EasyMap(**defaults).STATES().OCEAN().LAND().ax
[5]:
h00.herbie.plot(get_ax())
cfgrib variable: tp
GRIB_cfName unknown
GRIB_cfVarName unknown
GRIB_name Total Precipitation
GRIB_units kg m**-2
GRIB_typeOfLevel surface

/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "tp".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
[5]:
<GeoAxesSubplot: title={'left': 'Run: 00:00 UTC 28 Apr 2021 F00', 'center': 'HRRR F00 surface\n', 'right': 'Valid: 00:00 UTC 28 Apr 2021'}>
../../../_images/user_guide_tutorial_bonus_notebooks_accumulated_precip_ACPC_6_3.png
[6]:
h06_1hr.herbie.plot(get_ax())
cfgrib variable: tp
GRIB_cfName unknown
GRIB_cfVarName unknown
GRIB_name Total Precipitation
GRIB_units kg m**-2
GRIB_typeOfLevel surface

/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "tp".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
[6]:
<GeoAxesSubplot: title={'left': 'Run: 00:00 UTC 28 Apr 2021 F06', 'center': 'HRRR F05-F06 surface\n', 'right': 'Valid: 06:00 UTC 28 Apr 2021'}>
../../../_images/user_guide_tutorial_bonus_notebooks_accumulated_precip_ACPC_7_3.png
[7]:
h06_6hr.herbie.plot(get_ax())
cfgrib variable: tp
GRIB_cfName unknown
GRIB_cfVarName unknown
GRIB_name Total Precipitation
GRIB_units kg m**-2
GRIB_typeOfLevel surface

/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "tp".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
[7]:
<GeoAxesSubplot: title={'left': 'Run: 00:00 UTC 28 Apr 2021 F06', 'center': 'HRRR F00-F06 surface\n', 'right': 'Valid: 06:00 UTC 28 Apr 2021'}>
../../../_images/user_guide_tutorial_bonus_notebooks_accumulated_precip_ACPC_8_3.png

Radar Reflectivity#

[8]:
href = Herbie("2021-04-28").xarray(":REFC:")
βœ… Found β”Š model=hrrr β”Š product=sfc β”Š 2021-Apr-28 00:00 UTC F00 β”Š GRIB2 @ aws β”Š IDX @ aws
[9]:
href.herbie.plot(get_ax())
cfgrib variable: refc
GRIB_cfName unknown
GRIB_cfVarName unknown
GRIB_name Maximum/Composite radar reflectivity
GRIB_units dB
GRIB_typeOfLevel atmosphere

/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "refc".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
[9]:
<GeoAxesSubplot: title={'left': 'Run: 00:00 UTC 28 Apr 2021 F00', 'center': 'HRRR  atmosphere\n', 'right': 'Valid: 00:00 UTC 28 Apr 2021'}>
../../../_images/user_guide_tutorial_bonus_notebooks_accumulated_precip_ACPC_11_3.png

Precipitation Rate#

It looks like the f00 precipitation rate is also an empty array.

[10]:
hrate = Herbie("2019-04-28").xarray(":PRATE:")
hrate1 = Herbie("2019-04-28", fxx=1).xarray(":PRATE:")
βœ… Found β”Š model=hrrr β”Š product=sfc β”Š 2019-Apr-28 00:00 UTC F00 β”Š GRIB2 @ aws β”Š IDX @ aws
βœ… Found β”Š model=hrrr β”Š product=sfc β”Š 2019-Apr-28 00:00 UTC F01 β”Š GRIB2 @ aws β”Š IDX @ aws
[11]:
hrate["prate"] = hrate.prate.where(hrate.prate != 0)
hrate.herbie.plot(get_ax())
cfgrib variable: prate
GRIB_cfName unknown
GRIB_cfVarName prate
GRIB_name Precipitation rate
GRIB_units kg m**-2 s**-1
GRIB_typeOfLevel surface

/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "prate".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
[11]:
<GeoAxesSubplot: title={'left': 'Run: 00:00 UTC 28 Apr 2019 F00', 'center': 'HRRR  surface\n', 'right': 'Valid: 00:00 UTC 28 Apr 2019'}>
../../../_images/user_guide_tutorial_bonus_notebooks_accumulated_precip_ACPC_14_3.png
[12]:
hrate1["prate"] = hrate1.prate.where(hrate1.prate != 0)
hrate1.herbie.plot(get_ax())
cfgrib variable: prate
GRIB_cfName unknown
GRIB_cfVarName prate
GRIB_name Precipitation rate
GRIB_units kg m**-2 s**-1
GRIB_typeOfLevel surface

/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "prate".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
/home/blaylock/miniconda3/envs/herbie-dev/lib/python3.11/site-packages/metpy/xarray.py:355: UserWarning: More than one time coordinate present for variable "gribfile_projection".
  warnings.warn('More than one ' + axis + ' coordinate present for variable'
[12]:
<GeoAxesSubplot: title={'left': 'Run: 00:00 UTC 28 Apr 2019 F01', 'center': 'HRRR  surface\n', 'right': 'Valid: 01:00 UTC 28 Apr 2019'}>
../../../_images/user_guide_tutorial_bonus_notebooks_accumulated_precip_ACPC_15_3.png
[ ]: