spatiocoexistence.py_tools module

spatiocoexistence.py_tools.get_BA_and_k(CI_CS, CI_C, CI_HS, CI_H, species, dbh, max_x, max_y, radius)[source]

BA stands for basal area, and k represents aggregation. ff is for comparing a focal species with conspecifics. fh is for comparing a focal species with heterospecifics. Returns numpy arrays for all outputs.

Return type:

tuple[ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[int64]], ndarray[tuple[Any, …], dtype[int64]]]

spatiocoexistence.py_tools.reduced_growth(CI_CS, CI_HS, beta_gr=None)[source]

Calculate the reduced growth using the formula from Cython.

Return type:

ndarray[tuple[Any, …], dtype[float64]]

spatiocoexistence.py_tools.survival(CI_CS, CI_HS, CI_CS_dead, CI_HS_dead, dbh, reduced=True)[source]

Calculate the reduced survival using the formula from Cython.

Return type:

ndarray[tuple[Any, …], dtype[float64]]

spatiocoexistence.py_tools.reduced_recruitment(CI_CS, CI_HS, CI_CS_d, CI_HS_d, dbh, species)[source]

Calculate the reduced recruitment using the formula from Cython.

Return type:

ndarray[tuple[Any, …], dtype[float64]]

spatiocoexistence.py_tools.size_class(bins=32, delta_size=0.2558)[source]

Calculate the size classes, that are needed for further analysis.

Return type:

ndarray

spatiocoexistence.py_tools.mean_count_size_class(size_class, parameter, dbh, count=False)[source]

Get the mean values of the parameter specified for a size class.

Return type:

ndarray

spatiocoexistence.py_tools.create_initial_inventory(n_species=80, n_repro=22646, n_saplings=10000, initial_dbh_rp=6.64, initial_dbh_sa=0.397, dim_x=1000, dim_y=500, radius=20, num_threads=1)[source]

Create an initial inventory for a uniformly distributed forest. The abundance per species is calculated by the mean density of species of BCI. Then for each species the trees/individuals are located randomly according to their abundance.

the initial dbh, can be also calculated as: # np.sqrt(4*mean_BA/np.pi) mean_BA: float = 6.64,

ToDo: -2 (dead, memory), -1(just died), 0(alive), 1(recruit), 2(reproud)

Return type:

ndarray

spatiocoexistence.py_tools.read_initial_inventory(file_name, radius=10)[source]
Return type:

ndarray

spatiocoexistence.py_tools.read_param_file(file, skip_header=0, skip_footer=0)[source]
Return type:

dict[str, float | int | str]

spatiocoexistence.py_tools.map_params(params)[source]

Map the parameters to pythonic naming and scale certain values.

Return type:

dict

spatiocoexistence.py_tools.species_abundance_distribution(species, abundance_class)[source]

Get the amount of species per abundance class.

spatiocoexistence.py_tools.log_likelihood(simulated_mean, simulated_std, reference_par)[source]

Calculate the log-likelihood for a certain parameter.

The formula used is: log(L) = -(sum((x_n - μ)²/(2σ²)) + N * log(√(2πσ²)))

spatiocoexistence.py_tools.get_CI_CS_histogram(inventory, bins)[source]
spatiocoexistence.py_tools.get_CI_HS_histogram(inventory, bins)[source]
spatiocoexistence.py_tools.get_reduced_growth_histogram(inventory, bins, beta_gr=0.084)[source]
spatiocoexistence.py_tools.get_survival_histogram(inventory, bins)[source]
spatiocoexistence.py_tools.get_recruitment_histogram(inventory, bins)[source]
spatiocoexistence.py_tools.get_SAD_histogram(inventory, bins)[source]