[ncl-talk] Masking within a shapefile Polar Stereographic projection

Stavros Dafis sdafis at cc.uoi.gr
Wed Oct 18 04:33:06 MDT 2017


Dear NCL users,

I have a set of netcdf files with snow, land and sea variables and the
projection is Polar Stereographic ellipsoidal (WGS-84 ellipsoid). I have
plotted an example remapped to a Mercator projection:
https://ibb.co/mFZAd6

I would like to mask the data only inside the shapefile of Greece, but I cannot
figure out why the "shapefile_mask_data" keeps the wrong values. This is what I
get:
https://ibb.co/iyBZ5m

How is it possible to cut the values in another projection than the initial?

This is part of the code for masking:

shp_filename1 = "/data/dafis/Greek_shape/GRC_adm1.shp"    ; State outlines

  opt             = True
  ;opt at delta_kilometers  = 2
  ;opt at minlat      = minlat
  ;opt at maxlat      = maxlat
  ;opt at minlon      = minlon
  ;opt at maxlon      = maxlon
  opt at debug       = True
  opt at shape_var   = "NAME_0"
  opt at shape_names = "Greece"
  ;opt at return_mask = True
  opt at keep        = True

 snow_mask = shapefile_mask_data(snow,shp_filename1,opt)

The whole procedure takes 5 minutes for one day and I have 6205 days to compute.
I read in this thread that is normal to take so long to run, due to the complex
coastline:
https://www.ncl.ucar.edu/Support/talk_archives/2014/0728.html

Any suggestions? The opt at minlat/lon etc does not help to plot faster.

Has anyone succeeded in speeding up the procedure or do you know where I can
find coarse shapefiles for countries since I mostly care about excluding the
neighbor countries and not the sea.


-- 
Stavros NTAFIS (DAFIS)
-----------------------------------------------
Physicist - Meteorologist, M.Sc.
Ph.D. Candidate, Polytechnic School of Paris, France
Laboratory of Dynamic Meteorology (LMD)
Research Associate, National Observatory of Athens
Tel. : (+33)9 81 94 22 12
Mobile: (+33) 066 030 0147
(+30) 697 04 20 242
---------------
Weather charts:
http://www.meteo.gr
http://www.meteo.gr/meteomaps/





More information about the ncl-talk mailing list