#Load code: workpiece:
      lonmin <- work_piece[['lon_limits']][1]
      lonmax <- work_piece[['lon_limits']][2]
      latmin <- work_piece[['lat_limits']][1]
      latmax <- work_piece[['lat_limits']][2]


lon_indices <- 1:length(lon)
if (!(lonlat_subsetting_requested && remap_needed)) {
    lon[which(lon < 0)] <- lon[which(lon < 0)] + 360
}
if (lonmax >= lonmin) {
     lon_indices <- lon_indices[which(((lon %% 360) >= lonmin) & ((lon %% 360) <= lonmax))]
} else if (!remap_needed) {
     lon_indices <- lon_indices[which(((lon %% 360) <= lonmax) | ((lon %% 360) >= lonmin))]
}
lat_indices <- which(lat >= latmin & lat <= latmax)

# ex 1
lon <- -10:10
lon[which(lon < 0)] <- lon[which(lon < 0)] + 360
lon


