3

I have a CSV with a column of dates. I already imported the CSV, but I would like to know If I could use that column to filter an Image Collection.

Just now, I wrote all dates and used a filter to exclude dates from the desired list of dates

var Class0Images = image_2.filter(ee.Filter.inList("system:time_start", F0Date));

However, non image was returned and I know there are dates in the list that could return images from the sentinel 1 image collection.

This is the link of my script, which I also computed polarimetric indexes: https://code.earthengine.google.com/43144b99eb7c14dbdc9bd3953a59dc46

Thanks for your attention and help

3

You are filtering the image on a simple time format, namely at 00:00 AM each day. The system:time_start property contain the exact sensing time. Therefore, first set a new date property to each image at 00:00AM:

// set a date property to exactly 00:00 AM
var image_2 = image_2.map(function(image){
  return image.set('simpleTime', ee.Date(image.date().format('YYYY-MM-dd')).millis());
});

Then filter on that property:

//Applying date filter
var Class0Images = image_2.filter(ee.Filter.inList("simpleTime", F0Date)); 
print('filtered by simpleTime',Class0Images);

link code, where unshared imports were removed.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.