S4C L4A CropType error - no mean-sar.csv

Hi,s

I am trying to run a custom job for L4A Crop type. I have the L3B products and they seem OK.
I need help with the following error, at the “S4CCropType” step. I am using version 2.0 of sen4cap.

Usage: merge-statistics mean.csv dev.csv mean-1.csv dev-1.csv count-1.csv […]
cut: sar-merged/mean-sar.csv: No such file or directory
cut: sar-merged/mean-sar.csv: No such file or directory
cut: sar-merged/dev-sar.csv: No such file or directory
cut: sar-merged/dev-sar.csv: No such file or directory

Attaching package: ‘arrow’

The following object is masked from ‘package:utils’:

timestamp

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

filter, lag

The following objects are masked from ‘package:base’:

intersect, setdiff, setequal, union

Loading required package: lattice
Loading required package: ggplot2
Loading required package: proto
Warning message:
no DISPLAY variable so Tk is not available
– Attaching packages --------------------------------------- tidyverse 1.3.0 –
v tibble 3.0.6 v stringr 1.4.0
v tidyr 1.1.2 v forcats 0.5.1
v purrr 0.3.4
– Conflicts ------------------------------------------ tidyverse_conflicts() –
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
x purrr::lift() masks caret::lift()

Attaching package: ‘data.table’

The following object is masked from ‘package:purrr’:

transpose

The following objects are masked from ‘package:dplyr’:

between, first, last

Error: size must be less or equal than 537 (size of data), set replace = TRUE to use sampling with replacement.
Backtrace:
x

  1. ±data_strategy2 %>% group_by(CTnumL4A) %>% sample_n(smotesize)
  2. ±dplyr::sample_n(., smotesize)
  3. ±dplyr:::sample_n.data.frame(., smotesize)
  4. | ±dplyr::slice(…)
  5. | -dplyr:::slice.data.frame(…)
  6. | -dplyr:::slice_rows(.data, …)
  7. | -mask$eval_all(quo)
  8. ±rlang:::sample.int(…)
  9. ±base::sample.int(…)
  10. -dplyr:::check_size(smotesize, n(), replace = replace)
  11. -dplyr:::bad_args(…)
  12. \-dplyr:::glubort(fmt_args(args), ..., .envir = .envir)
    

Execution halted
Traceback (most recent call last):
File “/usr/bin/crop-type-wrapper.py”, line 364, in
main()
File “/usr/bin/crop-type-wrapper.py”, line 328, in main
run_command(command)
File “/usr/bin/crop-type-wrapper.py”, line 24, in run_command
raise RuntimeError(“Command {} failed with exit code {}”.format(cmd_line, result))
RuntimeError: Command crop_type.R /mnt/archive/orchestrator_temp/s4c_l4a/2595/21404-product-formatter// 0 /mnt/archive/orchestrator_temp/s4c_l4a/2595/21403-s4c-crop-type/features/optical-features.ipc /mnt/archive/orchestrator_temp/s4c_l4a/2595/21403-s4c-crop-type/features/optical-features-re.ipc 0 /mnt/archive/orchestrator_temp/s4c_l4a/2595/21402-s4c-l4a-extract-parcels/parcels.csv CTnumL4A 1234 Area_meters 3 1 30 10 1500 500 0.25 0.75 Smote 1000 5 300 10 /mnt/archive/orchestrator_temp/s4c_l4a/2595/21402-s4c-l4a-extract-parcels/lut.csv failed with exit code 1

Thank you!
Stefan

Hello again,

Since the names of the missing files suggest some problems with extracting some parameters from s1 data, I ran L4A with s2-only and it finished.

Where must I start looking to correct the error regarding the SAR data?

Best wishes,
Stefan

Hi,

I also tried the solution described in lnicola’s post:
No predicted classes created in L4A processor

Unfortunately, I still get the error with the missing SAR data statistics.

I also tried changing the number of minimum and maximum parcels and got the following error:
Usage: merge-statistics mean.csv dev.csv mean-1.csv dev-1.csv count-1.csv […]
cut: sar-merged/mean-sar.csv: No such file or directory
cut: sar-merged/mean-sar.csv: No such file or directory
cut: sar-merged/dev-sar.csv: No such file or directory
cut: sar-merged/dev-sar.csv: No such file or directory

Attaching package: ‘arrow’

The following object is masked from ‘package:utils’:

timestamp

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

filter, lag

The following objects are masked from ‘package:base’:

intersect, setdiff, setequal, union

Loading required package: lattice
Loading required package: ggplot2
Loading required package: proto
Warning message:
no DISPLAY variable so Tk is not available
– Attaching packages --------------------------------------- tidyverse 1.3.0 –
v tibble 3.0.6 v stringr 1.4.0
v tidyr 1.1.2 v forcats 0.5.1
v purrr 0.3.4
– Conflicts ------------------------------------------ tidyverse_conflicts() –
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
x purrr::lift() masks caret::lift()

Attaching package: ‘data.table’

The following object is masked from ‘package:purrr’:

transpose

The following objects are masked from ‘package:dplyr’:

between, first, last

Error in subset(X, target == names(which.min(n_target)))[sample(min(n_target)), :
incorrect number of dimensions
Calls: SMOTE
Execution halted
Traceback (most recent call last):
File “/usr/bin/crop-type-wrapper.py”, line 364, in
main()
File “/usr/bin/crop-type-wrapper.py”, line 328, in main
run_command(command)
File “/usr/bin/crop-type-wrapper.py”, line 24, in run_command
raise RuntimeError(“Command {} failed with exit code {}”.format(cmd_line, result))
RuntimeError: Command crop_type.R /mnt/archive/orchestrator_temp/s4c_l4a/2614/21466-product-formatter// 0 0 0 0 /mnt/archive/orchestrator_temp/s4c_l4a/2614/21464-s4c-l4a-extract-parcels/parcels.csv CTnumL4A 1234 Area_meters 0 1 30 10 1000 400 0.25 0.75 Smote 200 5 300 10 /mnt/archive/orchestrator_temp/s4c_l4a/2614/21464-s4c-l4a-extract-parcels/lut.csv failed with exit code 1