0

I have a set of code blocks that ran well earlier in February to grab Sentinel-2 10 bands for the AOI using open data cube. But for some reasons I don't know, it is giving me this error message "'S2' is not defined" each time I attempted to run this cell .

(S2
 .mean(dim=['x','y'])
 .to_pandas()
 .median()
 .add_prefix('median_')
 .append(
     S2
     .mean(dim=['x','y'])
     .to_pandas()
     .count()
     .add_prefix('count_')
 )
)

How can I fix the problem in Open Data Cube? All libraries have been installed and cells ran successfully to the cell below:

lat, lon = (-42.510102, 147.991461)
date = '2022-01-01'
filename_out = 'test.nc'
days_before = 40
days_after = 40

try:
    S2 = get_data(lat, lon, date, days_before, days_after)
except:
    print('no data available') 

Apparently, there is a problem with the Sentinel-2 products I am requesting to save from the data cube.

1
  • To be a code snippet the code that you present will need to include imports for any modules/libraries that are needed to make it run.
    – PolyGeo
    May 5, 2023 at 7:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.