Skip to main content

Dear Sentinelhub fantastic team,

I am currently exploring Pleaides data. I would be very interested in applying Pansharpening on the native 2m bands B0, B1, B2 and B3 w.r.t the Panchromatic band available at 0.5m using an external software (OrfeoToolBox).

However, it seems that whatever evalscript I give as input, the output array is at 0.5 meter resolution (0.25km2 area ==> 250*250 pixels)

evalscript_bands = """
function setup() {
return {
input: [ "B0", "B1", "B2","B3"],
output: { bands: 4 }
};
}
function evaluatePixel(sample) {
return [ sample.B0/4000,sample.B1/4000, sample.B2/4000, sample.B3/4000];
}
"""

evalscript_pan = """
function setup() {
return {
input: ["PAN"],
output: { bands: 1 }
};
}
function evaluatePixel(sample) {
return [sample.PAN/1000];
}
"""

byoc_request = SentinelHubRequest(
evalscript=evalscript_pan,
input_data=[
SentinelHubRequest.input_data(
data_collection=byoc
)],
responses=[
SentinelHubRequest.output_response('default', MimeType.TIFF)
],
bbox = byoc_bbox,
config=config
)

I was wondering if we could add the native resolution in the evalscript ? Is there another that you would recommand to perform such task?
Also, why do we need to divide the sample outputs by 1000*#Bands ?

Many thanks in advance for your support!

Best regards,

 

if I understand you correctly, you would like to export “native” bands and then use these in OrfeoToolbox? If so, you will have to create two requests as the GeoTiff does not support multi-resolution bands (limitation of the tiff format).

You can use this example to export the bands, just make sure to adjust width and height appropriately. Alternatively you can use “resx” and “resy” instead of “width” and “height”. But resx/resy have to be in the same unit as the coordinate system. If you are using UTM, you can simply do resx=2 for MSI and resx=0.5 for PAN. If you are using WGS84, do calculate how much 0.5 meters is in degrees at your latitude.

About “division with 1000” - the examples you are looking at are probably using default sampleType. If you define it as UINT16 for example, you don’t need to divide, you can output original values. See e.g. this example.


Reply