Introduction¶
Use cql2-json filters to interact with the AERONET API¶
See https://aeronet.gsfc.nasa.gov/print_web_data_help_v3.html for details
Decisions:
- AVG - Data Format, All points: AVG=10, use
[{"property": "data_format"}, "all-points"] - AVG - Data Format, Daily average: AVG=20, use
[{"property": "data_format"}, "daily-average"]
In [1]:
Copied!
from pygeofilter_aeronet.evaluator import to_aeronet_api
cql2_filter = {
"op": "and",
"args": [
{"op": "eq", "args": [{"property": "site"}, "Cart_Site"]},
{"op": "eq", "args": [{"property": "data_type"}, "AOD10"]},
{"op": "eq", "args": [{"property": "format"}, "csv"]},
{"op": "eq", "args": [{"property": "data_format"}, "daily-average"]},
{
"op": "t_after",
"args": [
{"property": "time"},
{"timestamp": "2023-02-01T00:00:00Z"},
],
},
{
"op": "t_before",
"args": [
{"property": "time"},
{"timestamp": "2023-02-28T23:59:59Z"},
],
},
],
}
query, _ = to_aeronet_api(cql2_filter)
query
from pygeofilter_aeronet.evaluator import to_aeronet_api
cql2_filter = {
"op": "and",
"args": [
{"op": "eq", "args": [{"property": "site"}, "Cart_Site"]},
{"op": "eq", "args": [{"property": "data_type"}, "AOD10"]},
{"op": "eq", "args": [{"property": "format"}, "csv"]},
{"op": "eq", "args": [{"property": "data_format"}, "daily-average"]},
{
"op": "t_after",
"args": [
{"property": "time"},
{"timestamp": "2023-02-01T00:00:00Z"},
],
},
{
"op": "t_before",
"args": [
{"property": "time"},
{"timestamp": "2023-02-28T23:59:59Z"},
],
},
],
}
query, _ = to_aeronet_api(cql2_filter)
query
Out[1]:
'site=Cart_Site&AOD10=1&if_no_html=1&AVG=20&year=2023&month=2&day=1&hour=0&year2=2023&month2=2&day2=28&hour2=23'