Skip to content

SelBox() for selecting a region that crosses the 180ºE/W meridian?

Hi @nperez,

I've been selecting different regions using SelBox(), and I need some regions (for example the Southern Ocean, or the Pacific Ocean) for which longitudes extend on both sides of the 180ºE/W meridian. I noticed that SelBox() doesn't handle the longitudes correctly in this specific case.

For example:

lat_regd <- SelBox(trace_ano_obs_weight,lons,lats,c(100,-90,-60,-45),6,5)$lat
lon_regd <- SelBox(trace_ano_obs_weight,lons,lats,c(100,-90,-60,-45),6,5)$lon
latmin <- lat_regd[length(lat_regd)]
latmax <- lat_regd[1]
lonmin <- lon_regd[1]
lonmax <- lon_regd[length(lon_regd)]

print(latmin)
print(latmax)
print(lonmin)
print(lonmax)

Returns:

-59

-45

-179

179

So it's actually extracting the full range of longitudes from 179ºW to 179ºE...

Could you please have a look at this so that I can select regions that lie across the 180º meridian?

Thanks,

Deborah

Edited by dverfail