Quick Start
This guide will help you get started accessing, processing, and analyzing data from Hydrosat's pathfinder missions.
1. Accessing Hydrosat's STAC API
1.1 Import dependencies.
import json
import pystac
from pystac_client import Client
import base641.2 Authenticate and connect to the STAC API.
Before running this next cell, you'll need to create a creds.json file in the same directory as this notebook.
The format of the file should be:
{
"username":"your_username",
"password":"your_password"
}(Leave the quotation marks as is.)
Let's read the json file.
This next cell will endecode the username:password combination and use it to authorize access to the STAC API given by the cat_url endpoint. You don't need to make any changes here.
Now you're ready to explore the STAC catalog! The catalog consists of a series of collections containing STAC items, each of which represents an individual scene.
VanZyl-1 data is available in four collections:
vz-liri-l1a: Level-1A LWIR datavz-viri-l1a: Level-1A VNIR datavz-l1b: Level-1B datavz-l2: Level-2 data (surface reflectance and surface temperature)
2. Searching the catalog for data that meets your criteria
Let's explore how you can use the catalog.search() function to find data from a specific place and time.
2.1 Define search terms.
First, we'll specify a collection to search.
We'll also define a bounding box to search within. Points, polygons, and other geometries are also valid search filters.
We can also specify a date range of interest. Note that there are a few different ways you can format this range.
2.2 Execute the search.
3. What's in an item anyway?
Let's explore the concept of a STAC item. At a high level, each item represents a single VZ-1 scene as a GeoJSON feature.
For this example, we'll focus on an item with a specific known ID.
We can extract the scene's date and time with the datetime operator.
The bbox field describes the scene's spatial footprint.
Several scene characteristics are included under properties.
⚠️ Note: any of the item's properties can be used as a search filter. For example, to find scenes acquired with an off-nadir angle between -10 and 10 degrees, we could add query={"view:off_nadir": {"gte":-10, "lte":10}} as another argument to catalog.search().
Details about the data and metadata, including download links, are provided under assets. We'll print the list of available assets below.
⚠️ Note: The data or metadata file corresponding to each asset can be accessed using the pre-signed S3 URL under the href field. These URLs are unique to each user and enable easy, one-click access to imagery. They expire after 24 hours.
4. Visualizing item footprints on a map
Now that we have a better understanding of what's contained in a STAC item, let's map the item geometries. You can inspect any item to see more information about it.
⚠️ Note: Certain IDEs will render this map differently.
If you're using VSCode, you'll see an interactive map in this Jupyter notebook.
If you're using Spyder, you'll need to open
map.htmlin a browser window.

5. Visualizing LST
Land surface temperature data is provided as a Level-2 asset. Here, we'll walk through the process of accessing, scaling, and plotting LST.
First, we'll access the LST asset and open the cloud-optimized geotiff file using rioxarray.
We'll handle pixels with no data by converting them to NaN.
We'll need to apply a scaling factor from the metadata to ensure LST is displayed in units Kelvin.
Now, let's plot the image.

Finally, we'll plot a distribution of LST values across the entire scene.

That's it! You've done your first end-to-end analysis with Hydrosat data.
Last updated
Was this helpful?