I need to filter the LANDSAT/LC8_SR image collection using an assessment of total cloud cover in the entire scene of each image. i.e. each image in the collection is "in" or "out" based on a threshold of cloud cover for the whole image. In the TOA collections I can easily do this using 'CLOUD_COVER' from the metadata, but the surface reflectance collection does not have this metadata attribute. I have tried using reduceRegion to find the sum of cfmask=4 over the 'cfmask' layer, but this returns a value and I don't know where to put that value so I can use it to filter the images.
// Load a Landsat 8 ImageCollection for a single path-row. var collection = ee.ImageCollection('LANDSAT/LC8_SR') .filter(ee.Filter.eq('wrs_path', 23)) .filter(ee.Filter.eq('wrs_row', 38)); // use wrs feature collection to establish region to assess cloud cover var fc = ee.FeatureCollection('ft:1_RZgjlcqixp-L9hyS6NYGqLaKOlnhSC35AB5M5Ll') .filter(ee.Filter.and( ee.Filter.eq('PATH', 23), ee.Filter.eq('ROW', 38)));