Hi there,
First post ever here : I’ll try to make it as clear and concise as possible for you to get straight to the point.
In a Nutshell…
How to get rid of exception and cloud pixels in LST dataset from S3_L3_LST product, using python script ?
Feeling like reading more details ?..
Scope of the study
I am using Sentinel-3 Level 2 LST product:
My plan is to:
- get rid of orphan pixels first,
- filter all exception pixels
- filter all cloud pixels
- enjoy a nice LST plot.
Context
I first thought that Lvl 2 product were already cloud and exception-filtered, but…
Cloud
After a quick plot on jupyter lab, I could clearly witness clouds on LST dataset:
I made sure those were “removable” clouds, identified as so, using SNAP and the following flags :
-
single_moderate
flag frombayes_in
variable inflags_in.nc
file, - and
summary_cloud
flag fromconfidence_in
variable in similarflags_in.nc
file.
Exception
Exceptions : only for invalid data ?
Then, I wanted to get rid of exception-pixels using the exception
variable in LST_in.nc
dataset.
As expected from the [Sentinel-3 SLSTR Land Handbook](https://sentinel.esa.int/documents/247904/4598082/Sentinel-3-SLSTR-Land-Handbook.pdf)
:
“The data have been quality checked with regards to input Level-1 data, with only valid data processed. All invalid data are identified with an exception flag.”
In other words, as I understood it : I’m expecting valid data to have NaN
value in the exception
dataset.
No NaN
in exception…
```python
import xarray as xr
import numpy as np
ds_lst = xr.open_dataset('lst_in.nc')
np.isnan(ds_lst.exception.values).any()
Using the code above, I get a False
for the last line, which I translate as :
no NaN value in the exception values
…
Conclusion
I didn’t get to the cloud-cleaning part since it feels like I need to get a better grasp on what the data means, and how to use correctly.
Thanks in advance for your time, and your help.
Regards,
Mathieu