Error -166: RHOAM_LONG

Post Reply
mark1
Posts: 4
Joined: Tue Nov 21, 2017 5:15 pm

Error -166: RHOAM_LONG

Post by mark1 »

Hi,

I'm using acolite to correct Sentinel-2 imagery and it keeps failing with the error: Error -166: RHOAM_LONG when I try subsetting. It works fine without subsetting the scene with the same settings file.

For the old-style Sentinel-2 images it would be much better if I could subset as I'm only interested in small regions. I've tried with either "subscene_eps" or "eps_full" selected but neither choice made a difference. I'm running version 20170718 on a Fedora24 machine. Snippet of terminal output follows:

% Loaded DLM: JPEG2000.
0 11214
0 11172
0 11214
0 11172
0 11214
0 11172
epsilon= 1.17878
% ACOLITE_AC: Processing subtile 1 of 16 from granule 1 of 1 that covers the requested crop.
% ACOLITE_AC: Resampling a/c bands.
% ACOLITE_AC: Processing subtile 2 of 16 from granule 1 of 1 that covers the requested crop.
% ACOLITE_AC: Processing subtile 3 of 16 from granule 1 of 1 that covers the requested crop.
% ACOLITE_AC: Processing subtile 4 of 16 from granule 1 of 1 that covers the requested crop.
Error -166: RHOAM_LONG.

Thanks,
Mark
quinten
Posts: 1021
Joined: Tue Mar 03, 2015 8:13 am

Re: Error -166: RHOAM_LONG

Post by quinten »

Hi Mark

Could you send me your complete settings file? This is probably an error related to one of the epsilon/aerosol reflectance settings. (I don't think I tested all combinations in the latest release.)

Quinten
mark1
Posts: 4
Joined: Tue Nov 21, 2017 5:15 pm

Re: Error -166: RHOAM_LONG

Post by mark1 »

Hi Quinten,

Thanks for the prompt reply. Settings file is below.

Cheers,
Mark

Code: Select all

;; ACOLITE Settings
version=20170718.0

;; Inputfile (imgdir=)
;; Landsat: input file directory or MTL file
;; Sentinel: .SAFE file or granule
imgdir=/tmp/S2A_MSIL1C_20170525T112121_N0205_R037_T30UVA_20170525T112434.SAFE/

;; limit = ROI bounding box lat1,lon1,lat2,lon2 (decimal degrees)
limit=49.56,-4.44,50.54,-2.8

;; stitch
;; combine different granules in the L1C file covering the region (Sentinel-2)
;; currently only within the same UTM zone 
stitch=0

;; Output directory
output=/tmp/

;; RGB processing
;; Output RGB images: Top Of Atmosphere or Rayleigh Corrected
rgb_toa=0
rgb_rco=0
;; Pansharpen the RGB images
rgb_pan=0
;; Output RGB geotiff
rgb_geotiff=0
;; Keep the intermediate RGB NetCDF file
rgb_keep=0
;; Auto range for the RGB maps (1 and 99 percentiles per band)
rgb_autorange=0
;; Scaling function for the RGB maps
;; 0: linear, 1: log, 2: asinh, 3: sqrt
rgb_scale=0
;; Lower limits for scaling of the reflectance in the RGB channels
rliml_r=0.00000
rliml_g=0.00000
rliml_b=0.00000
;; Upper limits for scaling of the reflectance in the RGB channels
rlim_r=0.150000
rlim_g=0.150000
rlim_b=0.150000

;; L2 processing
;; Products: output L2 parameters, comma separated
products=rrs_vnir

;; Output format
;; gridfile: data file output format
;;  1 NetCDF3 single file
;;  2 NetCDF3 file per parameter
;;  3 NetCDF3 file per parameter type
;;  4 NetCDF4 single file, compressed
;;  5 NetCDF4 file per parameter, compressed
gridfile=4
;; geotiff: also output datasets in GeoTIFF format
geotiff=0
;; scaled_geotiff: write integerised (offset -0.1, scale 0.00002) rather than float GeoTIFF files
scaled_geotiff=0

;; Map = output PNG maps
map=0

;; export_kmz: export PNG in Equirectangular projection with KML in a KMZ file for use in Google Earth
export_kmz=0
;; proj: use UTM projection information to add geolocation on maps
proj=1
;; ext_cbar: output PNG colour bar for each output parameter
ext_cbar=1

;; scalebar options
scale=
scalebar=1
scalecol=2
scalepos=3

;; File naming
;; sname = 1 output naming base = using scene identifier
;; sname = 0 output naming base = SATELLITE_SENSOR_YYYY_MM_DD_HH_MM
scname=1

;; Aerosol correction
;; nirac: use red-NIR band atmospheric correction
nirac=0
;; aopt = use user specified alpha
aopt=0
;; user specified alpha (red/NIR water)
alpha=8.70000
;; SWIR atmospheric correction
swirac=0
;; NIR/SWIR atmospheric correction
nirswirac=1
;; Band combination for NIR/SWIR atmospheric correction: 0 = 0.8/1.6 1 = 0.8/2.2
nirswirband=0
;; epsilon: user defined default epsilon
epsilon=1.00000
;; eps_fixed: use user defined epsilon
eps_fixed=0
;; eps_full: determine full-scene median epsilon
eps_full=0
;; eps_pp: use per-pixel epsilon (SWIR bands only)
eps_pp=0
;; subscene eps: determine epsilon over the cropped subscene (for given limits)
subscene_eps=1
;; rhoam_fixed: fix the aerosol reflectance over the (sub) scene
rhoam_fixed=0
;; rhoam_percentile: percentile to determine SWIR aerosol reflectance over the (sub) scene
rhoam_percentile=50

;; Aerosol correction smoothing options
;; res_ac_bands, apply moving average filter to aerosol correction bands
res_ac_bands=1
;; res_size, size of the moving average kernel
res_size=32
;; res_dilate, dilate non-water mask before applying moving average filter
res_dilate=16
;; res_fill, fill (dilated) non-water mask with median reflectance before applying moving average filter
res_fill=1

;; options for Rayleigh correction
;; use DEM for elevation estimation
ray_dem=0
;; use input elevation / pressure / scale factor
ray_elev=0
ray_press=1013.25
ray_scale=1.00000
;; use analytical Rayleigh computation instead of 6SV
ray_analytical=0

;; gains: gains to be applied at TOA, comma separated
pahlevan_gains_l=[0.9663, 0.9874,  0.9853,  0.9938,  1.0105,  1.0370,  1.2140]
pahlevan_gains_r=[1.0146, 1.0291,  0.9949,  1.0222,  1.0141,  1.0341,  0.9957]
franz_gains_ave=[1.0185, 1.0401,  1.0073,  1.0149,  1.0000,  0.92820, 1.0000]
gain_443=1.01460
gain_483=1.02910
gain_561=0.994900
gain_655=1.02220
gain_865=1.01410
gain_1609=1.03410
gain_2201=0.995700

;; Cloud Masking
;; cld_wave: cloud masking wavelength (nm)
cld_wave=1609

;; cld_thresh: cloud masking threshold
cld_thresh=0.0215000

;; maskfile: use external mask file
maskfile=

;; maskvalue: logical and with external mask file to determine mask (-1 uses default settings, 0 ignores file)
maskvalue=0

;; Other options
;; mask_negatives: mask pixels where rhow in any VIS/NIR band < 0
mask_negatives=0

;; toa_refl=1 use USGS provided reflectances
;; toa_refl=0 use USGS provided radiances and convert to reflectance internally
toa_refl=1

;; utm_coordinates
utm_coordinates=0
quinten
Posts: 1021
Joined: Tue Mar 03, 2015 8:13 am

Re: Error -166: RHOAM_LONG

Post by quinten »

Hi Mark

I haven't been able to fix this yet, but my guess is that it is related to the NIR/SWIR atmospheric correction, possibly the resampling in combination with the subscene fixed epsilon. (Maybe also your ROI size.)

Is there a reason in particular you are using the NIR/SWIR option?
Your ROI is also very large (taking up nearly the whole tile); is there a particular reason you are not processing the full tile?

Quinten
mark1
Posts: 4
Joined: Tue Nov 21, 2017 5:15 pm

Re: Error -166: RHOAM_LONG

Post by mark1 »

Hi Quinten,

Thanks for your reply. There is no particular reason for choosing NIR/SWIR in this case (I originally tried the per-pixel SWIR option but did not get good results, so thought I'd try with the NIR/SWIR and the red-NIR options).

As for the ROI - this is one of the old style S2 images with many granules and I only want to compare against in situ data within that single granule (so don't really want the overhead of processing all the others). Passing the single granule as input to acolite gave errors, so I thought that setting the ROI to the approximate granule bounds would be a way to avoid processing all granules. Is there a way that I can just process a single granule from a multi-granule S2 scene other than using the ROI?

Thanks,
Mark
quinten
Posts: 1021
Joined: Tue Mar 03, 2015 8:13 am

Re: Error -166: RHOAM_LONG

Post by quinten »

Hi Mark

Maybe the stitching for this large ROI is causing the error. Were you able to run the SWIR per pixel option for this particular ROI?

Selecting the 30UVA granule itself from within the GRANULES folder should work, make sure you navigate into the appropriate granule folder.

I'm working on an adaptive algorithm which could perform better on your scene. Stay tuned for future developments...

Quinten
mark1
Posts: 4
Joined: Tue Nov 21, 2017 5:15 pm

Re: Error -166: RHOAM_LONG

Post by mark1 »

Hi Quinten,

Yes, I have just double checked and processing with SWIR per pixel does work OK with the ROI (as does the red-NIR option).

Thanks,
Mark
Post Reply