Level 2.0 data from the "Cart_Site" for all AOD points¶
Define a cql2-json filter for:
In [1]:
Copied!
from pathlib import Path
from pystac import Item
import json
import sys
out_dir: Path = Path('.')
cql2_filter = {
"op": "and",
"args": [
{"op": "eq", "args": [{"property": "site"}, "Cart_Site"]},
{"op": "eq", "args": [{"property": "data_type"}, "AOD20"]},
{"op": "eq", "args": [{"property": "format"}, "csv"]},
{"op": "eq", "args": [{"property": "data_format"}, "daily-average"]},
{
"op": "t_after",
"args": [
{"property": "time"},
{"timestamp": "2000-06-01T00:00:00Z"},
],
},
{
"op": "t_before",
"args": [
{"property": "time"},
{"timestamp": "2000-06-14T23:59:59Z"},
],
},
],
}
json.dump(cql2_filter, sys.stdout, indent=2)
from pathlib import Path
from pystac import Item
import json
import sys
out_dir: Path = Path('.')
cql2_filter = {
"op": "and",
"args": [
{"op": "eq", "args": [{"property": "site"}, "Cart_Site"]},
{"op": "eq", "args": [{"property": "data_type"}, "AOD20"]},
{"op": "eq", "args": [{"property": "format"}, "csv"]},
{"op": "eq", "args": [{"property": "data_format"}, "daily-average"]},
{
"op": "t_after",
"args": [
{"property": "time"},
{"timestamp": "2000-06-01T00:00:00Z"},
],
},
{
"op": "t_before",
"args": [
{"property": "time"},
{"timestamp": "2000-06-14T23:59:59Z"},
],
},
],
}
json.dump(cql2_filter, sys.stdout, indent=2)
{
"op": "and",
"args": [
{
"op": "eq",
"args": [
{
"property": "site"
},
"Cart_Site"
]
},
{
"op": "eq",
"args": [
{
"property": "data_type"
},
"AOD20"
]
},
{
"op": "eq",
"args": [
{
"property": "format"
},
"csv"
]
},
{
"op": "eq",
"args": [
{
"property": "data_format"
},
"daily-average"
]
},
{
"op": "t_after",
"args": [
{
"property": "time"
},
{
"timestamp": "2000-06-01T00:00:00Z"
}
]
},
{
"op": "t_before",
"args": [
{
"property": "time"
},
{
"timestamp": "2000-06-14T23:59:59Z"
}
]
}
]
}
Execute the search operation¶
In [2]:
Copied!
from pygeofilter_aeronet import aeronet_search
item: Item = aeronet_search(
cql2_filter=cql2_filter,
output_dir=out_dir
)
json.dump(item.to_dict(), sys.stdout, indent=2)
from pygeofilter_aeronet import aeronet_search
item: Item = aeronet_search(
cql2_filter=cql2_filter,
output_dir=out_dir
)
json.dump(item.to_dict(), sys.stdout, indent=2)
2025-11-18 21:48:14.697 | SUCCESS | pygeofilter_aeronet:aeronet_search:246 - Query on https://aeronet.gsfc.nasa.gov successfully obtained data:
2025-11-18 21:48:14.706 | SUCCESS | pygeofilter_aeronet:aeronet_search:259 - Data saved to to CSV file: /home/runner/work/pygeofilter-aeronet/pygeofilter-aeronet/docs/samples/6a49d70a-e782-4d9d-8348-45151807d926.csv
2025-11-18 21:48:14.728 | SUCCESS | pygeofilter_aeronet:aeronet_search:293 - Data saved to GeoParquet file: /home/runner/work/pygeofilter-aeronet/pygeofilter-aeronet/docs/samples/6a49d70a-e782-4d9d-8348-45151807d926.parquet
{
"type": "Feature",
"stac_version": "1.1.0",
"stac_extensions": [
"https://stac-extensions.github.io/table/v1.2.0/schema.json"
],
"id": "urn:uuid:6a49d70a-e782-4d9d-8348-45151807d926",
"geometry": {
"type": "Point",
"coordinates": [
-97.48639,
36.60667
]
},
"bbox": [
-97.48639,
36.60667,
-97.48639,
36.60667
],
"properties": {
"datetime": "2025-11-18T21:48:14.730975Z"
},
"links": [
{
"rel": "related",
"href": "https://aeronet.gsfc.nasa.gov/cgi-bin/print_web_data_v3?site=Cart_Site&AOD20=1&if_no_html=1&AVG=20&year=2000&month=6&day=1&hour=0&year2=2000&month2=6&day2=14&hour2=23",
"type": "text/csv",
"title": "AERONET Web Service search"
}
],
"assets": {
"csv": {
"href": "6a49d70a-e782-4d9d-8348-45151807d926.csv",
"type": "text/csv",
"description": "Search result - CVS Format",
"table:row_count": 11,
"table:columns": [
{
"name": "AERONET_Site",
"col_type": "object"
},
{
"name": "Date(dd:mm:yyyy)",
"col_type": "object"
},
{
"name": "Time(hh:mm:ss)",
"col_type": "object"
},
{
"name": "Day_of_Year",
"col_type": "int64"
},
{
"name": "AOD_1640nm",
"col_type": "float64"
},
{
"name": "AOD_1020nm",
"col_type": "float64"
},
{
"name": "AOD_870nm",
"col_type": "float64"
},
{
"name": "AOD_865nm",
"col_type": "float64"
},
{
"name": "AOD_779nm",
"col_type": "float64"
},
{
"name": "AOD_675nm",
"col_type": "float64"
},
{
"name": "AOD_667nm",
"col_type": "float64"
},
{
"name": "AOD_620nm",
"col_type": "float64"
},
{
"name": "AOD_560nm",
"col_type": "float64"
},
{
"name": "AOD_555nm",
"col_type": "float64"
},
{
"name": "AOD_551nm",
"col_type": "float64"
},
{
"name": "AOD_532nm",
"col_type": "float64"
},
{
"name": "AOD_531nm",
"col_type": "float64"
},
{
"name": "AOD_510nm",
"col_type": "float64"
},
{
"name": "AOD_500nm",
"col_type": "float64"
},
{
"name": "AOD_490nm",
"col_type": "float64"
},
{
"name": "AOD_443nm",
"col_type": "float64"
},
{
"name": "AOD_440nm",
"col_type": "float64"
},
{
"name": "AOD_412nm",
"col_type": "float64"
},
{
"name": "AOD_400nm",
"col_type": "float64"
},
{
"name": "AOD_380nm",
"col_type": "float64"
},
{
"name": "AOD_340nm",
"col_type": "float64"
},
{
"name": "Precipitable_Water(cm)",
"col_type": "float64"
},
{
"name": "AOD_681nm",
"col_type": "float64"
},
{
"name": "AOD_709nm",
"col_type": "float64"
},
{
"name": "AOD_Empty",
"col_type": "float64"
},
{
"name": "AOD_Empty.1",
"col_type": "float64"
},
{
"name": "AOD_Empty.2",
"col_type": "float64"
},
{
"name": "AOD_Empty.3",
"col_type": "float64"
},
{
"name": "AOD_Empty.4",
"col_type": "float64"
},
{
"name": "440-870_Angstrom_Exponent",
"col_type": "float64"
},
{
"name": "380-500_Angstrom_Exponent",
"col_type": "float64"
},
{
"name": "440-675_Angstrom_Exponent",
"col_type": "float64"
},
{
"name": "500-870_Angstrom_Exponent",
"col_type": "float64"
},
{
"name": "340-440_Angstrom_Exponent",
"col_type": "float64"
},
{
"name": "440-675_Angstrom_Exponent[Polar]",
"col_type": "float64"
},
{
"name": "N[AOD_1640nm]",
"col_type": "int64"
},
{
"name": "N[AOD_1020nm]",
"col_type": "int64"
},
{
"name": "N[AOD_870nm]",
"col_type": "int64"
},
{
"name": "N[AOD_865nm]",
"col_type": "int64"
},
{
"name": "N[AOD_779nm]",
"col_type": "int64"
},
{
"name": "N[AOD_675nm]",
"col_type": "int64"
},
{
"name": "N[AOD_667nm]",
"col_type": "int64"
},
{
"name": "N[AOD_620nm]",
"col_type": "int64"
},
{
"name": "N[AOD_560nm]",
"col_type": "int64"
},
{
"name": "N[AOD_555nm]",
"col_type": "int64"
},
{
"name": "N[AOD_551nm]",
"col_type": "int64"
},
{
"name": "N[AOD_532nm]",
"col_type": "int64"
},
{
"name": "N[AOD_531nm]",
"col_type": "int64"
},
{
"name": "N[AOD_510nm]",
"col_type": "int64"
},
{
"name": "N[AOD_500nm]",
"col_type": "int64"
},
{
"name": "N[AOD_490nm]",
"col_type": "int64"
},
{
"name": "N[AOD_443nm]",
"col_type": "int64"
},
{
"name": "N[AOD_440nm]",
"col_type": "int64"
},
{
"name": "N[AOD_412nm]",
"col_type": "int64"
},
{
"name": "N[AOD_400nm]",
"col_type": "int64"
},
{
"name": "N[AOD_380nm]",
"col_type": "int64"
},
{
"name": "N[AOD_340nm]",
"col_type": "int64"
},
{
"name": "N[Precipitable_Water(cm)]",
"col_type": "int64"
},
{
"name": "N[AOD_681nm]",
"col_type": "int64"
},
{
"name": "N[AOD_709nm]",
"col_type": "int64"
},
{
"name": "N[AOD_Empty]",
"col_type": "int64"
},
{
"name": "N[AOD_Empty].1",
"col_type": "int64"
},
{
"name": "N[AOD_Empty].2",
"col_type": "int64"
},
{
"name": "N[AOD_Empty].3",
"col_type": "int64"
},
{
"name": "N[AOD_Empty].4",
"col_type": "int64"
},
{
"name": "N[440-870_Angstrom_Exponent]",
"col_type": "int64"
},
{
"name": "N[380-500_Angstrom_Exponent]",
"col_type": "int64"
},
{
"name": "N[440-675_Angstrom_Exponent]",
"col_type": "int64"
},
{
"name": "N[500-870_Angstrom_Exponent]",
"col_type": "int64"
},
{
"name": "N[340-440_Angstrom_Exponent]",
"col_type": "int64"
},
{
"name": "N[440-675_Angstrom_Exponent[Polar]]",
"col_type": "int64"
},
{
"name": "Data_Quality_Level",
"col_type": "object"
},
{
"name": "AERONET_Instrument_Number",
"col_type": "int64"
},
{
"name": "AERONET_Site_Name",
"col_type": "object"
},
{
"name": "Site_Latitude(Degrees)",
"col_type": "float64"
},
{
"name": "Site_Longitude(Degrees)",
"col_type": "float64"
},
{
"name": "Site_Elevation(m)",
"col_type": "float64"
}
]
},
"geoparquet": {
"href": "6a49d70a-e782-4d9d-8348-45151807d926.parquet",
"type": "application/vnd.apache.parquet",
"description": "Search result - GeoParquet Format",
"table:row_count": 11,
"table:columns": [
{
"name": "AERONET_Site",
"col_type": "object"
},
{
"name": "Date(dd:mm:yyyy)",
"col_type": "object"
},
{
"name": "Time(hh:mm:ss)",
"col_type": "object"
},
{
"name": "Day_of_Year",
"col_type": "int64"
},
{
"name": "AOD_1640nm",
"col_type": "float64"
},
{
"name": "AOD_1020nm",
"col_type": "float64"
},
{
"name": "AOD_870nm",
"col_type": "float64"
},
{
"name": "AOD_865nm",
"col_type": "float64"
},
{
"name": "AOD_779nm",
"col_type": "float64"
},
{
"name": "AOD_675nm",
"col_type": "float64"
},
{
"name": "AOD_667nm",
"col_type": "float64"
},
{
"name": "AOD_620nm",
"col_type": "float64"
},
{
"name": "AOD_560nm",
"col_type": "float64"
},
{
"name": "AOD_555nm",
"col_type": "float64"
},
{
"name": "AOD_551nm",
"col_type": "float64"
},
{
"name": "AOD_532nm",
"col_type": "float64"
},
{
"name": "AOD_531nm",
"col_type": "float64"
},
{
"name": "AOD_510nm",
"col_type": "float64"
},
{
"name": "AOD_500nm",
"col_type": "float64"
},
{
"name": "AOD_490nm",
"col_type": "float64"
},
{
"name": "AOD_443nm",
"col_type": "float64"
},
{
"name": "AOD_440nm",
"col_type": "float64"
},
{
"name": "AOD_412nm",
"col_type": "float64"
},
{
"name": "AOD_400nm",
"col_type": "float64"
},
{
"name": "AOD_380nm",
"col_type": "float64"
},
{
"name": "AOD_340nm",
"col_type": "float64"
},
{
"name": "Precipitable_Water(cm)",
"col_type": "float64"
},
{
"name": "AOD_681nm",
"col_type": "float64"
},
{
"name": "AOD_709nm",
"col_type": "float64"
},
{
"name": "AOD_Empty",
"col_type": "float64"
},
{
"name": "AOD_Empty.1",
"col_type": "float64"
},
{
"name": "AOD_Empty.2",
"col_type": "float64"
},
{
"name": "AOD_Empty.3",
"col_type": "float64"
},
{
"name": "AOD_Empty.4",
"col_type": "float64"
},
{
"name": "440-870_Angstrom_Exponent",
"col_type": "float64"
},
{
"name": "380-500_Angstrom_Exponent",
"col_type": "float64"
},
{
"name": "440-675_Angstrom_Exponent",
"col_type": "float64"
},
{
"name": "500-870_Angstrom_Exponent",
"col_type": "float64"
},
{
"name": "340-440_Angstrom_Exponent",
"col_type": "float64"
},
{
"name": "440-675_Angstrom_Exponent[Polar]",
"col_type": "float64"
},
{
"name": "N[AOD_1640nm]",
"col_type": "int64"
},
{
"name": "N[AOD_1020nm]",
"col_type": "int64"
},
{
"name": "N[AOD_870nm]",
"col_type": "int64"
},
{
"name": "N[AOD_865nm]",
"col_type": "int64"
},
{
"name": "N[AOD_779nm]",
"col_type": "int64"
},
{
"name": "N[AOD_675nm]",
"col_type": "int64"
},
{
"name": "N[AOD_667nm]",
"col_type": "int64"
},
{
"name": "N[AOD_620nm]",
"col_type": "int64"
},
{
"name": "N[AOD_560nm]",
"col_type": "int64"
},
{
"name": "N[AOD_555nm]",
"col_type": "int64"
},
{
"name": "N[AOD_551nm]",
"col_type": "int64"
},
{
"name": "N[AOD_532nm]",
"col_type": "int64"
},
{
"name": "N[AOD_531nm]",
"col_type": "int64"
},
{
"name": "N[AOD_510nm]",
"col_type": "int64"
},
{
"name": "N[AOD_500nm]",
"col_type": "int64"
},
{
"name": "N[AOD_490nm]",
"col_type": "int64"
},
{
"name": "N[AOD_443nm]",
"col_type": "int64"
},
{
"name": "N[AOD_440nm]",
"col_type": "int64"
},
{
"name": "N[AOD_412nm]",
"col_type": "int64"
},
{
"name": "N[AOD_400nm]",
"col_type": "int64"
},
{
"name": "N[AOD_380nm]",
"col_type": "int64"
},
{
"name": "N[AOD_340nm]",
"col_type": "int64"
},
{
"name": "N[Precipitable_Water(cm)]",
"col_type": "int64"
},
{
"name": "N[AOD_681nm]",
"col_type": "int64"
},
{
"name": "N[AOD_709nm]",
"col_type": "int64"
},
{
"name": "N[AOD_Empty]",
"col_type": "int64"
},
{
"name": "N[AOD_Empty].1",
"col_type": "int64"
},
{
"name": "N[AOD_Empty].2",
"col_type": "int64"
},
{
"name": "N[AOD_Empty].3",
"col_type": "int64"
},
{
"name": "N[AOD_Empty].4",
"col_type": "int64"
},
{
"name": "N[440-870_Angstrom_Exponent]",
"col_type": "int64"
},
{
"name": "N[380-500_Angstrom_Exponent]",
"col_type": "int64"
},
{
"name": "N[440-675_Angstrom_Exponent]",
"col_type": "int64"
},
{
"name": "N[500-870_Angstrom_Exponent]",
"col_type": "int64"
},
{
"name": "N[340-440_Angstrom_Exponent]",
"col_type": "int64"
},
{
"name": "N[440-675_Angstrom_Exponent[Polar]]",
"col_type": "int64"
},
{
"name": "Data_Quality_Level",
"col_type": "object"
},
{
"name": "AERONET_Instrument_Number",
"col_type": "int64"
},
{
"name": "AERONET_Site_Name",
"col_type": "object"
},
{
"name": "Site_Latitude(Degrees)",
"col_type": "float64"
},
{
"name": "Site_Longitude(Degrees)",
"col_type": "float64"
},
{
"name": "Site_Elevation(m)",
"col_type": "float64"
},
{
"name": "geometry",
"col_type": "geometry"
},
{
"name": "datetime",
"col_type": "datetime64[ns]"
}
]
}
}
}
Visualize the results as Data Frame¶
In [3]:
Copied!
from geopandas import read_parquet
from geopandas.geodataframe import GeoDataFrame
geoparquet_file: str = item.get_assets()['geoparquet'].href
geoparquet_data: GeoDataFrame = read_parquet(geoparquet_file)
geoparquet_data
from geopandas import read_parquet
from geopandas.geodataframe import GeoDataFrame
geoparquet_file: str = item.get_assets()['geoparquet'].href
geoparquet_data: GeoDataFrame = read_parquet(geoparquet_file)
geoparquet_data
Out[3]:
| AERONET_Site | Date(dd:mm:yyyy) | Time(hh:mm:ss) | Day_of_Year | AOD_1640nm | AOD_1020nm | AOD_870nm | AOD_865nm | AOD_779nm | AOD_675nm | ... | N[340-440_Angstrom_Exponent] | N[440-675_Angstrom_Exponent[Polar]] | Data_Quality_Level | AERONET_Instrument_Number | AERONET_Site_Name | Site_Latitude(Degrees) | Site_Longitude(Degrees) | Site_Elevation(m) | geometry | datetime | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Cart_Site | 31:05:2000 | 12:00:00 | 152 | -999.0 | 0.035200 | 0.051679 | -999.0 | -999.0 | 0.061963 | ... | 34 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-05-31 12:00:00 |
| 1 | Cart_Site | 01:06:2000 | 12:00:00 | 153 | -999.0 | 0.049179 | 0.065103 | -999.0 | -999.0 | 0.075437 | ... | 13 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-06-01 12:00:00 |
| 2 | Cart_Site | 04:06:2000 | 12:00:00 | 156 | -999.0 | 0.110029 | 0.141054 | -999.0 | -999.0 | 0.200035 | ... | 2 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-06-04 12:00:00 |
| 3 | Cart_Site | 05:06:2000 | 12:00:00 | 157 | -999.0 | 0.031582 | 0.042280 | -999.0 | -999.0 | 0.046784 | ... | 55 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-06-05 12:00:00 |
| 4 | Cart_Site | 06:06:2000 | 12:00:00 | 158 | -999.0 | 0.053464 | 0.077199 | -999.0 | -999.0 | 0.101528 | ... | 25 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-06-06 12:00:00 |
| 5 | Cart_Site | 07:06:2000 | 12:00:00 | 159 | -999.0 | 0.041645 | 0.057704 | -999.0 | -999.0 | 0.073657 | ... | 16 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-06-07 12:00:00 |
| 6 | Cart_Site | 08:06:2000 | 12:00:00 | 160 | -999.0 | 0.026916 | 0.039999 | -999.0 | -999.0 | 0.051110 | ... | 38 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-06-08 12:00:00 |
| 7 | Cart_Site | 09:06:2000 | 12:00:00 | 161 | -999.0 | 0.086260 | 0.115657 | -999.0 | -999.0 | 0.163068 | ... | 7 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-06-09 12:00:00 |
| 8 | Cart_Site | 11:06:2000 | 12:00:00 | 163 | -999.0 | 0.027895 | 0.040069 | -999.0 | -999.0 | 0.048234 | ... | 6 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-06-11 12:00:00 |
| 9 | Cart_Site | 12:06:2000 | 12:00:00 | 164 | -999.0 | 0.079964 | 0.094614 | -999.0 | -999.0 | 0.109477 | ... | 9 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-06-12 12:00:00 |
| 10 | Cart_Site | 13:06:2000 | 12:00:00 | 165 | -999.0 | 0.090479 | 0.104427 | -999.0 | -999.0 | 0.113828 | ... | 16 | 0 | lev20 | 99 | Cart_Site | 36.60667 | -97.48639 | 318.0 | POINT (-97.48639 36.60667) | 2000-06-13 12:00:00 |
11 rows × 84 columns
Visualize results on Map screen¶
In [4]:
Copied!
from folium import (
GeoJson,
LayerControl,
Map
)
from folium.plugins import (
Fullscreen
)
from IPython.display import (
display,
HTML
)
map: Map = Map()
layer_control = LayerControl(position="topright", collapsed=True)
fullscreen = Fullscreen()
style = {"fillColor": "#00000000", "color": "#0000ff", "weight": 1}
footprints: GeoJson = GeoJson(
geoparquet_data.dissolve(by='AERONET_Site').to_json(default=str),
name="Stac Item footprints",
style_function=lambda x: style,
control=True,
)
footprints.add_to(map)
layer_control.add_to(map)
fullscreen.add_to(map)
map.fit_bounds(map.get_bounds()) # type: ignore not to important for the demo
map
from folium import (
GeoJson,
LayerControl,
Map
)
from folium.plugins import (
Fullscreen
)
from IPython.display import (
display,
HTML
)
map: Map = Map()
layer_control = LayerControl(position="topright", collapsed=True)
fullscreen = Fullscreen()
style = {"fillColor": "#00000000", "color": "#0000ff", "weight": 1}
footprints: GeoJson = GeoJson(
geoparquet_data.dissolve(by='AERONET_Site').to_json(default=str),
name="Stac Item footprints",
style_function=lambda x: style,
control=True,
)
footprints.add_to(map)
layer_control.add_to(map)
fullscreen.add_to(map)
map.fit_bounds(map.get_bounds()) # type: ignore not to important for the demo
map
Out[4]:
Make this Notebook Trusted to load map: File -> Trust Notebook