The results of day/night LST data of GEE data are significantly different according to the QC mask

In the MODIS dataset, I use the same function to mask daytime LST and nighttime LST through the QC bitmask. The quality of the masked nighttime LST image drops significantly, and it actually has much lower spatial coverage than the unmasked LST nighttime imagery. I would like to know how to deal with this problem. Foreword – Artificial intelligence tutorial code is as follows:  https://code.earthengine.google.co.in/197a5e6fe581879db3b121f06415039f

Image synthesis: mean average value, min minimum value synthetic image:

 

 

 

Can you take a look at my code for masking the MYD11A1 LST data using the QC layer?

https://code.earthengine.google.com/d882b904956c03029f70b0bf80219297

I use the same function to mask the day/night LST using the QC bitmask. The masked LST daytime image seems to discard only bad pixels, but the masked LST nighttime image also appears to discard good pixels, so it has much lower spatial coverage than the unmasked LST nighttime imagery. I suspect that the LST nightly QC layer of the MYD11A1 data may have a similar problem to what I had previously encountered in this thread with MYD12A1.

Can anyone explain why the QC-Day/Night band blocks the pixels on land? If this is due to clouds, I think pixels covered by clouds are flagged with the QC bit flag "10: LST not generated due to cloud effects".

When I use qualitybits to create the mask, the mask automatically includes the mask pixels of the QC bands in the mask, and the positions of the mask pixels of these QC bands have LST values ​​in the band "LST_Day(Night)_1km". So what do these LST values ​​masking the QC band mean - poor quality? Shouldn't I be using them?

Here is the GEE code:  https://code.earthengine.google.com/91dbffc0cf680291abd3ede8264c022c

code:

var modisLST = ee.ImageCollection("MODIS/061/MOD11A2"),
    modisLST_Aqua = ee.ImageCollection("MODIS/061/MYD11A2");

var startYear = 2017
var endYear = 2021
var startDate = ee.Date.fromYMD(startYear, 1, 1)
var endDate = ee.Date.fromYMD(endYear, 12, 31)


var bitwiseExtract = function(input, fromBit, toBit) {
  var maskSize = ee.Number(1).add(toBit).subtract(fromBit)
  var mask = ee.Number(1).leftShift(maskSize).subtract(1)
  return input.rightShift(fromBit).bitwiseAnd(mask)
}

// Cloud Masking
var applyQaMask_day = function(image) {
  var lstDay = image.select('LST_Day_1km')
  var qcDay = image.select('QC_Day')
  var qaMask = bitwiseExtract(qcDay, 0, 1).lte(1)
  //var dataQualityMask = bitwiseExtract(qcDay, 2, 3).eq(0)
  var dataQualityMask = bitwiseExtract(qcDay, 2, 3).lte(1)
  var EmissivityerrorMask = bitwiseExtract(qcDay, 4, 5).lte(1)
  var lstErrorMask = bitwiseExtract(qcDay, 6, 7).eq(0)
  var mask = qaMask.and(dataQualityMask).and(lstErrorMask).and(EmissivityerrorMask)
  return lstDay.updateMask(mask)
}

var applyQaMask_night = function(image) {
  var lstNight = image.select('LST_Night_1km')
  var qcNight = image.select('QC_Night')
  var qaNightMask = bitwiseExtract(qcNight, 0, 1).lte(1)
  //var dataNightQualityMask = bitwiseExtract(qcNight, 2, 3).eq(0)
  var dataNightQualityMask = bitwiseExtract(qcNight, 2, 3).lte(1)
  var EmissivityNighterrorMask = bitwiseExtract(qcNight, 4, 5).lte(1)
  var lstNightErrorMask = bitwiseExtract(qcNight, 6, 7).eq(0)
  var Nightmask = qaNightMask.and(dataNightQualityMask).and(lstNightErrorMask).and(EmissivityNighterrorMask)
  return lstNight.updateMask(Nightmask)
}

// Apply the function to all images in the collection
var terra_day = modisLST_Aqua
  .filter(ee.Filter.date(startDate, endDate)).select('LST_Day_1km','QC_Day');
var terraMasked_day = terra_day.map(applyQaMask_day)

var terra_night = modisLST_Aqua
  .filter(ee.Filter.date(startDate, endDate)).select('LST_Night_1km','QC_Night');
var terraMasked_night = terra_night.map(applyQaMask_night)
// print(terraMasked_day.first())


// 月合成 Create NDVI composite for every month
var years = ee.List.sequence(startYear,endYear);
var months = ee.List.sequence(1, 12);

// Map over the years and create a monthly average collection
var monthlyImages = years.map(function(year) {
  return months.map(function(month) {
    var filtered = terraMasked_night
      .filter(ee.Filter.calendarRange(year, year, 'year'))
      .filter(ee.Filter.calendarRange(month, month, 'month'))
    var monthly = filtered.mean()
    return monthly.set({'month': month, 'year': year})
  })
}).flatten()
//print(monthlyImages)

// We now have 1 image per month for entire duratioon
var monthlyCol = ee.ImageCollection.fromImages(monthlyImages)
print(monthlyCol,'monthlyCol')

var visParams = {min:13000, max:16000, palette: ['green', 'yellow', 'red']}
Map.addLayer(terra_day.select('LST_Day_1km').first(), visParams, 'Original LSTday Image');
Map.addLayer(terraMasked_day.first(), visParams, 'LSTday Masked');

Map.addLayer(terra_night.select('LST_Night_1km').mean(), visParams, 'Original LSTnight Image');
Map.addLayer(terraMasked_night.mean(), visParams, 'LSTnight Masked');

Map.addLayer(terraMasked_night.min(), visParams, 'LSTnight Masked min');

Preface – Artificial Intelligence Tutorial

Welcome to continue to pay attention. If there are follow-up issues on the official website, I will update here at any time.

Guess you like

Origin blog.csdn.net/qq_31988139/article/details/132108998