Skip to main content

From the USGS website states “Landsat 8 OLI Band 8 (panchromatic band) is not processed to Top-of Atmosphere or Surface Reflectance.” Obviously same is true for Landsat 9. I.e., it’s not available at level-2 processing. ESRI shows some ways to do pansharpening, and Sentinel-hub offers this as well, but it’s not clear to me if/how one could take the level-1 panchromatic band and pansharpen level-2 data. How is this being done at SH? Thanks!

Hi,

This is possible, although a little more complicated as you need to call 2 separate data collections. However, this is what Data Fusion is for! I have adapted the example for Landsat 8/9 found here replacing the True Color bands with the same bands from the Level 2 Collection. Below is the evalscript:

//VERSION=3
function setup() {
return {
input: [{
datasource: "ls81",
bands: ["B08"]
}, {
datasource: "ls82",
bands: ["B02", "B03", "B04"]
}
],
output: [{
bands: 3
}]
}
}
let minVal = 0.0
let maxVal = 0.4

let viz = new HighlightCompressVisualizer(minVal, maxVal)

function evaluatePixel(samples) {
var ls81 = samples.ls81[0]
var ls82 = samples.ls82[0]
let sudoPanW = (ls82.B04 + ls82.B03 + ls82.B02 * 0.4) / 2.4
let ratioW = ls81.B08 / sudoPanW
let val = [ls82.B04 * ratioW, ls82.B03 * ratioW, ls82.B02 * ratioW]
val = viz.processList(val)
val.push(samples.dataMask)
return val
}

ls81 refers to the Collection 1 data and ls82 refers to the Collection 2 data. For completeness you can copy and paste the below curl request into Request builder to see how to build the request for Process API.

curl -X POST https://services-uswest2.sentinel-hub.com/api/v1/process  -H 'Content-Type: application/json'  -H 'Authorization: Bearer <yourAccessToken>'  -d '{   "input": {     "bounds": {       "bbox": [         2.142162,         41.377968,         2.301475,         41.463312       ]     },     "data": [       {         "dataFilter": {           "timeRange": {             "from": "2020-06-04T00:00:00Z",             "to": "2020-06-18T23:59:59Z"           }         },         "type": "landsat-ot-l1",         "id": "ls81"       },       {         "dataFilter": {           "timeRange": {             "from": "2020-06-04T00:00:00Z",             "to": "2020-06-18T23:59:59Z"           }         },         "type": "landsat-ot-l2",         "id": "ls82"       }     ]   },   "output": {     "width": 887.1638852980718,     "height": 633.3633748173146,     "responses": [       {         "identifier": "default",         "format": {           "type": "image/jpeg"         }       }     ]   },   "evalscript": "//VERSION=3\nfunction setup() {\n  return {\n    input: [{\n        datasource: \"ls81\",\n        bands: [\"B08\"]\n      }, {\n        datasource: \"ls82\",\n        bands: [\"B02\", \"B03\", \"B04\"]\n      }\n    ],\n    output: [{\n      bands: 3\n    }]\n  }\n}\nlet minVal = 0.0\nlet maxVal = 0.4\n\nlet viz = new HighlightCompressVisualizer(minVal, maxVal)\n\nfunction evaluatePixel(samples) {\n  var ls81 = samples.ls81[0]\n  var ls82 = samples.ls82[0]\n  let sudoPanW = (ls82.B04 + ls82.B03 + ls82.B02 * 0.4) / 2.4\n  let ratioW = ls81.B08 / sudoPanW\n  let val = [ls82.B04 * ratioW, ls82.B03 * ratioW, ls82.B02 * ratioW]\n  val = viz.processList(val)\n  val.push(samples.dataMask)\n    return val\n   }" }'

Hope that proves useful to you! 🙂


Reply