This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
def show_images(images, cols = 1, titles = None): | |
"""Display a list of images in a single figure with matplotlib. | |
Parameters | |
--------- | |
images: List of np.arrays compatible with plt.imshow. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
import pandas as pd | |
def arcgis_table_to_df(in_fc, input_fields=None, query=""): | |
"""Function will convert an arcgis table into a pandas dataframe with an object ID index, and the selected | |
input fields using an arcpy.da.SearchCursor. | |
:param - in_fc - input feature class or table to convert | |
:param - input_fields - fields to input to a da search cursor for retrieval | |
:param - query - sql query to grab appropriate values | |
:returns - pandas.DataFrame""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A discrete time, age-structured model of a salmon population (semelparous) that can live to age 5, with fishing and environmental stochasticity (by Lauren Yamane, presented to UC Davis R Users' Group) | |
======================================================== | |
Parameter values | |
```{r parameters, comment="#"} | |
a=60 #alpha for Beverton-Holt stock-recruitment curve | |
b=0.00017 #beta for Beverton-Holt | |
tf=2000 #number of time steps | |
N0=c(100,0,0,0,0) #initial population vector for 5 age classes | |
s=0.28 #survival rate with fishing |