natcap.invest.finfish_aquaculture.finfish_aquaculture

InVEST Finfish Aquaculture.

natcap.invest.finfish_aquaculture.finfish_aquaculture.execute(args)

Finfish Aquaculture.

This function will take care of preparing files passed into the finfish aquaculture model. It will handle all files/inputs associated with biophysical and valuation calculations and manipulations. It will create objects to be passed to the aquaculture_core.py module. It may write log, warning, or error messages to stdout.

Parameters
  • workspace_dir (string) – The directory in which to place all result files.

  • results_suffix (string) – (optional) string to append to any output file names

  • ff_farm_loc (string) – URI that points to a shape file of fishery locations

  • farm_ID (string) – column heading used to describe individual farms. Used to link GIS location data to later inputs.

  • g_param_a (float) – Growth parameter alpha, used in modeling fish growth, should be an int or float.

  • g_param_b (float) – Growth parameter beta, used in modeling fish growth, should be an int or float.

  • g_param_tau (float) – Growth parameter tau, used in modeling fish growth, should be an int or float

  • use_uncertainty (boolean) –

  • g_param_a_sd (float) – (description)

  • g_param_b_sd (float) – (description)

  • num_monte_carlo_runs (int) –

  • water_temp_tbl (string) – URI to a CSV table where daily water temperature values are stored from one year

  • farm_op_tbl (string) – URI to CSV table of static variables for calculations

  • outplant_buffer (int) – This value will allow the outplanting start day to be flexible plus or minus the number of days specified here.

  • do_valuation (boolean) – Boolean that indicates whether or not valuation should be performed on the aquaculture model

  • p_per_kg (float) – Market price per kilogram of processed fish

  • frac_p (float) – Fraction of market price that accounts for costs rather than profit

  • discount (float) – Daily market discount rate

Example Args Dictionary:

{
    'workspace_dir': 'path/to/workspace_dir',
    'results_suffix': 'test',
    'ff_farm_loc': 'path/to/shapefile',
    'farm_ID': 'FarmID'
    'g_param_a': 0.038,
    'g_param_b': 0.6667,
    'g_param_tau': 0.08,
    'use_uncertainty': True,
    'g_param_a_sd': 0.005,
    'g_param_b_sd': 0.05,
    'num_monte_carlo_runs': 1000,
    'water_temp_tbl': 'path/to/water_temp_tbl',
    'farm_op_tbl': 'path/to/farm_op_tbl',
    'outplant_buffer': 3,
    'do_valuation': True,
    'p_per_kg': 2.25,
    'frac_p': 0.3,
    'discount': 0.000192,
}
natcap.invest.finfish_aquaculture.finfish_aquaculture.format_ops_table(op_path, farm_ID, ff_aqua_args)

Takes in the path to the operating parameters table as well as the keyword to look for to identify the farm number to go with the parameters, and outputs a 2D dictionary that contains all parameters by farm and description. The outer key is farm number, and the inner key is a string description of the parameter.

Parameters
  • op_path – URI to CSV table of static variables for calculations

  • farm_ID – The string to look for in order to identify the column in which the farm numbers are stored. That column data will become the keys for the dictionary output.

  • ff_aqua_args – Dictionary of arguments being created in order to be passed to the aquaculture core function.

  • ff_aqua_args['farm_op_dict'] – A dictionary that is built up to store the static parameters for the aquaculture model run. This is a 2D dictionary, where the outer key is the farm ID number, and the inner keys are strings of parameter names.

Returns

None

natcap.invest.finfish_aquaculture.finfish_aquaculture.format_temp_table(temp_path, ff_aqua_args)

This function is doing much the same thing as format_ops_table- it takes in information from a temperature table, and is formatting it into a 2D dictionary as an output.

Input:
temp_path: URI to a CSV file containing temperature data for 365 days

for the farms on which we will look at growth cycles.

ff_aqua_args: Dictionary of arguments that we are building up in order

to pass it to the aquaculture core module.

Output:
ff_aqua_args[‘water_temp_dict’]: A 2D dictionary containing temperature

data for 365 days. The outer keys are days of the year from 0 to 364 (we need to be able to check the day modulo 365) which we manually shift down by 1, and the inner keys are farm ID numbers.

Returns nothing.