Skip to content

4. Demo

Santiago Guerrero-Higareda edited this page Apr 2, 2025 · 22 revisions

Two absorbance measurements (A1 and A2) of the same 15 SPF sunscreen will be used for this demo (demo_beforeUVexposure.csv and demo_afterUVexposure.csv).

  1. First download the files and import the module
import photoprotectionpy as pppy
import numpy as np
import pandas as pd
  1. Import the data from the csv file
data_before = np.array(pd.read_csv('demo_beforeUVexposure.csv'))
data_after = np.array(pd.read_csv('demo_afterUVexposure.csv'))
  1. Initial in vitro SPF with the ispf module
SPFi = pppy.ispf(data_before)

This results in an SPFiA1 = 15.7895 and SPFiA1 = 15.3814.

  1. C value determination with the adjspf module
C = pppy.adjspf(data_before, mode = 'calc', values = [15], batch = True)

Or, if batch = false:

C = pppy.adjspf(data_before, mode = 'calc', values = [15, 15], batch = False)

This results in CA1 = 0.9809 and CA2 = 0.9905.

  1. UVA-PF0 determination with uvapf module
UVA_PF0 = pppy.uvapf(data_before, C = [0.9809, 0.9905])

This results in UVA-P0, A1 = 5.3485 and UVA-P0, A2 = 5.3664.

  1. UV exposure dose with uvdose
UVdose = pppy.uvdose([5.3485, 5.3664])

This results in a UVdoseA1 = 6.4183 J/cm2 and UVdoseA2 = 6.4397 J/cm2.

  1. UVA-PF after UV exposure
UVA-PF = pppy.uvapf(data_after, C = [0.9809, 0.9905])

This results in UVA-PFA1 = 5.1629 and UVA-PFA2 = 5.1801.

  1. Determination of Critical Wavelength (𝜆c)
CW = criticalwave(data_after)

This results in a 𝜆c, A1 = 376 and 𝜆c, A2 = 376.

Clone this wiki locally