Using the Cloud and QA Masks
Here, we'll explore Hydrosat's cloud and quality assurance masks to better understand the information encoded within them.
1. Accessing Hydrosat's STAC API
1.1 Import dependencies
import json
import pystac
from pystac_client import Client
import base641.2 Connect to the API with your account credentials
with open('creds.json') as f:
creds = json.loads(f.read())
userpass = f"{creds['username']}:{creds['password']}"
b64 = base64.b64encode(userpass.encode()).decode()
headers = {'Authorization':'Basic ' + b64}
cat_url = 'https://stac.hydrosat.com/'
catalog = Client.open(cat_url, headers)2. Explore the cloud mask asset
2.1 Access the cloud mask COG
2.2 Visualize the cloud mask

2.3 Interpret the cloud mask pixel values
Decimal
Binary
No data
Cloud
Cloud shadow
Snow or ice
Access the QA mask asset

Interpret the QA mask pixel values
Decimal
Binary
Blue band saturation
Green band saturation
Red band saturation
Red edge 1 band saturation
Red edge 2 band saturation
Red edge 3 band saturation
NIR band saturation
LWIR 1 band saturation
LWIR 2 band saturation
Last updated
Was this helpful?