cgeniepy.chem ============= .. py:module:: cgeniepy.chem Classes ------- .. autoapisummary:: cgeniepy.chem.Chemistry cgeniepy.chem.ModelCarbon Module Contents --------------- .. py:class:: Chemistry .. py:method:: molar_mass(element: str) get molar mass (g/mol) of chemistry elements .. py:method:: molecular_weight(formula: str) Calculate molecular weight using a chemical formula :param formula: chemical formula :returns: molecular weight --------- Example ---------- >>> molecular_weight("C6H12O6") >>> 180.15588 .. py:method:: pure_unit(unit: str) Get a pure unit string by removing elements in string (e.g., mmol C d-1) :param unit: unit string with elements :returns: pure unit string --------- Example ---------- >>> pure_unit("mmol C d-1") >>> "mmol d-1" .. py:method:: format_base_unit(input_str, latex_format=True) Convert the base unit (i.e., no whitespace) to the desired format base unit means it is not a compound unit (e.g., m2, m-2, m/s, m s-1), which should be handled by the function `format_unit` :param input_str: a base unit string :return: a formatted string ---------- Example: ---------- >>> convert_a_unit('m2') '$m^2$' >>> convert_a_unit('m-2') '$m^{-2}$' .. py:method:: format_unit(input, *args, **kwargs) convert a unit in a string seprated by whitespace to the desired format, which can be used in plot labels and facilitate the unit calculation :param input: a unit string :return: a formatted string ---------- Example: ---------- >>> format_unit('mol kg-1') 'mol kg$^{-1}$' >>> format_unit('mmol m-2 d-1') 'mmol m$^{-2}$ d$^{-1}$' .. py:class:: ModelCarbon(model) .. py:attribute:: model .. py:method:: get_NPP() netprimary production (NPP) in Pg C yr-1 .. py:method:: get_poc_export(depth=None) particulate organic carbon (POC) export at 80 m in Pg C yr-1 .. py:method:: get_eratio() export ratio (ER), calculated as POC export at 80 m divided by NPP .. py:method:: get_Teff(zt1=80, zt2=1000) transfer efficiency (Teff), default calculated as POC export at 1000 m divided by POC export at 80 m