0

I'm trying to get annual composites VIIRS-DNB from 2012 to 2021 for Ukraine and export these images

# define our start and end years
start = 2012
end = 2021

years = ee.List.sequence(start, end)

colID = "NOAA/VIIRS/DNB/MONTHLY_V1/VCMSLCFG"

def viirs_annual_median_reduce(year):
    return ee.ImageCollection(colID).filter(
        ee.Filter.calendarRange(year,year,"year")).select("avg_rad").median().set('year',year)

# map function to each year in our list
yearComps = ee.ImageCollection.fromImages(years.map(viirs_annual_median_reduce))

# get boundaries for Ukraine
aoi_UA = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level0').filter(ee.Filter.eq('ADM0_CODE', 254))

# clipping image to only include nightlight data for Ukraine
viirs_UA = yearComps.map(lambda x: x.clip(aoi_UA))

I don't know how to export ImageCollection so I'm exporting one image at a time

img1 = viirs_UA.filterMetadata("year","equals",2012).first()

task = ee.batch.Export.image.toDrive(image=img1,
                                     fileFormat='GeoTIFF',
                                     description='Ukraine_VIIRS_2012',
                                     scale=30,
                                     folder='tmp',
                                     maxPixels=1e9)

task.start()

When I run task.status() I get this error 'error_message': 'Image.clipToBoundsAndScale: The image must have at least one band.'

What am i doing wrong?

Val_hat
  • 1
  • 1
  • Looks like `NOAA/VIIRS/DNB/MONTHLY_V1/VCMSLCFG` doesn't have images before 2014. https://developers.google.com/earth-engine/datasets/catalog/NOAA_VIIRS_DNB_MONTHLY_V1_VCMSLCFG – Jesse Anderson Jul 31 '22 at 19:38
  • @JesseAnderson oh, didn't notice that straylight corrected data starts from 2014. is there a way to make stray light correction for 2012-2013? – Val_hat Aug 01 '22 at 10:19
  • I'm not familiar with the version of the nl dataset on GEE, but you might look here: https://eogdata.mines.edu/products/vnl/ – Jesse Anderson Aug 02 '22 at 00:18

0 Answers0