Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/small hackathon #81

Merged
merged 82 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
1d216af
new constants class
DzimbaS Mar 16, 2022
ef033b1
new class colonization start
DzimbaS Mar 16, 2022
93d37df
new class vegetation
DzimbaS Mar 21, 2022
46039f5
changes to veg_model
DzimbaS Mar 21, 2022
99777ae
created get_hydromorphodynamics and import vegetation model
deboradta Mar 22, 2022
3bd62d6
base_simulation.py - created initiate_hydromorphodynamics
deboradta Mar 28, 2022
36f84b5
Addition of vegetation characteristics method, growth and mortality c…
DzimbaS Mar 28, 2022
4238dd9
Merge branch 'saltmarsh_debora' into SaltMarsh_Sarah
DzimbaS Mar 29, 2022
69e8e77
Addition of vegetation characteristics method, growth and mortality c…
DzimbaS Mar 29, 2022
fac4a49
add class Hydro_Morphodynamics, process in veg_base_simulation.py
DzimbaS Mar 29, 2022
7a49900
changes to Hydro_Morphodynamics, process in veg_base_simulation.py
DzimbaS Mar 29, 2022
df2a4d7
changes to Hydro_Morphodynamics, process in veg_base_simulation.py, p…
DzimbaS Mar 29, 2022
d0ab434
changes to Hydro_Morphodynamics, process in veg_base_simulation.py, p…
DzimbaS Mar 30, 2022
5bbb8b4
progress in mortality
DzimbaS Mar 30, 2022
66f7f72
output
deboradta Mar 30, 2022
428c137
updates to output
deboradta Mar 31, 2022
fcbcfb9
progress in mortality
DzimbaS Mar 31, 2022
6aa5d37
Merge branch 'SaltMarsh_Sarah' into saltmarsh_debora
deboradta Mar 31, 2022
95d1c0f
Merge branch 'saltmarsh_debora' into SaltMarsh_Sarah
DzimbaS Mar 31, 2022
62727fa
account for maxAge vegetation in veg_growth
DzimbaS Mar 31, 2022
11b4004
Merge branch 'SaltMarsh_Sarah' into saltmarsh_debora
deboradta Mar 31, 2022
d5d4fc8
account for maxAge vegetation in veg_growth
DzimbaS Mar 31, 2022
a119170
Merge branch 'SaltMarsh_Sarah' into saltmarsh_debora
deboradta Mar 31, 2022
2d85f97
updates to output
deboradta Mar 31, 2022
c4e1589
changes after debugging
DzimbaS Mar 31, 2022
eadb6ec
simtest
DzimbaS Apr 1, 2022
861e7b8
veg_delft3D_simulation file
DzimbaS Apr 1, 2022
967bd69
changes to veg_model
DzimbaS Apr 1, 2022
15e4cd9
updates veg_model
deboradta Apr 4, 2022
5f67647
json file for constants and changes to constants class
DzimbaS Apr 4, 2022
1ba7954
Merge branch 'SaltMarsh_Sarah' into saltmarsh_debora
deboradta Apr 4, 2022
9ebe563
Merge branch 'saltmarsh_debora' into SaltMarsh_Sarah
DzimbaS Apr 4, 2022
4dbb854
changes to Vegetation
DzimbaS Apr 4, 2022
81fb7c1
updates veg_model
deboradta Apr 4, 2022
a98b2a4
updates veg_model growth nogrowth
deboradta Apr 4, 2022
2b8d0c8
changes to Vegetation
DzimbaS Apr 4, 2022
b99fde7
updates veg_model and new veg_lifestages
deboradta Apr 4, 2022
ee2d067
updates veg_model and new veg_lifestages
deboradta Apr 4, 2022
51ddc0f
changes to Vegetation
DzimbaS Apr 4, 2022
411bca6
changes to Vegetation
DzimbaS Apr 4, 2022
e9ad3de
Debugging
DzimbaS Apr 5, 2022
395dedc
Debugging
DzimbaS Apr 5, 2022
d454994
Debugging
DzimbaS Apr 5, 2022
14fde55
Debugging
DzimbaS Apr 6, 2022
701cc10
Added README for the veg_model
DzimbaS Apr 6, 2022
b672141
Added README for the veg_model
DzimbaS Apr 6, 2022
1c2b54f
Added README for the veg_model
DzimbaS Apr 6, 2022
2d85e09
delete old readme
DzimbaS Apr 6, 2022
9d47fce
Rename veg_model_README.md to README.md
DzimbaS Apr 6, 2022
68b826a
delete entries in the initial life stage after passing it to juvenile
DzimbaS Apr 6, 2022
8605081
Merge remote-tracking branch 'origin/SaltMarsh_Sarah' into SaltMarsh_…
DzimbaS Apr 6, 2022
55d916b
delete entries in the initial life stage after passing it to juvenile
DzimbaS Apr 6, 2022
7005778
add Puccinellia to species in constants, debugging
DzimbaS Apr 6, 2022
5762e51
debugging
DzimbaS Apr 6, 2022
f7db10c
debugging
DzimbaS Apr 7, 2022
b9cdc2a
debugging
DzimbaS Apr 7, 2022
4f329bd
debugging
DzimbaS Apr 8, 2022
21d4c98
debugging and file to read output
DzimbaS Apr 8, 2022
6d1579f
debugging and output
DzimbaS Apr 8, 2022
c7d824f
debugging and output
DzimbaS Apr 8, 2022
2416842
debugging and additions for Salicornia
DzimbaS Apr 11, 2022
306e463
updates veg_mortality.py
deboradta Apr 11, 2022
3cbb510
changes in mortality
DzimbaS Apr 11, 2022
5376074
changes in update lifestages
DzimbaS Apr 11, 2022
4184bc5
changes in output
DzimbaS Apr 12, 2022
484c1fc
ci(pyproject.toml): Corrected tool typo
Carsopre Apr 12, 2022
53e1ce3
Merge pull request #77 from DzimbaS/SaltMarsh_Sarah
deboradta Apr 12, 2022
f36209f
Merge branch 'feature/small-hackathon' of https://github.com/Deltares…
Carsopre Apr 12, 2022
ac43ce1
added test case
DzimbaS Apr 12, 2022
cfe83b3
Merge branch 'feature/small-hackathon' of https://github.com/Deltares…
Carsopre Apr 12, 2022
d462ae7
test(test/test_data/): Added missing data
Carsopre Apr 12, 2022
9f145d6
test_acceptance.py
DzimbaS Apr 12, 2022
8860a20
delete sim_test
DzimbaS Apr 12, 2022
6c085ce
test(test/test_acceptance.py): Fixed test
Carsopre Apr 12, 2022
448c0d6
test(test/test_acceptance.py): Modified test to run on any machine
Carsopre Apr 12, 2022
aa1b174
test(transect_case): Fixed missing test data for the transect case ou…
Carsopre Apr 12, 2022
9dab0a1
autoformat: isort & black
Carsopre Apr 12, 2022
fb73acf
Documentation
deboradta Apr 12, 2022
401fdf5
Merge remote-tracking branch 'origin/feature/small-hackathon' into fe…
deboradta Apr 12, 2022
e294cc3
autoformat: isort & black
deboradta Apr 12, 2022
b5e7467
fix bugs in veg_mortality.py
DzimbaS Apr 13, 2022
04f1f38
autoformat: isort & black
DzimbaS Apr 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .idea/CoralModel.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

123 changes: 48 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,48 @@
[![ci](https://github.com/Deltares/NBSDynamics/actions/workflows/ci.yml/badge.svg)](https://github.com/Deltares/NBSDynamics/actions/workflows/ci.yml)
[![docs](https://github.com/Deltares/NBSDynamics/actions/workflows/docs.yml/badge.svg)](https://github.com/Deltares/NBSDynamics/actions/workflows/docs.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Deltares_NBSDynamics&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Deltares_NBSDynamics)
![Sonar Coverage](https://img.shields.io/sonar/coverage/Deltares_NBSDynamics?logo=SonarCloud&server=https%3A%2F%2Fsonarcloud.io&?style=plastic&logo=appveyor)

![GitHub release (latest by date)](https://img.shields.io/github/v/release/Deltares/NBSDynamics)
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/Deltares/NBSDynamics)

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# Official Documentation.
Check our official GitHub pages documentation at [https://deltares.github.io/NBSDynamics/](https://deltares.github.io/NBSDynamics/).

# CoralModel
A biophysical model framework written in Python to make simulations
on coral development based on four environmental factors:
(1) light; (2) flow; (3) temperature; and (4) acidity.
For the hydrodynamics, the model can be coupled to Delft3D Flexible Mesh;
a hydrodynamic model developed at Deltares
([more information](https://oss.deltares.nl/web/delft3dfm)).
To enable this online coupling, certain configurations of Python are required
([more details](#python-code)).

**Note:** This model is still in its beta and further development is still being done.
``coral_model_v0`` is used for the study and is rewritten (``coral_model``) to enhance collaboration.
(The original version has not been written efficiently and is hard to follow for outsiders.)
More information on this version control [here](#version-control).

## Biophysics <a name="biophsics"></a>
This biophysical model framework is part of the result of a
[master thesis](https://repository.tudelft.nl/islandora/object/uuid%3Ae211380e-3f92-4afe-b371-f1e87b0c3bbd?collection=education)
of which the key findings are published in *Environmental Modelling and Software*
(the paper can be found [here](https://www.sciencedirect.com/science/article/pii/S1364815221001468?via%3Dihub)).

The biophysical relations used in the biophysical model framework are mainly process-based,
where for the acidity the proxy of the aragonite saturation state is used.
Furthermore, both photo- and thermal-acclimatisation are included,
which result in a dynamic behaviour of the corals to their environment.
Hence, the corals are modelled such that they can adapt to changing environmental conditions over time.

For more details on the biophysics, reference is made to the
[master thesis](https://repository.tudelft.nl/islandora/object/uuid%3Ae211380e-3f92-4afe-b371-f1e87b0c3bbd?collection=education)
and the [paper](https://www.sciencedirect.com/science/article/pii/S1364815221001468?via%3Dihub) that substitute this
repository.

## Python code <a name="python-code"></a>
The Python code is written in Python 3 and makes use of various packages.
Not all of these packages are automatically included in the standard library of Python,
such as ``NetCDF4`` ([download](http://www.ldf.uci.edu/~gohlke/pythonlibs/#netcdf4)).
In case the biophysical model framework is to be coupled to Delft3d Flexible Mesh,
the ``bmi.wrapper`` package is also required ([download](https://github.com/openearth/bmi-python)).

The settings of Python and other packages for the online coupling to work properly are the following:
* Python version 3.6.5
* NumPy version 1.14.3
* SciPy version 1.1.0
* NetCDF4 version 1.4.2
* Matplotlib version 2.2.2
* BMI-Python

**Note:** These requirements are only required in case the biophysical model framework is to be coupled
with Delft3D Flexible Mesh.


# Version control <a name="version-control"></a>
There are two versions of the CoralModel: ``coral_model_v0`` and ``coral_model``.
The first (``coral_model_v0``) is the original code as used in the study (i.e.
[master thesis](https://repository.tudelft.nl/islandora/object/uuid%3Ae211380e-3f92-4afe-b371-f1e87b0c3bbd?collection=education)
and [paper](https://www.sciencedirect.com/science/article/pii/S1364815221001468?via%3Dihub)).
The latter (``coral_model``) is an updated version, which is rewritten such that it enhances collaboration.
This collaboration was one of the goals to further develop this model,
and the biophysical modelling of coral development.

``coral_model_v0`` will be depreciated in the future, when ``coral_model`` is fully operational
and possibly even incorporates more aspects of coral (reef) development.
# How to run a Vegetation simulation in NBSDynamics


## Simulation structure.

The simulation is started using the [simtest_saltmars_test](../../test/test_data/simtest_saltmarsh_test.py) file.
Here the different paths need to be specified.
An object of the class [VegFlowFmSimulation](../../src/core/simulation/veg_delft3d_simulation.py) (which inherits from the BaseSimulation) is created.
Within the object, the vegetation species (in constants and vegetation) are required as an input.
Different species are defined through different constants.
In [Constants](../../src/core/common/constants_veg.py) a json file is called which contains the species specific vegetation parameters.
Additional time related constants (e.g. start time and ecological time steps) are defined in [Constants](../../src/core/common/constants_veg.py) and can be changed manually there.
Further species can be added by defining their specific parameters using [constants_json_create](../../src/core/common/constants_json_create.py).

With those parameters assigned to the object, the simulation is started by using the following methods (specified in the [BaseSimulation](../../src/core/simulation/veg_base_simulation.py)):

* initiate
* configures hydrodynamics and output
* validates simulation directories
* initiated vegetation characteristics for all life stages in the class [LifeStages](../../src/core/vegetation/veg_lifestages.py)
* initializes the output ([VegOutputWrapper](../../src/core/output/veg_output_wrapper.py))

* run
* when calling the run method (sim_run.run()), the duration of the simulation needs to be specified (in years) (e.g. sim_run.run(5))
* if duration is not given, the duration specified in the [Constants](../../src/core/common/constants_veg.py) class will be used
* the start date is set to the date specified in [Constants](../../src/core/common/constants_veg.py)
* end date = start date + duration
* a loop is started over the duration of the simulation (years)
* inside of that loop another loop iterates over the number of ecological time steps per year (coupling times per year) specified in [Constants](../../src/core/common/constants_veg.py)
* to get the hydro and morphological variables from Delft-FM, the hydro-morphodynamics are retrieved every day.
* the coupling and retrieving of the values is specified in the class [Delft3D](../../src/core/hydrodynamics/delft3d.py)
* aggregated values are then created in the class [Hydro_Morphodynamics](../../src/core/bio_process/hydromorphodynamics.py) and retrieved via the method 'get_hydromorph_values'
* the vegetation dynamics are initiated:
* [Mortality and Growth](../../src/core/bio_process/veg_mortality.py)
* criteria for mortality and mortality fractions are determined based on the species and the morpho- & hydrodynamics
* vegetation growth is initiated based on the number of growth days within the current ecological time step
* [Colonization](../../src/core/bio_process/veg_colonisation.py)
* method is only called when colonization is possible during the specific period of the ecological time step
* criteria for colonization are determined based on the species and the morpho- & hydrodynamics
* the vegetation characteristics of the initial lifestage are updated based on the possible colonization
* [Update_Lifestages](../../src/core/vegetation/veg_model.py)
* the life stages are updates (initial to juvenile and juvenile to mature)
* initial to juvenile always occurs when new vegetation colonized
* juvenile to mature only occurs when vegetation in the juvenile stage reached the maximum years in that life stage
* if the maximum age of vegetation is reached, the vegetation is removed
* The results are exported using the methods defined in [MapOutput](../../src/core/output/veg_output_model.py) and [HisOutput](../../src/core/output/veg_output_model.py)

* finalize (Finalize simulation)
48 changes: 48 additions & 0 deletions docs/guides/run_simulation_veg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# How to run a Vegetation simulation in NBSDynamics


## Simulation structure.

The simulation is started using the [simtest_saltmars_test](../../test/test_data/simtest_saltmarsh_test.py) file.
Here the different paths need to be specified.
An object of the class [VegFlowFmSimulation](../../reference/simulation/vegetation_simulation/#src.core.simulation.veg_delft3d_simulation) (which inherits from the BaseSimulation) is created.
Within the object, the vegetation species (in constants and vegetation) are required as an input.
Different species are defined through different constants.
In [Constants](../../reference/common/common/#src.core.common.constants_veg) a json file is called which contains the species specific vegetation parameters.
Additional time related constants (e.g. start time and ecological time steps) are defined in [Constants](../../src/core/common/common/#src.core.common.constants_veg) and can be changed manually there.
Further species can be added by defining their specific parameters using [constants_json_create](../../src/core/common/common/#src.core.common.constants_json_create).

With those parameters assigned to the object, the simulation is started by using the following methods (specified in the [BaseSimulation](../../reference/simulation/vegetation_simulation/#src.core.simulation.veg_base_simulation)):

* initiate
* configures hydrodynamics and output
* validates simulation directories
* initiated vegetation characteristics for all life stages in the class [LifeStages](../../reference/vegetation/vegetation_model/#src.core.vegetation.veg_lifestages)
* initializes the output ([VegOutputWrapper](../../reference/output/vegetation_output/#src.core.output.veg_output_wrapper))

* run
* when calling the run method (sim_run.run()), the duration of the simulation needs to be specified (in years) (e.g. sim_run.run(5))
* if duration is not given, the duration specified in the [Constants](../../reference/common/common/#src.core.common.constants_veg) class will be used
* the start date is set to the date specified in [Constants](../../reference/common/common/#src.core.common.constants_veg)
* end date = start date + duration
* a loop is started over the duration of the simulation (years)
* inside of that loop another loop iterates over the number of ecological time steps per year (coupling times per year) specified in [Constants](../../reference/common/common/#src.core.common.constants_veg)
* to get the hydro and morphological variables from Delft-FM, the hydro-morphodynamics are retrieved every day.
* the coupling and retrieving of the values is specified in the class [Delft3D](.../../reference/hydrodynamics/hydromodels/#delft3d)
* aggregated values are then created in the class [Hydro_Morphodynamics](../../reference/bio_process/vegetation_processes/#src.core.bio_process.veg_hydro_morphodynamics) and retrieved via the method 'get_hydromorph_values'
* the vegetation dynamics are initiated:
* [Mortality and Growth](../../reference/bio_process/vegetation_processes/#src.core.bio_process.veg_mortality)
* criteria for mortality and mortality fractions are determined based on the species and the morpho- & hydrodynamics
* vegetation growth is initiated based on the number of growth days within the current ecological time step
* [Colonisation](../../reference/bio_process/vegetation_processes/#src.core.bio_process.veg_colonisation)
* method is only called when colonisation is possible during the specific period of the ecological time step
* criteria for colonisation are determined based on the species and the morpho- & hydrodynamics
* the vegetation characteristics of the initial lifestage are updated based on the possible colonisation
* [Update_Lifestages](../../reference/vegetation/vegetation_model/#src.core.vegetation.veg_model)
* the life stages are updates (initial to juvenile and juvenile to mature)
* initial to juvenile always occurs when new vegetation colonized
* juvenile to mature only occurs when vegetation in the juvenile stage reached the maximum years in that life stage
* if the maximum age of vegetation is reached, the vegetation is removed
* The results are exported using the methods defined in [MapOutput](../../reference/output/vegetation_output/#src.core.output.veg_output_model) and [HisOutput](../../reference/output/vegetation_output/#src.core.output.veg_output_model)

* finalize (Finalize simulation)
13 changes: 13 additions & 0 deletions docs/reference/bio_process/vegetation_processes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Biophysical processes

### Colonisation
::: src.core.bio_process.veg_colonisation

### Hydro morphodynamics
::: src.core.bio_process.veg_hydro_morphodynamics

### Mortality and growth
::: src.core.bio_process.veg_mortality



9 changes: 8 additions & 1 deletion docs/reference/common/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@
::: src.core.common.space_time

### Singletons
::: src.core.common.singletons
::: src.core.common.singletons

## Vegetation Constants
:: src.core.common.constants_veg

## Create json file
:: src.core.common.constants_json_create

10 changes: 10 additions & 0 deletions docs/reference/output/vegetation_output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Output classes for the NBSDynamics vegetation model.

### Protocol
::: src.core.output.veg_output_protocol

### Wrapper
::: src.core.output.veg_output_wrapper

### Output models
::: src.core.output.veg_output_model
10 changes: 10 additions & 0 deletions docs/reference/simulation/vegetation_simulation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Classes representing the available simulation modes.

### Simulation Protocol
::: src.core.simulation.simulation_protocol

### Base simulation.
::: src.core.simulation.veg_base_simulation

### Vegetation Delft3D (FlowFM / DIMR)
::: src.core.simulation.veg_delft3d_simulation
7 changes: 7 additions & 0 deletions docs/reference/vegetation/vegetation_model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Vegetation Model

:: src.core.vegetation.veg_model

## Update lifestages

:: src.core.vegetation.veg_lifestages
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ version_files = [
"pyproject.toml:version"
]

[tool.commitizen.custommize]
[tool.commitizen.customize]
bump_pattern = "^(break|new|fix|hotfix|refactor|docs)"
bump_map = {"break" = "MAJOR", "new" = "MINOR", "fix" = "PATCH", "hotfix" = "PATCH", "refactor"="PATCH", "docs" = "PATCH"}

Expand Down
103 changes: 103 additions & 0 deletions sm_plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import os

import matplotlib.pyplot as plt
import netCDF4
import numpy as np

# plt.style.use('seaborn-whitegrid')


out_dir = os.path.join(
"C:\\",
"Users",
"toledoal",
"NBSDynamics",
"test",
"test_data",
"sm_testcase2",
"input",
"MinFiles",
"fm",
"output",
)

# read map file and plot
url = os.path.join(out_dir, "VegModel_map.nc")
nc = netCDF4.Dataset(url)
nc.variables.keys()
limdict = {
"cover": [0, 9999],
"height": [300, 304],
"diaveg": [295, 297],
"rnveg": [302, 304],
"veg_frac_j": [0, 9999],
"veg_frac_m": [0, 1.05],
"max_tau": [0, 1.05],
"max_u": [0, 1.05],
"max_wl": [0, 1.05],
"min_wl": [0, 1.05],
"bl": [9999, 9999],
}

teller = 0
for vv in nc.variables.keys():
teller = teller + 1
if teller > 3:

VT = nc.variables[vv]
VarT = VT[:]

fig = plt.figure()
ax = plt.axes()
plt.xlim(0, 100)
ylims = limdict[vv]
if ylims[0] == 9999:
ylims[0] = 0.95 * np.min(VarT)
if ylims[1] == 9999:
ylims[1] = 1.05 * np.max(VarT)
plt.ylim(ylims)
plt.title(VT.long_name)
plt.xlabel("Time (years)")
plt.ylabel(VT.units)

x = np.linspace(1, 100, 100)

ax.plot(x, VarT[:, 1], "-g", label="Cell 1")
ax.plot(x, VarT[:, 100], "-r", label="Cell 100")
ax.plot(x, VarT[:, 300], "-c", label="Cell 300")
plt.legend()

nc.close()

# read his file and plot
url = os.path.join(out_dir, "VegModel_his.nc")
nc = netCDF4.Dataset(url)
nc.variables.keys()

teller = 0
for vv in nc.variables.keys():
teller = teller + 1
if teller > 3:

VT = nc.variables[vv]
VarT = VT[:]

fig = plt.figure()
ax = plt.axes()
plt.xlim(0, 100)
ylims = limdict[vv]
if ylims[0] == 9999:
ylims[0] = 0.95 * np.min(VarT)
if ylims[1] == 9999:
ylims[1] = 1.05 * np.max(VarT)
plt.title(VT.long_name)
plt.xlabel("Time (years)")
plt.ylabel(VT.units)

x = np.linspace(0, 100, 36525)
colors = iter(plt.cm.rainbow(np.linspace(0, 1, VarT.shape[1])))
for i in range(VarT.shape[1]):
ax.plot(x, VarT[:, i], color=next(colors), label=f"Point {i}")
plt.legend()

nc.close()
2 changes: 1 addition & 1 deletion src/core/bio_process/dislodgment.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def update(self, coral: Coral, survival_coefficient=1):
# # partial dislodgement
Dislodgement.partial_dislodgement(self, coral, survival_coefficient)
# # update
# ulation states
# population states
for s in range(4):
coral.p0[:, s] *= self.survival
# morphology
Expand Down
Loading