Crop Production Package

Model Entry Point

natcap.invest.crop_production.crop_production.execute(args)

Crop Production.

Parameters:
  • args['workspace_dir'] (str) – location into which all intermediate and output files should be placed.
  • args['results_suffix'] (str) – a string to append to output filenames
  • args['lookup_table'] (str) – filepath to a CSV table used to convert the crop code provided in the Crop Map to the crop name that can be used for searching through inputs and formatting outputs.
  • args['aoi_raster'] (str) – a GDAL-supported raster representing a crop management scenario.
  • args['dataset_dir'] (str) – the provided folder should contain a set of folders and data specified in the ‘Running the Model’ section of the model’s User Guide.
  • args['yield_function'] (str) – the method used to compute crop yield. Can be one of three: ‘observed’, ‘percentile’, and ‘regression’.
  • args['percentile_column'] (str) – for percentile yield function, the table column name must be provided so that the program can fetch the correct yield values for each climate bin.
  • args['fertilizer_dir'] (str) – path to folder that contains a set of GDAL-supported rasters representing the amount of Nitrogen (N), Phosphorous (P2O5), and Potash (K2O) applied to each area of land (kg/ha).
  • args['irrigation_raster'] (str) – filepath to a GDAL-supported raster representing whether irrigation occurs or not. A zero value indicates that no irrigation occurs. A one value indicates that irrigation occurs. If any other values are provided, irrigation is assumed to occur within that cell area.
  • args['compute_nutritional_contents'] (boolean) – if true, calculates nutrition from crop production and creates associated outputs.
  • args['nutrient_table'] (str) – filepath to a CSV table containing information about the nutrient contents of each crop.
  • args['compute_financial_analysis'] (boolean) – if true, calculates economic returns from crop production and creates associated outputs.
  • args['economics_table'] (str) – filepath to a CSV table containing information related to market price of a given crop and the costs involved with producing that crop.

Example Args:

args = {
    'workspace_dir': 'path/to/workspace_dir/',
    'results_suffix': 'scenario_name',
    'lookup_table': 'path/to/lookup_table',
    'aoi_raster': 'path/to/aoi_raster',
    'dataset_dir': 'path/to/dataset_dir/',
    'yield_function': 'regression',
    'percentile_column': 'yield_95th',
    'fertilizer_dir':'path/to/fertilizer_rasters_dir/',
    'irrigation_raster': 'path/to/is_irrigated_raster',
    'compute_nutritional_contents': True,
    'nutrient_table': 'path/to/nutrition_table',
    'compute_financial_analysis': True,
    'economics_table': 'path/to/economics_table'
}

Crop Production IO Module

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/invest/checkouts/3.3.1/doc/api-docs/final_ecosystem_services/crop_production.rst, line 19)

autodoc: failed to import module u’natcap.invest.crop_production.crop_production_io’; the following exception was raised: Traceback (most recent call last): File “/home/docs/checkouts/readthedocs.org/user_builds/invest/envs/3.3.1/local/lib/python2.7/site-packages/sphinx/ext/autodoc.py”, line 385, in import_object __import__(self.modname) ImportError: No module named crop_production_io

Crop Production Model Module

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/invest/checkouts/3.3.1/doc/api-docs/final_ecosystem_services/crop_production.rst, line 27)

autodoc: failed to import module u’natcap.invest.crop_production.crop_production_model’; the following exception was raised: Traceback (most recent call last): File “/home/docs/checkouts/readthedocs.org/user_builds/invest/envs/3.3.1/local/lib/python2.7/site-packages/sphinx/ext/autodoc.py”, line 385, in import_object __import__(self.modname) ImportError: No module named crop_production_model

Module contents