input.py

Command line interface for utility functions that work on dvmdostem inputs. This script may also be imported and used from other scripts (if you wish to import functions without using this command line interface).

The command line interface contains (or will in the future) different sub-commands for different types of operations.

usage: input.py [-h] {query,crop,climate-ts-plot,climate-gap-plot} ...

Positional Arguments

command

Possible choices: query, crop, climate-ts-plot, climate-gap-plot

sub commands

Sub-commands

query

Query one or more dvmdostem inputs for various information.

input.py query [-h] [--iyix-from-latlon IYIX_FROM_LATLON IYIX_FROM_LATLON] [--latlon-file LATLON_FILE]

Named Arguments

--iyix-from-latlon

Find closest pixel to provided lat and lon arguments.

--latlon-file

The file to read from for getting lat/lon pixel offsets.

Default: “../snap-data/temporary-veg-from-LandCover_TEM_2005.tif”

crop

Crop an input dataset, using offset and size. The reason we need this in addition to the create_region_input.py script is because the create_region_input.py script uses gdal_translate (or gdalwarp) to subset the original tif files, and for some reason that has problems creating regions smaller than about 5x5 pixels. So in order to get a single pixel input dataset, we have to first create a larger dataset, and then crop it using this tool. Someday it might make sense to merge this script with the create_region_input.py script.

input.py crop [-h] --yx YX YX [--ysize YSIZE] [--xsize XSIZE] input_folder

Positional Arguments

input_folder

Path to a folder containing a set of dvmdostem inputs.

Named Arguments

--yx

The Y, X position to start cropping

--ysize

The number of pixels to take in the y dimension.

Default: 1

--xsize

The number of pixels to take in the x dimension.

Default: 1

climate-ts-plot

Quick ‘n dirty time series plots of the 4 climate driver variables for a single pixel. Makes 2 figures, one for historic, one for projected.

input.py climate-ts-plot [-h] --type {spatial-temporal-summary,raw} [--yx YX YX] [--stitch] input_folder

Positional Arguments

input_folder

Path to a folder containing a set of dvmdostem inputs.

Named Arguments

--type

Possible choices: spatial-temporal-summary, raw

--yx

The Y, X position of the pixel to plot

--stitch

Attempt to stitch together the historic and projected data along the time axis

Default: False

climate-gap-plot

Generates an image plot for each variable in the

input climate files (historic and projected). Each pixel in the image shows the number of values along the time axis that have missing or no data.

input.py climate-gap-plot [-h] input_folder

Positional Arguments

input_folder

Path to a folder containing a set of dvmdostem inputs.