MagicForrest / DGVMTools

R package for processing, analysing and visualising ouput from Dynamic Global Vegetation Models (DGVMs)
GNU General Public License v3.0
26 stars 22 forks source link

Masking out a specific elevation in DGVMTools. Possible? #26

Closed halima1993 closed 4 years ago

halima1993 commented 5 years ago

Hello Matthew, hope you are fine.

I have a tiff file of approx 1.87GB, ranging from an elevation of -27m to 9000m. Is there any possible way of masking those areas that are above 6000m in DGVMTools? (If i want to use the plotSpatial() command with any outputfile those areas above 6000m elevation come blank). Is this possible in this package?

MagicForrest commented 5 years ago

Hi Halima, all good here :-)

To answer your question, the package won't directly deal with your large tiff file since it is not a standard format read by the package. I suggest using other tools, such as the R raster package or GDAL to process it. The idea would be to average the resolution to half degree and then get a list of gridcells (on your half degree resolution) that are under 6000m.

Then, once you have a list of gridcells that you want, you can use the selectGridcells() function in DGVMTools to select the LPJ-GUESS gridcells from you Field object that you want for your plotting.

I have one question for you. Since I am soon going to be preparing a publication about DGVMTools, it would be good to know for the cover letter where exactly the users are. May I ask where you are based? If you are uncomfortable putting that information on this public page, feel free to email me. Thanks!