1

According to the dataset, there should be a band named: total_precipitation_surface. However, when I try to get data from this band I get:

> Collection.first: Error in map(ID=2019061000F000): Image.select:
> Pattern 'total_precipitation_surface' did not match any bands.

I works perfectly with other bands in this dataset, but for some reason it does not work for the band I want.

My code is:

var fc2 = ee.Geometry.Point([-159.5469188,21.9080489]);

Map.centerObject(fc2,10); //the last numbe is zoom level

print (fc2)

var data_collection = ee.ImageCollection('NOAA/GFS0P25');
var dataset = data_collection.filterBounds(fc2)
                    .filterDate('2019-06-10', '2019-06-15')
                    .select('total_precipitation_surface');


// Create a graph of the time-series.
var graph = ui.Chart.image.seriesByRegion({
  imageCollection: dataset, 
  regions: fc2, 
  reducer: ee.Reducer.mean(),
  //seriesProperty:'uniqe_name'
})
print(graph)
1
  • The short answer is not all of the images contain that band. Some have 6 bands, some have 9. Just trying to work out the filter syntax...
    – phloem
    Jul 10, 2019 at 20:49

1 Answer 1

0

It's a little hidden, but the dataset properties indicate that the total_precipitation_surface band is only available for those images where forecast_hours > 0. So, you can add in that metadata filter to select only those images.

var dataset = data_collection.filterBounds(fc2)
              .filterDate('2019-06-10', '2019-06-15')
              .filterMetadata('forecast_hours', 'greater_than', 0)
              .select('total_precipitation_surface');
1
  • Thanks, I now get an error -Error generating chart: Computation timed out, but I guess it has something to do with my account or internet connection, and not your answer. I actually don't understand why I get this error because I ask for one parameter for a short period of time.
    – user88484
    Jul 11, 2019 at 6:12

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.