Secondary porosity is calculated as the difference between the total porosity (from density or neutron porosity) minus sonic porosity.