Calculation of the solar fluxes outside of the loop (same for all pixels)
Correction of ozone/water scattering and O3_SICE calculation is now done as matrix operation
Calculation of all geometrical parameters, atmospheric and clean snow characteristics (among which D and r0) done as matrix operation
Calculation of the polluted snow characteristics done on per-pixel basis (needs iterative solver) but optimized using numpy.vectorize
Calculation of planar and spherical albedos done as matrix operation
Bands for which the retrieval was failing were previously linearly interpolated using the neighboring bands, these cases are now left as NaN
Integration of spectral albedo over three intervals (among which SW for BBA) done on pixel basis but optimized using numpy.vectorize
The new script is now between 1.25 and 5 times faster.
Note that the slow part of the script is when solving for dark pixels. Applying a land/ocean mask at the scene level would speed up even more the script. At the moment land/ocean masking is done in dm.sh after sice.py was run. Once the cloud mask comes from idepix, we can run sice 1x/day rather than 1x/scene (see #19).
On the equations that are being used, the major update is that the BBA calculation for polluted snow now uses the BOA reflectance instead of the TOA reflectance as in the previous version. Alex updated that in the fortran code in December. Expect different performance at the PROMICE stations.
Also updated: All GRASS "permanent" folders to be on " ~ " instead of "." directory:
When using a virtualbox and running SICE on a folder shared between host/guest, there are permission issues although bash and python scripts can create/delete files without problem. Changing that folder location solved it.
On the optimization, the major updates are:
Note that the slow part of the script is when solving for dark pixels. Applying a land/ocean mask at the scene level would speed up even more the script. At the moment land/ocean masking is done in dm.sh after sice.py was run. Once the cloud mask comes from idepix, we can run sice 1x/day rather than 1x/scene (see #19).
On the equations that are being used, the major update is that the BBA calculation for polluted snow now uses the BOA reflectance instead of the TOA reflectance as in the previous version. Alex updated that in the fortran code in December. Expect different performance at the PROMICE stations.
Also updated: All GRASS "permanent" folders to be on " ~ " instead of "." directory: When using a virtualbox and running SICE on a folder shared between host/guest, there are permission issues although bash and python scripts can create/delete files without problem. Changing that folder location solved it.