The config Module

This module contains classes and enums used to configure gridMET processing and specify its parameters

class DateFilter(value: str)[source]

Class, implementing filtering by dates. Primarily used for debugging and testing purposes to avoid long running calculations.

The condition can be specified in one of the following ways:

  • Range: YYYY-MM-DD:YYYY-MM-DD only dates falling in the given

    range will be accepted. Example: ‘2009-12-30:2010-01-03’ means that only 5 days between the 30-th of December of 2009 and January 3, 2010 will be accepted

  • Day of Month: dayofmonth:DD, example: ‘dayofmonth:12’ means that

    only dates corresponding to the 12-th of every month will be accepted

  • Month: month:MM only dates in the given month will be accepted

  • Month and day of a year: date:MM-DD, example: ‘date:03-14’ means

    that only March 14 for each year will be accepted.

accept(day: date)[source]
class Shape(value)[source]

Type of shape

point = 'point'

Point

polygon = 'polygon'

Polygon

class GridmetVariable(value)[source]

GridMET Bands and additional exposure variable types

bi = 'bi'

Burning index: NFDRS fire danger index

erc = 'erc'

Energy release component: NFDRS fire danger index

etr = 'etr'

Daily reference evapotranspiration: Alfalfa, mm

fm100 = 'fm100'

100-hour dead fuel moisture: %

fm1000 = 'fm1000'

1000-hour dead fuel moisture: %

pet = 'pet'

Potential evapotranspiration

pr = 'pr'

Precipitation amount: mm, daily total

rmax = 'rmax'

Maximum relative humidity: %

rmin = 'rmin'

Minimum relative humidity: %

sph = 'sph'

Specific humididy: kg/kg

srad = 'srad'

Surface downward shortwave radiation: W/m^2

th = 'th'

Wind direction: Degrees clockwise from North

tmmn = 'tmmn'

Minimum temperature: K

tmmx = 'tmmx'

Maximum temperature: K

vpd = 'vpd'

Mean vapor pressure deficit: kPa

vs = 'vs'

Wind velocity at 10m: m/s

class OutputType(value)[source]

Type of teh output that the tool should produce

aggregation = 'aggregation'
data_dictionary = 'data_dictionary'
class GridContext(subclass=None, doc=None)[source]

Defines a configuration object to process aggregations and other tasks over data grids

Constructor

Parameters

doc – Optional argument, specifying what to print as documentation

variables

Gridmet bands or variables

Type

List[GridmetVariable]

strategy

Rasterization strategy :type: RasterizationStrategy

destination

Destination directory for the processed files

raw_downloads

Directory for downloaded raw files

geography

The type of geographic area over which we aggregate data

Type

Geography

shapes_dir

Directory containing shape files for geographies

shapes

Type of shapes to aggregate over, e.g. points, polygons

Type

List[Shape]

points

Path to CSV file containing points

coordinates

Column names for coordinates

metadata

Column names for metadata

extra_columns

Columns with constant values to be added to the output file

dates: Optional[DateFilter]

Filter on dates - for debugging purposes only

statistics

Type of statistics

description

Description to be added to data dictionary

table

Name of the table where the aggregated data will be stored

output

Type of the output the tool should produce

ram

Runtime memory available to the process

validate(attr, value)[source]

Subclasses can override this method to implement custom handling of command line arguments

Parameters
  • attr – Command line argument name

  • value – Value returned by argparse

Returns

value to use

class GridMETContext(doc=None)[source]

Defines a configuration object to process aggregations and other tasks over data grids containing gridMET data. Includes validation that a correct gridMET band is provided

Constructor

Parameters

doc – Optional argument, specifying what to print as documentation

dates: Optional[DateFilter]

Filter on dates - for debugging purposes only

validate(attr, value)[source]

Subclasses can override this method to implement custom handling of command line arguments

Parameters
  • attr – Command line argument name

  • value – Value returned by argparse

Returns

value to use