REM: derivative calculation; FIX: resolution < 1 pixel