Sentinel 2 Band 4 Reflectance

Hi

For a couple of dates i am getting the value of Sentinel 2 L2A - Band 4 Reflectance as 0 for a few pixels. Those pixels do not have any cloud cover over them. Is this possible??

If not, then what could be the possible reason for 0 value pixels of Band 4 Reflectance??

Thanks
Sidharrth

Hi,

Can you please share some examples of this. Code blocks and screenshots would be appreciated please.

Hi,

One of the dates for which this is occurring is 2024-06-29.
Below is the screenshot of the Sentinel 2 Band 4 Reflectance for my AOI (polygons are clearly visible in the lavender shade) for 2024-06-29.

From the legend on the left of the B4 raster, you can clearly see the value of Band 4 Reflectance as 0 for the polygons visible.

Following is the OGC API code snippet for downloading Band 4 Reflectance.

def mosaic_tiff(tiffs):
    tiffs = [np.nan_to_num(arr) for arr in tiffs]
    height, width = tiffs[0].shape
    mosaic = np.full(shape = (height, width), fill_value = float('-inf'), dtype = tiffs[0].dtype)
    for tiff in tiffs:
        mosaic = np.maximum(mosaic, tiff)

    print("Mosaic done")

    return mosaic

def band4_reflectance_call(bbox, input_date):
    wcs_true_color_request = WcsRequest(
        data_collection = DataCollection.SENTINEL2_L2A,
        data_folder = '/Users/sid/Documents/STRESS/CROP_STRESS/SENTINEL_PRODUCTS/B04',
        layer = 'B04',
        bbox = bbox,
        time = input_date,
        resx = '10m',
        resy = '10m',
        image_format = MimeType.TIFF,
        custom_url_params = {
            CustomUrlParam.SHOWLOGO: False
        },
        config = config
    )
    wcs_true_color_img = wcs_true_color_request.get_data()
    band4_ref = mosaic_tiff(wcs_true_color_img)

    print("Band 4 Reflectance fetched")
    
    return band4_ref

Thanks,
Sidharrth

Please can you provide the request body for a Process API request that is replicable. It is difficult to replicate your issue if your code contains several dependencies.

Within the request should be the area of interest and the time range you used. You can build this in Request Builder and copy and paste the curl request here.

PFA the curl request for my AOI and specific date.

curl -X POST https://services.sentinel-hub.com/api/v1/process \
 -H 'Content-Type: application/json' \
 -H '' \
 -d '{
  "input": {
    "bounds": {
      "bbox": [
        80.1026,
        27.689599,
        80.305124,
        27.907049
      ]
    },
    "data": [
      {
        "dataFilter": {
          "timeRange": {
            "from": "2024-06-24T00:00:00Z",
            "to": "2024-06-24T23:59:59Z"
          }
        },
        "type": "sentinel-2-l2a"
      }
    ]
  },
  "output": {
    "width": 1996.2982754084483,
    "height": 2420.6423272996835,
    "responses": [
      {
        "identifier": "default",
        "format": {
          "type": "image/tiff"
        }
      }
    ]
  },
  "evalscript": "//VERSION=3\n\nfunction evaluatePixel(samples) {\n    let val = samples.B04;\n    return [val];\n}\n\nfunction setup() {\n  return {\n    input: [{\n      bands: [\n        \"B04\",\n        \n      ]\n    }],\n    output: {\n      bands: 1,\n      sampleType: SampleType.FLOAT32\n    }\n  }\n}"
}'

Thanks
Sidharrth

Hi, checking the True Color image, the areas you refer to look like they are areas of cloud shadow so there is likely to be little or no surface reflectance in these areas. This is why if you are performing any analysis it is a good idea to mask out cloudy or cloud shadow pixels.