Subject: Marine Geospatial Ecology Tools (MGET) help
Text archives
From: | "Jason Roberts" <> |
---|---|
To: | <> |
Cc: | <> |
Subject: | RE: [mget-help] Trouble with Predict GAM from Rasters tool |
Date: | Wed, 21 Mar 2012 20:43:38 -0400 |
Hi Roxanne,
We're glad you've enjoyed MGET so far and sorry you're having trouble with
the prediction tool. I should be able to help you get it working.
The prediction tool works by iterating through each cell of the rasters. At
each location, it extracts the value of each raster and sends them through
the fitted statistical model which estimates the value of the response
variable. In order for this to work, the tool must have one raster for each
predictor variable in the model, and they must all have the same coordinate
system, cover the same spatial extent, have the same cell size. Of those
three conditions are true, they will have the same number of rows and
columns, and those will all be exactly lined up with each other.
But it is almost always the case that the predictor rasters that people
start with do not have matching characteristics (coordinate system, extent,
and cell size). The rasters come from different satellite sensors that have
different resolutions, etc. The tool cannot use these in their original form
because the rows and columns do not match up.
In early versions of this tool, we required users to provide rasters that
had matching characteristics. You would have to reproject or resample the
rasters so they exactly matched. This was a tedious chore so we tried to
automate it. We thought it would be relatively easy but it has proven
surprisingly difficult. The main problem is that ArcGIS does not provide
tools that reliably clip rasters to the expected extent. It often clips
things one cell too large or one cell too small. We tried to work around
that with some programming tricks but it is not always successful.
I would recommend you try these steps:
1. If you are running an old version of MGET (older than 0.8a36), upgrade to
the latest one. (Uninstall the existing one, then install the new one). If
you are running 0.7 then it is possible than upgrading to this latest one
will solve the problem, as many improvements have been made to this
automation since 0.7. If your version is fairly old (older than six months
or so), then you should check your ArcGIS geoprocessing models carefully,
because some parameters have changed. Sadly, this will often break the
models.
2. Check that the raster that is serving as the "template raster" has a
smaller spatial extent than the others. You can explicitly designate a
template raster (there is a parameter for it); if you do not, then the first
predictor raster is used as the template. The template defines the
coordinate system, extent, and cell size of the outputs. The tool tries to
reproject and clip all of the predictor rasters to this template, prior to
performing the prediction. This begs the question: why does the template
need to be smaller than all the rest? Because if it was bigger than one, it
means that one does not have any data part of the area that you want to
perform predictions. It is not possible to perform predictions except in the
spatial extent where all of the rasters overlap.
3. If #1 and #2 above are satisfied and you still get an error, please turn
on verbose logging (see
http://code.env.duke.edu/projects/mget/wiki/Configuring%20MGET%20logging),
reproduce the problem, and send me the complete output. I will help you fix
the problem.
One final thing: you mentioned you fitted a GLM but then tried to use the
Predict GAM From Rasters tool. For GLMs, you should use the Predict GLM From
Rasters tool. (I assume you mis-typed something, because the tool is
supposed to catch this problem. But if it has not, please check that you are
using the Predict tool that matches the Fit tool that you used.)
Best,
Jason
-----Original Message-----
From:
[mailto:]
Sent: Wednesday, March 21, 2012 6:11 PM
To:
Subject: [mget-help] Trouble with Predict GAM from Rasters tool
Good Afternoon,
I am using the Marine Geospatial Ecology Tool to create a habitat
suitability model for the Galapagos Islands. I have been following the steps
from the Webinar given by Jason Roberts, however, I am having some
difficulty with the last step. I chose to run a Generalized Linear model for
my data, which consist of a Bathymetry DEM for the Galapagos, satellite
images for chlorophyll a, sea surface temperature and current speed. Two of
the layers (SST and Chla) were interpolated using a Universal kringing to
calculate some missing values which were close to the coast. I ran the model
and received a file which I used as my input model file for the Predict GAM
from rasters tool. My problem comes in here; I can not get the tool to work.
I have gotten error messages stating that the Chla layer can not be
projected even though I have checked and the Chla and the other layers are
in the same projection. I have also tried making each layer the same size.
When I tried this approach, I received a new message saying that all the
predictor rasters must have the same number of rows and columns. This would
be impossible for me since all my layers were retrieved from different
satellites, each one having a different resolution.
I really need some advice on how to rectify this problem. This toolbox has
helped me immensely so far, I would like to see and finally finish my model.
Best regards
Roxanne Duncan
We're glad you've enjoyed MGET so far and sorry you're having trouble with
the prediction tool. I should be able to help you get it working.
The prediction tool works by iterating through each cell of the rasters. At
each location, it extracts the value of each raster and sends them through
the fitted statistical model which estimates the value of the response
variable. In order for this to work, the tool must have one raster for each
predictor variable in the model, and they must all have the same coordinate
system, cover the same spatial extent, have the same cell size. Of those
three conditions are true, they will have the same number of rows and
columns, and those will all be exactly lined up with each other.
But it is almost always the case that the predictor rasters that people
start with do not have matching characteristics (coordinate system, extent,
and cell size). The rasters come from different satellite sensors that have
different resolutions, etc. The tool cannot use these in their original form
because the rows and columns do not match up.
In early versions of this tool, we required users to provide rasters that
had matching characteristics. You would have to reproject or resample the
rasters so they exactly matched. This was a tedious chore so we tried to
automate it. We thought it would be relatively easy but it has proven
surprisingly difficult. The main problem is that ArcGIS does not provide
tools that reliably clip rasters to the expected extent. It often clips
things one cell too large or one cell too small. We tried to work around
that with some programming tricks but it is not always successful.
I would recommend you try these steps:
1. If you are running an old version of MGET (older than 0.8a36), upgrade to
the latest one. (Uninstall the existing one, then install the new one). If
you are running 0.7 then it is possible than upgrading to this latest one
will solve the problem, as many improvements have been made to this
automation since 0.7. If your version is fairly old (older than six months
or so), then you should check your ArcGIS geoprocessing models carefully,
because some parameters have changed. Sadly, this will often break the
models.
2. Check that the raster that is serving as the "template raster" has a
smaller spatial extent than the others. You can explicitly designate a
template raster (there is a parameter for it); if you do not, then the first
predictor raster is used as the template. The template defines the
coordinate system, extent, and cell size of the outputs. The tool tries to
reproject and clip all of the predictor rasters to this template, prior to
performing the prediction. This begs the question: why does the template
need to be smaller than all the rest? Because if it was bigger than one, it
means that one does not have any data part of the area that you want to
perform predictions. It is not possible to perform predictions except in the
spatial extent where all of the rasters overlap.
3. If #1 and #2 above are satisfied and you still get an error, please turn
on verbose logging (see
http://code.env.duke.edu/projects/mget/wiki/Configuring%20MGET%20logging),
reproduce the problem, and send me the complete output. I will help you fix
the problem.
One final thing: you mentioned you fitted a GLM but then tried to use the
Predict GAM From Rasters tool. For GLMs, you should use the Predict GLM From
Rasters tool. (I assume you mis-typed something, because the tool is
supposed to catch this problem. But if it has not, please check that you are
using the Predict tool that matches the Fit tool that you used.)
Best,
Jason
-----Original Message-----
From:
[mailto:]
Sent: Wednesday, March 21, 2012 6:11 PM
To:
Subject: [mget-help] Trouble with Predict GAM from Rasters tool
Good Afternoon,
I am using the Marine Geospatial Ecology Tool to create a habitat
suitability model for the Galapagos Islands. I have been following the steps
from the Webinar given by Jason Roberts, however, I am having some
difficulty with the last step. I chose to run a Generalized Linear model for
my data, which consist of a Bathymetry DEM for the Galapagos, satellite
images for chlorophyll a, sea surface temperature and current speed. Two of
the layers (SST and Chla) were interpolated using a Universal kringing to
calculate some missing values which were close to the coast. I ran the model
and received a file which I used as my input model file for the Predict GAM
from rasters tool. My problem comes in here; I can not get the tool to work.
I have gotten error messages stating that the Chla layer can not be
projected even though I have checked and the Chla and the other layers are
in the same projection. I have also tried making each layer the same size.
When I tried this approach, I received a new message saying that all the
predictor rasters must have the same number of rows and columns. This would
be impossible for me since all my layers were retrieved from different
satellites, each one having a different resolution.
I really need some advice on how to rectify this problem. This toolbox has
helped me immensely so far, I would like to see and finally finish my model.
Best regards
Roxanne Duncan
Archives powered by MHonArc.