S1 NRPB Values that are incorrect

Good day

I am trying to get the S1 NRPB data but the output is just a value of 1 in my tiff file.

See eval script below:

curl -X POST https://services.sentinel-hub.com/api/v1/process \
 -H 'Content-Type: multipart/form-data' \
 -H 'Authorization: Bearer ' \
 --form-string 'request={
  "input": {
    "bounds": {
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          [
            [
              [
                391702.439726132,
                8107312.635254357
              ],
              [
                391717.757104949,
                8095730.981196007
              ],
              [
                380885.56934175163,
                8095718.394280376
              ],
              [
                380864.2894166684,
                8107280.131685488
              ],
              [
                391702.439726132,
                8107312.635254357
              ]
            ]
          ]
        ]
      },
      "properties": {
        "crs": "http://www.opengis.net/def/crs/EPSG/0/32737"
      }
    },
    "data": [
      {
        "dataFilter": {
          "timeRange": {
            "from": "2023-06-16T00:00:00Z",
            "to": "2023-06-16T23:59:59Z"
          },
          "mosaickingOrder": "mostRecent",
          "resolution": "HIGH",
          "acquisitionMode": "IW",
          "polarization": "DV",
          "orbitDirection": "DESCENDING"
        },
        "processing": {
          "upsampling": "NEAREST",
          "backCoeff": "GAMMA0_ELLIPSOID",
          "orthorectify": true,
          "demInstance": "COPERNICUS_30"
        },
        "type": "sentinel-1-grd"
      }
    ]
  },
  "output": {
    "width": 1088.3085091828946,
    "height": 1167.957792197513,
    "responses": [
      {
        "identifier": "default",
        "format": {
          "type": "image/tiff"
        }
      }
    ]
  }
}' \
 --form-string 'evalscript=//VERSION=3

function setup() {
  return {
    input: [
      {
        bands: ["VV","VH"],                  
      }
    ],
    output: [
      {
        id: "default",
        bands: 1,
        sampleType: "FLOAT32",        
        noDataValue: 0,
      },    
    ],
    mosaicking: "SIMPLE",
  };
}


function evaluatePixel(samples) {
  let vv = [samples.VV];
  let vh = [samples.VH];
  let nrpb =[((vh - vv)/(vh + vv))];
  return nrpb;
}

'

Hi @rickus7.swanepoel ,

There’s no need to put samples.VH and samples.VV in arrays when initialising them as vv and vh in your Evalscript.

Please try the Evalscript below:

//VERSION=3

function setup() {
  return {
    input: [
      {
        bands: ["VV","VH"],                  
      }
    ],
    output: [
      {
        id: "default",
        bands: 1,
        sampleType: "FLOAT32",        
        noDataValue: 0,
      },    
    ],
    mosaicking: "SIMPLE",
  };
}


function evaluatePixel(samples) {
  let vv = samples.VV;
  let vh = samples.VH;
  let nrpb =[((vh - vv)/(vh + vv))];
  return nrpb;
}

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.