# %pip install "hypercoast[extra]"
Import libraries.
import earthaccess
import hypercoast
import pandas as pd
Search for PACE data¶
To download and access the data, you will need to create an Earthdata login. You can register for an account at urs.earthdata.nasa.gov. Once you have an account, run the following cell and enter your NASA Earthdata login credentials.
earthaccess.login(persist=True)
<earthaccess.auth.Auth at 0x7fb7680cd220>
Search data programmatically¶
To search for PACE data programmatically, specify the bounding box and time range of interest. Set count=-1
to return all results or set count=10
to return the first 10 results.
results, gdf = hypercoast.search_pace(
bounding_box=(-83, 25, -81, 28),
temporal=("2024-07-30", "2024-08-15"),
short_name="PACE_OCI_L2_AOP_NRT",
count=10,
return_gdf=True,
)
Plot the footprints of the returned datasets on a map.
gdf.explore()
Download the first dataset from the search results. Note that the download may take some time.
hypercoast.download_pace(results[:1], out_dir="data")
Search data interactively¶
To search for PACE data interactively, pan and zoom to the area of interest. Specify the time range of interest from the search dialog, then click on the Search button.
m = hypercoast.Map(center=[30.0262, -90.1345], zoom=8)
m.search_pace(default_dataset="PACE_OCI_L2_AOP_NRT")
m
By default, the search_pace
method searches for the PACE_OCI_L2_AOP_NRT
dataset, but you can specify the dataset name by setting the default_dataset
parameter, such as PACE_OCI_L2_BGC_NRT
. For more information about the available datasets, see the PACE Data Products page.
Uncomment the following cell to display the GeoDataFrame of the search results.
# m._NASA_DATA_GDF.head()
Similarly, you can download the first dataset from the search results by uncommenting the following cell.
# hypercoast.download_pace(results[:1], out_dir="data")
results = hypercoast.search_pace(
bounding_box=(-83, 25, -81, 28),
temporal=("2024-07-30", "2024-08-15"),
short_name="PACE_OCI_L2_AOP_NRT",
count=1,
)
hypercoast.download_pace(results[:1], out_dir="data")
Let's make a scatter plot of the pixel locations so we can see the irregular spacing.
filepath = "data/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc"
plot = hypercoast.view_pace_pixel_locations(filepath, step=20)
Load the dataset as a xarray.Dataset
object.
dataset = hypercoast.read_pace(filepath)
# dataset
Visualize PACE AOP data¶
Visualize selected bands of the dataset.
hypercoast.viz_pace(dataset, wavelengths=[500, 510, 520, 530], ncols=2)