I'm working with GOES-16 full disk data, trying to calculate the frequency of low clouds in northern Chile.

I need to filter the collection so it contains only images from September 2017 at night. This means, between 22 UTC and 11 UTC. To filter the year and month I have used ee.Filter.calendarRange but I don't know if it is working with the night hours because the start argument (22) is greater than the end (11).

Here is the code I have been using:

//creation of temporal filters
var rYear = ee.Filter.calendarRange(2017,2017,'year'); //year 2017
var rMonth = ee.Filter.calendarRange(9,9,'month'); //september
var rHour = ee.Filter.calendarRange(22,11,'hour'); // nocturnal hour range in UTC (local time: UTC-3)

//filter collection by temporal range
var night = GOES16.filter(rYear).filter(rMonth).filter(rHour);

Here is what the reference page of ee.Filter.calendarRange says, but I don't understand it:

If end < start then this tests for value >= start OR value <= end, to allow for wrapping.

And here is the complete code: https://code.earthengine.google.com/27d18828f97161552d812cf82aa87477?noload=true

Is there a way to filter the collection only in the desired hour range (22-11 UTC) for a whole month and for a specific year?

1 Answer 1


Your code works and I cannot think of code that is necessarily more elegant. The GEE documentation is saying that


is equivalent to


It may be helpful to convince yourself with an example such as the following:

var GOES16p = GOES16.filter(rYear).filter(rMonth)
print(GOES16p.filter(ee.Filter.calendarRange(22,11,'hour')).size()) // 1680 
print(GOES16p.filter(ee.Filter.calendarRange(22,24,'hour')).size()) // 240 
print(GOES16p.filter(ee.Filter.calendarRange(0,11,'hour')).size()) // 1440 

Your Answer

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

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