Creating a mask

384 views
Skip to first unread message

BEZENG

unread,
May 23, 2013, 3:31:54 AM5/23/13
to max...@googlegroups.com
Hi Guys,


I have just created a mask in AcrGis to crop my projections to my extent of study but im having a problem getting it to run.

 I used one of the future bioclimatic variable i.e bio 1 to create the mask and after creating the mask i copied and paste the new mask in both the current and future environmental variables. 

When I run the maxent with this mask it keeps giving me this error message "mask have different geographic dimensions"

I did same by creating a mask now with the current layer and i still get the same error message.


Any suggestions on how i can go about this? Please
 
BEZENG BEZENG S.
African Centre for DNA Barcoding,
Department of Botany & Plant Biotechnology,
University of Johannesburg,
P.O.Box 524 Auckland Park South Africa
Tell: 0027 11 559 2495
Fax: 0027 11 559 2411
Mobile: 0027 73 810 4350




John Baumgartner

unread,
May 23, 2013, 4:07:36 AM5/23/13
to maxent

How did you create the mask?

To have Maxent produce *clipped* grids, you need to provide clipped predictor grids (i.e. All of them must be clipped) in the projection directory. A mask grid is used to prevent Maxent from predicting to particular cells (those with NA value), but does not alter the extent of the projections. With default settings, a mask grid used during model fitting (cf protection) will also prevent background from being sampled from NA cells.

--
You received this message because you are subscribed to the Google Groups "Maxent" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maxent+un...@googlegroups.com.
To post to this group, send email to max...@googlegroups.com.
Visit this group at http://groups.google.com/group/maxent?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

BEZENG

unread,
May 23, 2013, 4:25:32 AM5/23/13
to max...@googlegroups.com
Hi John,


So do i have to create a mask for each of the bioclimatic variables for both current and future?


What i did was, i created one mask and then used it for both current and future projections.





BEZENG BEZENG S.
African Centre for DNA Barcoding,
Department of Botany & Plant Biotechnology,
University of Johannesburg,
P.O.Box 524 Auckland Park South Africa
Tell: 0027 11 559 2495
Fax: 0027 11 559 2411
Mobile: 0027 73 810 4350




John Baumgartner

unread,
May 23, 2013, 4:28:32 AM5/23/13
to maxent

Right, but what did you do to create a mask, and what is your aim, exactly?

Do you want to generate projections that are limited to a clipped extent (do you want the grids that Maxent produces to be clipped to a smaller extent?). If so, then how you fit the model is irrelevant (but you should still consider whether the region your background will be sampled from is appropriate). You just need to clip all your predictor grids to your desired extent, and point Maxent to their containing folder for protection. No mask grids are required.

BEZENG

unread,
May 23, 2013, 4:39:49 AM5/23/13
to max...@googlegroups.com
What i want maxent to do is generate projections to the clipped extent (i.e study region).


So to generate the mask i clipped the environmental variable to the extent of my study area, then using the spatial analyst tool>map algebra >raster calculator , i then assigned all areas out of my extent to be 0 and finally reclassified my raster.


BEZENG BEZENG S.
African Centre for DNA Barcoding,
Department of Botany & Plant Biotechnology,
University of Johannesburg,
P.O.Box 524 Auckland Park South Africa
Tell: 0027 11 559 2495
Fax: 0027 11 559 2411
Mobile: 0027 73 810 4350




John Baumgartner

unread,
May 23, 2013, 5:20:17 AM5/23/13
to max...@googlegroups.com
Ok I don't fully understand what you've done, but you have two options:

Firstly (regardless of which path you follow below), prepare your enviro grids such that they are whatever size you want for model-fitting. They all need to have identical extents. (I'm assuming here that you're not using SWD format for model-fitting, and that rather you are allowing Maxent to sample the background for you, from your grids, and to extract predictor values at your occurrence localities.) The extent of your grids will influence your background sample, i.e. background will be sampled from all cells that have data for all predictor grids (in other words, if you have any predictors that have NA for a particular cell, then that cell will not be permitted in the background sample -- this is the key idea to masking, which I'll mention below). 

Now, you can either: 

(1) create a mask grid, which will determine both (a) where background can be sampled from (during model-fitting), and (b) where predictions should be made (during model-projection). Note that the mask grid used during model-fitting must be identical in extent to your predictors used during model-fitting, and that your mask grid used during model-projection must be identical in extent to the predictors used for projection. Mask grids should have some constant value (e.g. 1) at cells that you want included in your background (model-fitting) and that you want to project to (model-projection). Cell that you don't want included in background, or that you don't want to project to, should be set to NA. You can create two different mask grids for this purpose. For example, if you want background to be able to drawn from the entire larger initial extent of your predictor grids, then you can set all cells of the model-fitting mask grid to have values of 1. If you want to project to just a smaller sub-region of your enviro grids, you can set your mask grid such that all cells that you don't want to project to, to NA. The values of these cells in the projection grid that Maxent generates will be NA. There are a couple of reasons why you might want to do things this way (rather than clipping all the enviro grids for projection)... it can save you grid-processing time (you already have the predictor grids at the larger extent), but more importantly, sometimes you want to restrict your predictors to non-rectangular bounds, so clipping doesn't quite achieve what you're after.

or...

(2) Forget about a mask. Clip all your enviro grids such that they are at the extent that you want to project to. Point Maxent to the folder that contains these clipped grids. They must all be identical in extent. (note that if it makes sense for your background to also be restricted to this clipped region, then you should provide these clipped grids during model-fitting as well, instead of the grids with larger extent.)

The tutorial is a good place to start. Available at http://www.cs.princeton.edu/~schapire/maxent/

BEZENG

unread,
May 23, 2013, 5:42:08 AM5/23/13
to max...@googlegroups.com
Many thanks for this!!

Have a great day ahead


BEZENG BEZENG S.
African Centre for DNA Barcoding,
Department of Botany & Plant Biotechnology,
University of Johannesburg,
P.O.Box 524 Auckland Park South Africa
Tell: 0027 11 559 2495
Fax: 0027 11 559 2411
Mobile: 0027 73 810 4350




Christopher Ilori

unread,
May 23, 2013, 1:31:58 PM5/23/13
to max...@googlegroups.com
Check you spatial scale for the different data sets.


tmlehman

unread,
Mar 10, 2016, 10:37:44 PM3/10/16
to Maxent
Hello. I have done what you suggested below, at least if I understand you correctly I did, and I am not receiving an error but only 3 of my points are being used by MaxEnt when I am using a bias file, 12 when I use another bias file but still not all of my sample points. I do not have this problem without the bias file so I am guessing it has something to do with the bias file. The spatial extent, coordinate system, and cell size of my bias files are the same as my environmental variables. I am using the bias file option within the advanced tab in the MaxEnt parameter interface to upload my file to MaxEnt. Does anyone have any ideas why the bias file could be causing this issue or how to fix it?

Thank you! 
Reply all
Reply to author
Forward
0 new messages