Crop type error: UnboundLocalError: local variable 'tile_extent' referenced before assignment

Hello,

We are facing some issues when executing L4A-Crop type job from the web interface of Sen4CAP.
As you know, we are using SEN4CAP v3.2

Let me explain the context.

• S1 and S2 data were preprocessed for the site
• L3B job has been done for the time period of interest
• We triggered a L4A crop type custom job

Attempt 1:
The L4A- crop type job ended in the S4Croptype step with the following error.
During this attempt, our period of interest were 6 months and were were using S1+S2 data

Traceback (most recent call last):
File “/usr/bin/crop-type-parcels.py”, line 1825, in
main()
File “/usr/bin/crop-type-parcels.py”, line 1821, in main
process_radar(args, pool)
File “/usr/bin/crop-type-parcels.py”, line 1249, in process_radar
if not tile_extent:
UnboundLocalError: local variable ‘tile_extent’ referenced before assignment
Traceback (most recent call last):
File “/usr/bin/crop-type-wrapper.py”, line 443, in
main()
File “/usr/bin/crop-type-wrapper.py”, line 264, in main
run_command(command)
File “/usr/bin/crop-type-wrapper.py”, line 25, in run_command
“Command {} failed with exit code {}”.format(cmd_line, result)
RuntimeError: Command crop-type-parcels.py -m sar -s 5 --lpis-path /leo4cap/tmp/lpis/lux_2023_test2_foi/2023 --tile-footprints /mnt/archive/orchestrator_temp/s4c_l4a/262/3190-s4c-l4a-extract-parcels/tiles.csv --radar-products /mnt/archive/orchestrator_temp/s4c_l4a/262/3190-s4c-l4a-extract-parcels/radar.csv --backscatter-compositing-months 2 failed with exit code 1

The job was in S4Croptype step when error occurred:

image

2nd attempt:
The L4A- crop type job ended in the S4Croptype step with the following error.
During this attempt, our period of interest were 6 months and were were using only S2 data

See arrow_info() for available features
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: ggplot2
Loading required package: lattice
Failed to create bus connection: No such file or directory
Warning message:
In system(“timedatectl”, intern = TRUE) :

  • running command ‘timedatectl’ had status 1*
    Loading required package: proto
    Warning message:
    *no DISPLAY variable so Tk is not available *
    – Attaching packages --------------------------------------- tidyverse 1.3.1 –
    v tibble 3.1.6 v stringr 1.4.0
    v tidyr 1.1.4 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 443, in
    main()
    File “/usr/bin/crop-type-wrapper.py”, line 389, in main
    run_command(command)
  • File “/usr/bin/crop-type-wrapper.py”, line 25, in run_command*
  • “Command {} failed with exit code {}”.format(cmd_line, result)*
    RuntimeError: Command crop_type.R /mnt/archive/orchestrator_temp/s4c_l4a/614/8684-product-formatter// 0 0 0 0 /mnt/archive/orchestrator_temp/s4c_l4a/614/8682-s4c-l4a-extract-parcels/parcels.csv CTnumL4A 1234 Area_meters 0 0 30 10 4000 1333 0.25 0.75 Smote 1000 5 300 10 /mnt/archive/orchestrator_temp/s4c_l4a/614/8682-s4c-l4a-extract-parcels/lut.csv failed with exit code 1

3rd attempt:
We did a second attempt, were we changed a little but the setup. We encountered a another error. I reported in the same issue as may be they could be somehow linked.

In this third attempt, we were using LSA data from the local repository but requests were made with SciHub datasource .
The period of interest on this attempt was 1 month.

The L4A- crop type job ended in the S4Croptype step with a different error.

Traceback (most recent call last):
File “/usr/bin/crop-type-parcels.py”, line 1825, in
main()
File “/usr/bin/crop-type-parcels.py”, line 1821, in main
process_radar(args, pool)
File “/usr/bin/crop-type-parcels.py”, line 1142, in process_radar
products = get_radar_products(args.radar_products)
File “/usr/bin/crop-type-parcels.py”, line 749, in get_radar_products
orbit_type_id = int(orbit_type_id)
ValueError: invalid literal for int() with base 10: ‘’
Traceback (most recent call last):
File “/usr/bin/crop-type-wrapper.py”, line 443, in
main()
File “/usr/bin/crop-type-wrapper.py”, line 264, in main
run_command(command)
File “/usr/bin/crop-type-wrapper.py”, line 25, in run_command
“Command {} failed with exit code {}”.format(cmd_line, result)
RuntimeError: Command crop-type-parcels.py -m sar -s 8 --lpis-path /leo4cap/tmp/lpis/lux_2022_test_foi/2023 --tile-footprints /mnt/archive/orchestrator_temp/s4c_l4a/574/7319-s4c-l4a-extract-parcels/tiles.csv --radar-products /mnt/archive/orchestrator_temp/s4c_l4a/574/*7319-s4c-l4a-extract-parcels/radar.csv --backscatter-compositing-months 2 failed with exit code 1

By looking in /mnt/archive/orchestrator_temp/s4c_l4a/574/7319-s4c-l4a-extract-parcels/radar.csv, we observed that there was no Orbit_type_id information.
Please see below an extract of the /mnt/archive/orchestrator_temp/s4c_l4a/574/7319-s4c-l4a-extract-parcels/radar.csv

Could be the error in the third attempt caused by the usage of the local repository with data downloaded from the LSA? Or due to the short period selected?

In the first attempt, the radar.csv file was containing the orbit_type_id. What could be then the cause of failure ?

Thank you very much in advance for your support

Best regards,
Marta.