I try to use "QC_250m" to mask out cloud pixels from MODIS daily reflectance 250m collection, but it did not completely remove cloud pixels.
Here is the code
var terra = ee.ImageCollection("MODIS/061/MOD09GQ").filterDate("2020", "2023");
var cloud_mask = function(img){
var qa = img.select("QC_250m");
var cloudBitMask = ee.Number(2).pow(0).int()
var mask = qa.bitwiseAnd(cloudBitMask).eq(0)
return img.updateMask(mask)
}
var modis = terra.map(cloud_mask)
Map.addLayer(modis.first(), {}, "Cloud-free")
Here is the code link https://code.earthengine.google.com/43d8627435697b4fb11f1600e9ae650b