Updated version of SOM script - Loop over different grid sizes