This post shows some examples of query and download of PACE_OCI data.
You can query based on a sensor, date and location. Currently only querying for a single lon/lat point is supported. This function will return the urls and scene names. Note that start_date and end_date can be specified with/without time. If you specify start_date and end_date without time, and provide the same date for both, the search will be performed between midnight and midnight the next day:
Code: Select all
## PACE query La Plata
sensor = 'PACE_OCI'
lon = -57.55411154916672
lat = -34.803384076441866
start_date = '2024-04-28T16:00:00'
end_date = '2024-04-28T17:00:00'
urls, scenes = ac.api.earthdata.query(sensor, lon = lon, lat = lat,
start_date = start_date, end_date = end_date)
The same function can be used to download, by setting download = True and a download path. If a local copy of the file exists, the download will be skipped unless override = True. Now this function returns the local paths of the files.
Code: Select all
## PACE query La Plata
sensor = 'PACE_OCI'
lon = -57.55411154916672
lat = -34.803384076441866
start_date = '2024-04-28T16:00:00'
end_date = '2024-04-28T17:00:00'
## download scenes
download = True
local_directory = '../Input/LaPlata/PACE'
local_scenes = ac.api.earthdata.query(sensor, lon = lon, lat = lat,
start_date = start_date, end_date = end_date,
download = download, local_directory = local_directory)
If you know the scene name you can directly download the scene. This is currently only supported for PACE:
Code: Select all
## PACE download La Plata scene
sensor = 'PACE_OCI'
scene = 'PACE_OCI.20240428T163152.L1B.nc'
download = True
local_directory = '../Input/LaPlata/PACE'
local_scenes = ac.api.earthdata.query(sensor, scene = scene,
download = download, local_directory = local_directory)
[Edit] I have now added support for downloading L2 data, by setting pace_oci_level = 'L2' and specifying level2_type one of AOP (default), BGC, IOP, or PAR. For example:
Code: Select all
## PACE query La Plata
sensor = 'PACE_OCI'
lon = -57.55411154916672
lat = -34.803384076441866
start_date = '2024-04-28T16:00:00'
end_date = '2024-04-28T17:00:00'
urls, scenes = ac.api.earthdata.query(sensor, lon = lon, lat = lat,
start_date = start_date, end_date = end_date, pace_oci_level = 'L2', level2_type = 'AOP')
[Edit2] Updated L2 download example from level2 = True to pace_oci_level = 'L2'. Different versions of the data download are now supported. By default pace_oci_version = 'v2.0' is used.