I want to get daily data such as net radiation, sensible heat flux and latent heat flux. NOAA NWS National Centers for Environmental Prediction (NCEP)[ee.ImageCollection("NOAA/CFSV2/FOR6H")] has 6 hours averaged data. I'm trying to get daily average using 6 hourly data in above source.

Could you share the code to calculate daily data from hourly data?

1 Answer 1


You should try to provide some code in your questions. Even if you only manage to create an image collection and display a single image on the map.

To get daily means, you can do like this:

var startDate = ee.Date('2020-01-01')
var endDate = ee.Date('2020-01-05')

var collection = ee.ImageCollection("NOAA/CFSV2/FOR6H")

var numberOfDays = endDate.difference(startDate, 'days')
var daily = ee.ImageCollection(
  ee.List.sequence(0, numberOfDays.subtract(1))
    .map(function (dayOffset) {
      var start = startDate.advance(dayOffset, 'days')
      var end = start.advance(1, 'days')
      return collection
        .filterDate(start, end)
Map.addLayer(daily.first().select(0), {min: 100, max: 450, palette: 'blue,green,yellow,orange,red'})


  • Thank you very much for the reply. I want to get a time series of data. Could you please help me to get the time series of daily latent heat flux data var geometry = ee.Geometry.Point([80.73,8.26]); var startDate = ee.Date('2017-01-01') var endDate = ee.Date('2020-01-05') var collection = ee.ImageCollection("NOAA/CFSV2/FOR6H") .filterDate(startDate, endDate) .select('Latent_heat_net_flux_surface_6_Hour_Average');
    – Bhagya
    Apr 16, 2020 at 16:15
  • Thank you very much for your kind support.
    – Bhagya
    Apr 17, 2020 at 3:14
  • code.earthengine.google.com/21099fca23b4d4e3d09dd11b05e55ff4 Here I want to repeat the above process for 15 points. Please help me to simplify the code instead of repeating the same code for 15 times. Thank You.
    – Bhagya
    Apr 17, 2020 at 19:23

Your Answer

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

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