-
Notifications
You must be signed in to change notification settings - Fork 0
3. Functions & Usage
An explanation of each function, their parameters and their usage will be shown below. For any specifics regarding the ISO 24443 please visit its ISO webpage or documentation
import photoprotectionpy as pppy
This function is used to determine the initial calculated in vitro Sun Protection Factor (SPF).
SPFi = pppy.ispf(data, integration)
- data is an array containing the absorbance before UV exposure, where rows correspond to each read measured from 290 to 400 nm (dλ=1).
-
integration is a
stringthat lets the user choose integration mode. Trapezoidal integration (integration = 'trapz') is used by default. Simpson's rule (integration = 'simpson') can also be used. Returns a list containing of floats containing the calculated in vitro SPF values.
This function is used to perform the calculations regarding adjusted in vitro SPF; either the coefficient of adjustment C of reading against an in vivo SPF value and/or to adjust the measurements in vitro SPF. User should be careful when inputting data for mode and values parameters, as they are dependent on each other.
SPFadj = pppy.adjspf(data, mode, values, parameters*, integration, batch)
- data is an array containing the absorbance before UV exposure, where rows correspond to each read measured from 290 to 400 nm (dλ=1).
-
mode is a
string: use'calc'to determine C given absorbances values; use'adj'to adjust in vitro SPF to (a) given C value(s) and; use'all'to compute C and used to compute the adjusted in vitro SPF. -
values float or array: in
'calc'mode input the in vivo or expected SPF value(s); in'adj'input the C value(s) to use and; for'all'mode input the in vivo or expected SPF value(s). -
integration is a
stringthat lets the user choose integration mode. Trapezoidal integration (integration = 'trapz') is used by default. Simpson's rule (integration = 'simpson') can also be used. -
batch is a bolean (
batch = Trueorbatch = False).Trueby default. If true, will determine C or SPF of all data samples against a single in vivo/expected SPF or C value. If false, will require user to input and array with values for each sample. -
parameters an array (*optional): Δλ and number of iterations can be modified for iterative calculations needed to determine C as
parameters = [Δλ, iterations]. Defaults is Δλ=1·10-5 and iterations=1.5·105. Returns the determined C value(s) and/or adjusted calculated in vitro SPF value(s).
Calculate initial UVA protection factor before UV exposure (UVA-PF0) or UVA protection factor after UV exposure (UVA-PF).
UVA_PF0 = pppy.uvapf(data, C, integration, batch)
UVA_PF = pppy.uvapf(data, C, integration, batch)
- data is an array obtaining the absorbance before and after UV exposure, where rows correspond to each read measured from 320 to 400 nm (dλ=1), however, it is important to know that if given an array from 290 to 400 nm (dλ=1), the function will crop it automatically.
- C value: input the C value(s) computed before using the adjspf module.
-
integration is a
stringthat lets the user choose integration mode. Trapezoidal integration (integration = 'trapz') is used by default. Simpson's rule (integration = 'simpson') can also be used. -
batch is a bolean (
batch = Trueorbatch = False).Trueby default. If true, will determine C or SPF of all data samples against a single in vivo/expected SPF or C value. If false, will require user to input and array with values for each sample. Returns the UVA-PF0 or UVA-PF values.
Determine UV exposure dose in J/cm2 given UVA-PF0 value(s).
UVexposuredose = pppy.uvadose(UVA-PF<sub>0</sub>)
Returns a float or array of floats that contains the UV exposure dose.
This function is used to calculate the Critical Wavelength (𝜆c) of the sunscreen formula. The criticalwave function performs iterations until in founds the 𝜆c. It requires the absorbance of after UV exposure.
CW = pppy.criticalwave(data, integration)
- data is an array containing the absorbance after UV exposure, where rows correspond to each read measured from 290 to 400 nm (dλ=1).
-
integration is a
stringthat lets the user choose integration mode. Trapezoidal integration (integration = 'trapz') is used by default. Simpson's rule (integration = 'simpson') can also be used.