I have an image collection that spans multiple years. I have looked at each image in the collection and created a list of the image's indices that I'd like to keep for my future analyses. However, I still haven't figure out how to use that index list to filter the entire original image collection and make a new one with my desired images. So far, I have the following:
Let's say that originalCollection is the first collection I obtained.
var imageList = originalCollection.toList(originalCollection.size());
var good_indices = ee.List([0,2,3,5,6,7,10,11,12,14,15,16,17,19,21,28,29,30,31,32,33,34,35,36,37,38,39,40]);
print(good_indices);
Then I have tried this:
var i=0; //Index
var good_i = good_indices.get(i);
var img= ee.Image(imageList.get(good_i));
print(img);
This definitely gives me the first image in the ee.List but I need to iterate over all of the list. I've tried using a loop -although I know it is not recommend:
var i=0;
for (i; i == good_indices.length;i++){
var good_i = good_indices.get(i);
var img= ee.Image(imageList.get(good_i));
var col = ee.ImageCollection(img);
}
print(col);
But the result is undefined.