5
$\begingroup$

What is the best method of calculating the number of model grid cells (e.g. of climate models) covering a specific country? For example, if I wanted to know how many 2 degree grid cells are in the United Kingdom, how would I go about it? At present I use the mapping toolbox in matlab and add a 2 degree grid and calculate manually. Is there a better way of doing this? Any advice is appreciated.

$\endgroup$
4
  • 1
    $\begingroup$ I assume you have land mask and borders of the grids. From the whole grid loop over a rectangular shape compassing UK but no other countries and for each cell check the land mask. $\endgroup$
    – Communisty
    Jan 29, 2018 at 12:17
  • 3
    $\begingroup$ Be aware that some models use non-equirectangular grids. $\endgroup$
    – gerrit
    Jan 29, 2018 at 14:51
  • $\begingroup$ Do you have the countries outlines in matlab as a vector? Or an image? $\endgroup$ Jan 29, 2018 at 21:58
  • $\begingroup$ I would do it in a geographic information system and this question might be better answered in gis.stackexchange.com $\endgroup$
    – haresfur
    Jan 30, 2018 at 22:36

1 Answer 1

2
$\begingroup$

Here is a simple 'back of the napkin' idea for Python:

  1. Get a shapefile of the borders and use Python to create a polygon of the borders.
  2. Use mpl_toolkits to convert the climate model to X and Y coordinates
  3. Check to see if the model grid points are within the Polygon
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.