This must be possible but I am unsure as to how to approach it.
I have a geographical domain, with a set number of lat and lons. Using these, I am able to plot a simple Basemap of the domain:
fp_mhd = name.footprints('path/to/file')
domain_lon = fp_mhd.lon
domain_lat = fp_mhd.lat
### Construct Basemap ###
m = Basemap(resolution='c',projection='gall',
llcrnrlat=(np.min(domain_lat)),
urcrnrlat=(np.max(domain_lat)),
llcrnrlon=(np.min(domain_lon)),
urcrnrlon=(np.max(domain_lon)))
What I need is someway of distinguishing countries from oceans within this domain, and returning the results as an array i.e. 1s for land and 0s for ocean (though these values don't matter). The array needs to be 2-D where each point corresponds to a specific lat and lon. So say there were 100 lats and 200 lons, there would be 20000 1s and 0s. I wondered if there was some way to convert the Basemap object to an array, but failed to achieve this. Is it possible?
Thanks in advance!