|
Matlab functions I think might be most helpful to others I have shared via
my
Matlab FileExchange page. The most popular are given here too.
Additionally, you can browse
and download
all the custom functions and scripts I use on my homepage at the GIS Department
of the University of Zurich. These get updated on a more or less regular basis.
No guarantee they work for you... Glad for feedback, though...
Gaussian Convolution Filter
Filter
to introduce spatial autocorrelation while keeping original distribution.
Developed using MATLAB Release: R2006a
Simple script to apply a gaussian convolution filter to a matrix (e.g. of
white noise) to introduce spatial correlation while (generally) preserving
the original distribution.
Based on the approach of spatial moving averages according to:
Oksanen, J and Sarjakoski, T 2005: Error propagation analysis of DEM-based
drainage basin delineation. International Journal of Remote Sensing 26 (14),
3085-3102 [DOI]
Note: Distribution is not preserved exactly. Approach is
valid for equidistant matrices of values that are the result of a gaussian
process. Mean and standard deviation of a distribution will only be kept if
the mean is 0! If you need a different mean, add it after filtering! Please
read the help/inline comments.
DOWNLOAD
GaussianConvolutionFilter
Hillshade
Script to calculate a hillshade for a DEM (matrix). Developed using MATLAB
Release R2006b
Function to calculate hillshade for a digital elevation model. Derives slope
and aspect in radias to calculate shading value between 0 and 255 using a
given lighting angle and altitude.
Altitude (angle above ground) and angle (direction/aspect) of lightsource
can be given via args.
Derived using ESRIs hillshade algorithm, but uses simple GRADIENT function
instead of Horns algorithm for slope calculation - this makes the script the
factor 30 more efficient & no need for the Matlab image processing toolbox.
(Thanks to Andrew Stevens)
DOWNLOAD
Hillshade
Solar Radiation
Script to calculate solar radiation for a DEM based on the direct, reflected
and diffuse solar radiation a gridcell location within a DEM receives over
one year. Calculated insolation is calculated depending on the latitude, time
of year and hour of day, slope and aspect as well as elevation, and ground
reflectance, which can be set to a global value or input as a map. Solar radiation
is integrated over the calculated daylength (sun hours) and the year, but
integration time can be varied.
Approach following the one described by Kumar et al:
Kumar, L., Skidmore, A. K. & Knowles, E. 1997: Modelling topographic
variation in solar radiation in a GIS environment. International Journal of
Geographical Information Science 11 , 475-49 [DOI]
DOWNLOAD
Solarradiation
IPCC2mat
Function that imports Intergovernmental Panel on Climate Change (IPCC) climate
observation data (www.ipcc-data.org/obs/)
in their ASCII .dat format into Matlab, using a 3D matrix. Data can optionally
be rotated during import for proper viewing.
Nodata value (-9999) in the observations are replaced with NaN.
Header information is passed back to Matlab as a cell.
DOWNLOAD
IPCC2mat
MeltPDD
Simple temperature index model to calculate melt rates in meter water equivalent
per year for a digital elevation model (DEM), based on positive degree days
factor (PDD) using seasonal variation.
User can specify factors: mean annual temperature, PDD, seasonal variation
in degrees and year length.
Approach following Marshall, SJ and Clarke, GKC 1999: Ice sheet inception:
subgrid hypsometric parameterization of mass balance in an ice sheet model.
Climate Dynamics 15:533-550
Does not include different PDDs for ice and snow yet, nor does it consider
refreezing etc yet.
DOWNLOAD
MeltPDD
|