HWRF  trunk@4391
Classes | Functions | Variables
hwrf.tracker Namespace Reference

This module contains tasks to prepare input for the GFDL Vortex Tracker, run the tracker and deliver its results. More...

Detailed Description

This module contains tasks to prepare input for the GFDL Vortex Tracker, run the tracker and deliver its results.

Classes

class  CleanATCFSubsetProduct
 A FileProduct that delivers a subset of a track. More...
 
class  GRIB1VintTave
 A GRIB1Op that runs vint and tave: two of the tracker prep programs. More...
 
class  RawATCFProduct
 A FileProduct for tracker output. More...
 
class  TrackerTask
 This task runs the GFDL Vortex Tracker on HWRF output. More...
 
class  TrackerView
 This Task is used by the delivery script executed by the gettrk program itself. More...
 

Functions

def jtwc_rewrite
 Rewrites track files as used by the HWRF WPAC parallels from 2013-2015. More...
 
def hwrf_diagnostic_subset
 Selects lines for the hwrfprs_c files. More...
 
def hwrf_combine_subset (w)
 A simple wrapper around hwrf_diagnostic_subset that provides a subset of the HWRF fields and vertical levels suitable for analyzing the large-scale hurricane structure. More...
 
def hwrf_global_subset (w)
 A simple wrapper around hwrf_diagnostic_subset that provides a subset of the HWRF fields and vertical levels suitable for analyzing the synoptic-scale or global fields and comparison to the parent global model. More...
 
def tracker_subset (wgribout)
 This is a GRIB subsetter intended to be sent to the subset operator of an hwrf.regrib.GRIB1Op object, to produce GRIB1 files that contain only fields needed by the tracker. More...
 
def action_expandlatlon (op, regrib, name, center, west, east, north, south, n0, n1, scan, res0, res1, kwargs)
 Internal function that expands a lat-lon grid to make a bigger one. More...
 
def expandlatlon
 Creates a GRID suitable for use with the hwrf.regrib module. More...
 

Variables

list __all__
 List of symbols to export by "from hwrf.tracker import *". More...
 
list TRACKER_SUBSET
 The subset of fields needed from an HWRF GRIB1 file in order to run the tracker. More...
 
 vinttave = GRIB1VintTave
 An alias for GRIB1VintTave.
 
string tracker_delivery_script
 A short Python script run by the gfdl_vortextracker Fortran program to deliver the track file. More...
 

Function Documentation

def hwrf.tracker.action_expandlatlon (   op,
  regrib,
  name,
  center,
  west,
  east,
  north,
  south,
  n0,
  n1,
  scan,
  res0,
  res1,
  kwargs 
)

Internal function that expands a lat-lon grid to make a bigger one.

This is part of the implementation of expandlatlon and should not be called directly. Given the input grid from center.grib1grid, expand the grid in all four compass directions by a specified number of degrees, and produce a new grid with a different resolution, scanning mode and gridpoint count

Parameters
opthe hwrf.regrib.GRIBOp being run
regribthe hwrf.regrib.Regrib for data storage
namethe grid name
centerthe GRIB1 product being centered upon
west,east,north,southhow many degrees to add in each direction (a float)
n0,n1gridpoint counts for the GRIB1 grid 255
scanscanning mode flags for the GRIB1 grid 255
res0,res1resolution information for GRIB1 grid 255
kwargsIgnored.

Definition at line 166 of file tracker.py.

Referenced by hwrf.tracker.tracker_subset().

def hwrf.tracker.expandlatlon (   center,
  west,
  east,
  north,
  south,
  n,
  scan,
  res,
  name = None 
)

Creates a GRID suitable for use with the hwrf.regrib module.

Given the input grid from center.grib1grid, expand the grid in all four compass directions by a specified number of degrees, and produce a new grid with a different resolution, scanning mode and gridpoint count

Parameters
centerthe hwrf.regrib.GRIBBase on which to center
west,east,north,southnumber of degrees to expand
na pair of ints, the GRIB1 grid 255 gridpoint count information
scanthe GRIB1 grid 255 scanning mode information
resa pair of ints, the GRIB1 grid 255 resolution information
namethe name of the grid
Returns
a new hwrf.regrib.GRIBGridCompute that will compute the expanded grid for any forecast time for which the center object can provide inputs

Definition at line 216 of file tracker.py.

def hwrf.tracker.hwrf_combine_subset (   w)

A simple wrapper around hwrf_diagnostic_subset that provides a subset of the HWRF fields and vertical levels suitable for analyzing the large-scale hurricane structure.

Parameters
woutput from wgrib

Definition at line 109 of file tracker.py.

def hwrf.tracker.hwrf_diagnostic_subset (   wgribout,
  hurricane_region = False 
)

Selects lines for the hwrfprs_c files.

This subroutine parses an array of lines from wgrib -s and selects lines to send into the hwrfprs_c and hwrfsat_c GRIB1/2 output files (hurricane_region=True) or hwrfprs_g and hwrfsat_g files (hurricane_region=False). Long ago (in 2011) this was the input to the tracker. In the current system, it contains fields the tracker does not need, lacks some fields it does need, and is in the wrong order for it to be accepted as tracker input. It contains synthetic satellite and other diagnostic quantities that are useful for various data analysis in the high resolution combined grid. The tracker scripts no longer use this output set for any purpose, but it is still valuable for diagnostics. This is in the hwrf.tracker module for historical reasons: the hwrfprs_c files were originally intended for the tracker.

Parameters
wgriboutoutput from wgrib
hurricane_regionif True, a more limited set of variables is kept

Definition at line 56 of file tracker.py.

Referenced by hwrf.tracker.hwrf_combine_subset(), and hwrf.tracker.hwrf_global_subset().

def hwrf.tracker.hwrf_global_subset (   w)

A simple wrapper around hwrf_diagnostic_subset that provides a subset of the HWRF fields and vertical levels suitable for analyzing the synoptic-scale or global fields and comparison to the parent global model.

Parameters
woutput from wgrib

Definition at line 117 of file tracker.py.

def hwrf.tracker.jtwc_rewrite (   inatcf,
  outatcf,
  logger = None 
)

Rewrites track files as used by the HWRF WPAC parallels from 2013-2015.

Parameters
inatcfinput ATCF file
outatcfoutput ATCF file
loggera logging.Logger for log messages

Definition at line 26 of file tracker.py.

Referenced by scripts.exhwrf_output.main().

def hwrf.tracker.tracker_subset (   wgribout)

This is a GRIB subsetter intended to be sent to the subset operator of an hwrf.regrib.GRIB1Op object, to produce GRIB1 files that contain only fields needed by the tracker.

This function iterates over wgrib -s output lines. It subsets the lines, returning the ones the tracker expects, in the exact order the tracker expects them. The input is an array of lines from wgrib -s. This is intended to be used with the gribtask and regrib modules by doing gribop/tracker_subset to produce a GRIB1Op that will make a tracker subset of the given GRIB1 file.

Parameters
wgriboutoutput from wgrib

Definition at line 141 of file tracker.py.

Variable Documentation

hwrf.tracker.__all__
Initial value:
1 = [ 'hwrf_combine_subset', 'tracker_subset', 'expandlatlon',
2  'vinttave','TrackerTask','GRIB1VintTave' , 'jtwc_rewrite']

List of symbols to export by "from hwrf.tracker import *".

Definition at line 6 of file tracker.py.

hwrf.tracker.tracker_delivery_script
Initial value:
1 = '''#! /usr/bin/env python
2 import sys
3 import produtil.setup, produtil.datastore
4 import hwrf.tracker
5 produtil.setup.setup()
6 t=hwrf.tracker.TrackerView(
7  dstore=produtil.datastore.Datastore("""{dstorepath}"""),
8  taskname="""{taskname}""",
9  fhr=int(sys.argv[1]),
10  fmin=int(sys.argv[2]) )
11 t.log().info("In ./deliver script")
12 t.run()'''

A short Python script run by the gfdl_vortextracker Fortran program to deliver the track file.

Do not use this directly. It is passed through .format(...) to insert certain data.

Definition at line 632 of file tracker.py.

hwrf.tracker.TRACKER_SUBSET
Initial value:
1 = [ 'HGT:925', 'HGT:850', 'HGT:700', 'UGRD:850', 'UGRD:700',
2  'UGRD:500', 'VGRD:850', 'VGRD:700', 'VGRD:500',
3  'UGRD:10 m ', 'VGRD:10 m ', 'ABSV:850', 'ABSV:700',
4  'PRMSL', 'HGT:900', 'HGT:800', 'HGT:750', 'HGT:650',
5  'HGT:600', 'HGT:550', 'HGT:500', 'HGT:450', 'HGT:400',
6  'HGT:350', 'HGT:300', 'HGT:250', 'TMP:500', 'TMP:450',
7  'TMP:400', 'TMP:350', 'TMP:300', 'TMP:250' ]

The subset of fields needed from an HWRF GRIB1 file in order to run the tracker.

This is used by the tracker_subset function.

Definition at line 131 of file tracker.py.