Nutrients module#

Content#

nitrogen_from_feces(amount[, ci, q, wet])

Compute the amount of nitrogen from a mass of feces using the excretion_content.csv database.

nitrogen_from_population(pop, duration[, ...])

Compute the amount of nitrogen generated by a given population over a certain duration using the food.csv or nutrients_excreted.csv database.

nitrogen_from_urine(amount[, ci, q])

Compute the amount of nitrogen from a volume of urine using the excretion_content.csv database.

nutrient_from_biowaste(mass, nutrient[, ...])

Compute the amount of a nutrient contained in biowaste (food residues, i.e. kitchen and food waste, by default) using the food.csv database.

nutrient_from_compound(amount, nutrient, ...)

Compute the amount of nutrients contained in a specific compound.

nutrient_from_population(pop, duration, nutrient)

Compute the amount of a nutrient generated by a given population over a certain duration using the nutrients_intake.csv or nutrients_excreted.csv database.

phosphorus_from_feces(amount[, ci, q, wet])

Compute the amount of phosphorus from a mass of feces using the excretion_content.csv database.

phosphorus_from_population(pop, duration[, ...])

Compute the amount of phosphorus generated by a given population over a certain duration using the food.csv or nutrients_excreted.csv database.

phosphorus_from_urine(amount[, ci, q])

Compute the amount of nitrogen from a volume of urine using the excretion_content.csv database.

Details#

orgmatt.nutrients.nitrogen_from_feces(amount: Quantity, ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, wet: bool = True, **kwargs) Quantity[source]#

Compute the amount of nitrogen from a mass of feces using the excretion_content.csv database.

Parameters:
  • amount (Quantity (float or numpy array) [mass]) – Mass of feces.

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • wet (bool (optional, default: True)) – Whether to compute the mass of wet feces (default) or dry solids.

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add group=”Adult” to return only data from adult individuals, or region=”Europe” to use only values obtained from studies in European countries.

Returns:

nitrogen_mass – Mean mass of contained nitrogen if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in amount; otherwise one (low, mean, high) result per entry in amount, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(amount), 3), or (len(amount), len(q)) depending on ci and q.

Return type:

float or array of dimension D [mass]*[nitrogen]

orgmatt.nutrients.nitrogen_from_population(pop: float | ndarray[Any, dtype[floating | int64]], duration: Quantity, excreta: str = 'all', ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, **kwargs) Quantity[source]#

Compute the amount of nitrogen generated by a given population over a certain duration using the food.csv or nutrients_excreted.csv database.

Parameters:
  • pop (float or array-like object) – Number of inhabitants.

  • duration (Quantity (float) [time]) – Time interval over which the nitrogen is excreted.

  • excreta (str (optional, default: "all")) – Type of excreta (“urine”, “feces”, or “all”).

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add excreta=”feces” to return only nitrogen contained in feces, or region=”Europe” to use only values obtained from studies in European countries.

Returns:

nitrogen_mass – Mean mass of excreted nitrogen if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in pop; otherwise one (low, mean, high) result per entry in pop, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(pop), 3), or (len(pop), len(q)) depending on ci and q.

Return type:

float or array of dimension D [mass]*[nitrogen]

orgmatt.nutrients.nitrogen_from_urine(amount: Quantity, ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, **kwargs) Quantity[source]#

Compute the amount of nitrogen from a volume of urine using the excretion_content.csv database.

Parameters:
  • amount (Quantity (float or numpy array) [length]**3) – Quantity of urine in liters or cubic meters.

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add group=”adult” to return only data from adult individuals, or region=”Europe” to use only values obtained from studies in European countries.

Returns:

nitrogen_mass – Mean mass of contained nitrogen if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in amount; otherwise one (low, mean, high) result per entry in amount, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(amount), 3), or (len(amount), len(q)) depending on ci and q.

Return type:

float or array of dimension D [mass]*[nitrogen]

orgmatt.nutrients.nutrient_from_biowaste(mass: Quantity, nutrient: str, waste_type: str = 'BiodegradableWaste', ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, **kwargs) Quantity[source]#

Compute the amount of a nutrient contained in biowaste (food residues, i.e. kitchen and food waste, by default) using the food.csv database.

Parameters:
  • mass (pint.Quantity [mass]) – Mass of biowaste.

  • nutrient (str) – Chemical symbol for the nutrient (among ‘N’, ‘P’, ‘K’)

  • waste_type (str (optional, default: "BiodegradableWaste")) – Type of biowaste, among “BiodegradableWaste” for all household biowaste, including some paper; cardboard, compostable plastics, and some green waste, “GreenWaste”, for plants and garden wastes, “FoodWaste”, for all unconsumed edible food, “KitchenWaste” (peels, bones…), and “FoodResidues”, which includes food and kitchen waste.

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add region=”Europe” to use only values obtained from studies in European countries.

Returns:

nutrient_mass – Mean mass of excreted nutrient if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in amount; otherwise one (low, mean, high) result per entry in amount, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(amount), 3), or (len(amount), len(q)) depending on ci and q.

Return type:

float or array of dimension D [mass]*[nutrient]

orgmatt.nutrients.nutrient_from_compound(amount: Quantity, nutrient: str, compound_type: str, ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, **kwargs) Quantity[source]#

Compute the amount of nutrients contained in a specific compound.

Parameters:
  • amount (pint.Quantity) – Amount of compound.

  • nutrient (str) – Type of nutrient to return.

  • compound_type (str) – Type of compound among “urine”, “feces” = “feces (wet)”, “feces (dry)”, “biowate” = “BiodegradableWaste”, “food residues” = “FoodResidues”, “food waste” = “FoodWaste”.

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add region=”Europe” to use only values obtained from studies in European countries.

Returns:

nutrient_mass – Mean mass of excreted nutrient if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in amount; otherwise one (low, mean, high) result per entry in amount, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(amount), 3), or (len(amount), len(q)) depending on ci and q.

Return type:

float or array of dimension D [mass]*[nutrient]

orgmatt.nutrients.nutrient_from_population(pop: float | ndarray[Any, dtype[floating | int64]], duration: Quantity, nutrient: str, excreta: str = 'all', ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, **kwargs) Quantity[source]#

Compute the amount of a nutrient generated by a given population over a certain duration using the nutrients_intake.csv or nutrients_excreted.csv database.

Warning

Current results only work for adults, results for children and adolescents will be (strongly) overestimated.

Parameters:
  • pop (float or numpy array) – Number of inhabitants.

  • duration (float [time]) – Time interval over which the nitrogen is excreted.

  • nutrient (str) – Chemical symbol for the nutrient (among ‘N’, ‘P’, ‘K’, ‘Mg’, ‘Ca’)

  • excreta (str (optional, default: "all")) – Type of excreta (“urine”, “feces”, or “all”).

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add sex=”male” to return only nitrogen excretion from male subjects, or region=”South Asia” to use only values obtained from studies in South Asian countries.

Returns:

nutrient_mass – Mean mass of excreted nitrogen if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in pop; otherwise one (low, mean, high) result per entry in pop, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(pop), 3), or (len(pop), len(q)) depending on ci and q.

Return type:

float or array of dimension D [mass]*[nutrient]

orgmatt.nutrients.phosphorus_from_feces(amount: Quantity, ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, wet: bool = True, **kwargs) Quantity[source]#

Compute the amount of phosphorus from a mass of feces using the excretion_content.csv database.

Parameters:
  • amount (Quantity (float or numpy array) [mass]) – Mass of feces.

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • wet (bool (optional, default: True)) – Whether to compute the mass of wet feces (default) or dry solids.

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add group=”adult” to return only data from adult individuals, or region=”Europe” to use only values obtained from studies in European countries.

Returns:

nitrogen_mass – Mean mass of contained nitrogen if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in amount; otherwise one (low, mean, high) result per entry in amount, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(amount), 3), or (len(amount), len(q)) depending on ci and q.

Return type:

float or array of dimension D [mass]*[nitrogen]

orgmatt.nutrients.phosphorus_from_population(pop: float | ndarray[Any, dtype[floating | int64]], duration: Quantity, excreta: str = 'all', ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, **kwargs) Quantity[source]#

Compute the amount of phosphorus generated by a given population over a certain duration using the food.csv or nutrients_excreted.csv database.

Parameters:
  • pop (float or list-like object) – Number of inhabitants.

  • duration (Quantity (float) [time]) – Time interval over which the nitrogen is excreted.

  • excreta (str (optional, default: "all")) – Type of excreta (“urine”, “feces”, or “all”).

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI, otherwise it will only return the average value.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add excreta=”feces” to return only phosphorus contained in feces, or region=”Europe” to use only values obtained from studies in European countries.

Returns:

phosphorus – Mass of excreted phosphorus if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in pop; otherwise one (low, mean, high) result per entry in pop, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(pop), 3), or (len(pop), len(q)) depending on ci and q.

Return type:

float or array of dimension D [mass]*[phosphorus]

orgmatt.nutrients.phosphorus_from_urine(amount: Quantity, ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, **kwargs) Quantity[source]#

Compute the amount of nitrogen from a volume of urine using the excretion_content.csv database.

Parameters:
  • amount (Quantity (float or numpy array) [length]**3) – Quantity of urine in liters or cubic meters.

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI, otherwise it will only return the average value.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add group=”Adult” to return only data from adult individuals, or region=”Europe” to use only values obtained from studies in European countries.

Returns:

phosphorus – Mass of excreted phosphorus if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in amount; otherwise one (low, mean, high) result per entry in amount, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(amount), 3), or (len(amount), len(q)) depending on ci and q.

Return type:

float or array of dimension D [mass]*[phosphorus]