Landsat 8-9 Bands values only in whole numbers between 0-9

Hi there,

I seem to only get whole numbers between 0-10 in the bands B01, …, B07 of the Landsat 8-9 data. As an example of an RGB image (bands B04, B03, B02):

array([[[2., 9., 1.],
        [2., 9., 1.],
        [3., 9., 1.],
        ...,
        [0., 0., 0.],
        [0., 0., 0.],
        [0., 0., 0.]],

       [[3., 9., 1.],
        [3., 9., 1.],
        [3., 9., 1.],
        ...,
        [0., 0., 0.],
        [0., 0., 0.],
        [0., 0., 0.]],

       [[2., 9., 0.],
        [2., 9., 0.],
        [2., 9., 0.],
        ...,
...
        ...,
        [0., 0., 0.],
        [0., 0., 0.],
        [0., 0., 0.]],

       [[5., 7., 2.],
        [5., 7., 2.],
        [5., 7., 2.],
        ...,
        [0., 0., 0.],
        [0., 0., 0.],
        [0., 0., 0.]],

       [[5., 7., 2.],
        [5., 7., 2.],
        [5., 7., 3.],
        ...,
        [0., 0., 0.],
        [0., 0., 0.],
        [0., 0., 0.]]])

The image looks then like this:


For comparison, in the playground the image looks like this:

This is on the south coast of France, 18.07.2022. To load the image above I used the Catalog to find the possible images around that time. Then I build a request via the SentinelHubRequest with the standard evaluationscript (sorry for the bad formatting, doesn’t want to get in shape)
evalscript_LA8_all_bands = """ function setup() { return { input: [{ bands: ["B01","B02","B03","B04","B05","B06","B07"] }], output: { bands: 7 } }; } function evaluatePixel(sample) { return [sample.B01, sample.B02, sample.B03, sample.B04, sample.B05, sample.B06, sample.B07]; } """
Any idea what I might be doing wrong here?

Hi Stephan,

This looks like it is caused by the SampleType defaulting to UINT8, as you have not specified it in the evalscript. There is more info about defining the SampleType of your output here.

We actually have an example of extracting the raw Landsat8-9 bands in the documentation you can use :slight_smile:

You can also read up about SampleTypes and Sentinel Hub in @maxim.lamare 's blog post on our Medium publication here too.

If you’re still having issues let us know :+1:

1 Like

Works, I had it on AUTO before and tried a few others, seems I didn’t try out all of them. Thank you!

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