access OCI data
-
- Posts: 5
- Joined: Mon Apr 21, 2025 11:16 pm America/New_York
access OCI data
Hi everyone,
I'm trying to access Level-3 chlorophyll-a data from NASA's PACE mission (PACE_OCI_L3M_CHL_NRT) using the earthaccess Python package. The response indicates no granules are found:
Details:
App: Python-based ingestion pipeline using earthaccess, xarray, pandas, and pymysql
Data Product: PACE_OCI_L3M_CHL_NRT
Dataset: Level-3 Chlorophyll-a concentration
Data Variable: chlor_a (automatically parsed from NetCDF)
Access Method: earthaccess.search_data() with these parameters:
short_name="PACE_OCI_L3M_CHL_NRT"
temporal=("2024-12-15", "2025-01-07")
bounding_box=(-61.5, -53.2, -57.5, -50.9) (Falkland Islands region)
cloud_cover=(0, 50)
Platform: Accessing via NASA Earthdata Cloud (earthaccess)
Operating System: Windows 11
Earthaccess Version: (latest pip install)
Would really appreciate guidance — is the PACE_OCI_L3M_CHL_NRT dataset not available yet for this region/date, or am I structuring the request wrong?
Current code:
# 📁 config.py
import pathlib
# Earthaccess will handle authentication
username =
password =
# This will prompt once and store credentials in ~/.netrc
import earthaccess
auth = earthaccess.login(persist=True)
# Region of interest: Chesapeake Bay area (guaranteed to have data)
bounding_box = (-61.5, -53.2, -57.5, -50.9)
start_date = "2024-12-15"
end_date = "2025-01-07"
iron_release_date = "2024-12-30"
# Specific OCI L3M chlorophyll product
product_list = ["PACE_OCI_L3M_CHL_NRT"]
# Output directory for downloads
download_dir = pathlib.Path("downloads")
download_dir.mkdir(exist_ok=True)
# Cloud cover range (optional filter)
cloud_cover = (0, 50)
# MySQL DB config (DigitalOcean)
db_config =
# 📁 ingest.py
import os
import xarray as xr
import pandas as pd
from config import product_list, bounding_box, cloud_cover, download_dir, iron_release_date , start_date, end_date
import earthaccess
def fetch_and_process():
all_metrics = [] # store results here
for product in product_list:
print(f"🔍 Searching for granules for: {product}")
# Search with Earthaccess
results = earthaccess.search_data(
short_name=product,
temporal=(start_date, end_date),
bounding_box=bounding_box,
cloud_cover=cloud_cover
)
if not results:
print(f"⚠️ No granules found for {product}")
continue
print(f"📥 Downloading {len(results)} granules...")
paths = earthaccess.download(results, download_dir) # download locally
for file_path in paths:
try:
ds = xr.open_dataset(file_path)
date = file_path.name.split(".")[1][:8] # extract date from filename
period = "before" if date < iron_release_date.replace("-", "") else "after"
for var in ds.data_vars:
data = ds[var]
all_metrics.append({
"product": product,
"variable": var,
"filename": file_path.name,
"date": pd.to_datetime(date),
"period": period,
"mean": float(data.mean(skipna=True).values),
"max": float(data.max(skipna=True).values)
})
except Exception as e:
print(f"⚠️ Failed to read {file_path.name}: {e}")
os.remove(file_path) # clean up
return pd.DataFrame(all_metrics)
if __name__ == "__main__":
df = fetch_and_process()
print(df.head()) # Optional: preview results
Thanks in advance!
— Will
I'm trying to access Level-3 chlorophyll-a data from NASA's PACE mission (PACE_OCI_L3M_CHL_NRT) using the earthaccess Python package. The response indicates no granules are found:
Details:
App: Python-based ingestion pipeline using earthaccess, xarray, pandas, and pymysql
Data Product: PACE_OCI_L3M_CHL_NRT
Dataset: Level-3 Chlorophyll-a concentration
Data Variable: chlor_a (automatically parsed from NetCDF)
Access Method: earthaccess.search_data() with these parameters:
short_name="PACE_OCI_L3M_CHL_NRT"
temporal=("2024-12-15", "2025-01-07")
bounding_box=(-61.5, -53.2, -57.5, -50.9) (Falkland Islands region)
cloud_cover=(0, 50)
Platform: Accessing via NASA Earthdata Cloud (earthaccess)
Operating System: Windows 11
Earthaccess Version: (latest pip install)
Would really appreciate guidance — is the PACE_OCI_L3M_CHL_NRT dataset not available yet for this region/date, or am I structuring the request wrong?
Current code:
# 📁 config.py
import pathlib
# Earthaccess will handle authentication
username =
password =
# This will prompt once and store credentials in ~/.netrc
import earthaccess
auth = earthaccess.login(persist=True)
# Region of interest: Chesapeake Bay area (guaranteed to have data)
bounding_box = (-61.5, -53.2, -57.5, -50.9)
start_date = "2024-12-15"
end_date = "2025-01-07"
iron_release_date = "2024-12-30"
# Specific OCI L3M chlorophyll product
product_list = ["PACE_OCI_L3M_CHL_NRT"]
# Output directory for downloads
download_dir = pathlib.Path("downloads")
download_dir.mkdir(exist_ok=True)
# Cloud cover range (optional filter)
cloud_cover = (0, 50)
# MySQL DB config (DigitalOcean)
db_config =
# 📁 ingest.py
import os
import xarray as xr
import pandas as pd
from config import product_list, bounding_box, cloud_cover, download_dir, iron_release_date , start_date, end_date
import earthaccess
def fetch_and_process():
all_metrics = [] # store results here
for product in product_list:
print(f"🔍 Searching for granules for: {product}")
# Search with Earthaccess
results = earthaccess.search_data(
short_name=product,
temporal=(start_date, end_date),
bounding_box=bounding_box,
cloud_cover=cloud_cover
)
if not results:
print(f"⚠️ No granules found for {product}")
continue
print(f"📥 Downloading {len(results)} granules...")
paths = earthaccess.download(results, download_dir) # download locally
for file_path in paths:
try:
ds = xr.open_dataset(file_path)
date = file_path.name.split(".")[1][:8] # extract date from filename
period = "before" if date < iron_release_date.replace("-", "") else "after"
for var in ds.data_vars:
data = ds[var]
all_metrics.append({
"product": product,
"variable": var,
"filename": file_path.name,
"date": pd.to_datetime(date),
"period": period,
"mean": float(data.mean(skipna=True).values),
"max": float(data.max(skipna=True).values)
})
except Exception as e:
print(f"⚠️ Failed to read {file_path.name}: {e}")
os.remove(file_path) # clean up
return pd.DataFrame(all_metrics)
if __name__ == "__main__":
df = fetch_and_process()
print(df.head()) # Optional: preview results
Thanks in advance!
— Will
Filters:
-
- Subject Matter Expert
- Posts: 455
- Joined: Fri Feb 05, 2021 9:17 am America/New_York
- Has thanked: 1 time
- Been thanked: 10 times
Re: access OCI data
The time period you are referencing should have refined CHL data, not NRT. Remove NRT from your datatype and retry your query.
Tommy
Tommy
-
- Posts: 5
- Joined: Mon Apr 21, 2025 11:16 pm America/New_York
Re: access OCI data
Hey there,
Unfortuntly i try this and still get 503 Server Error: Service Temporarily Unavailable.
server at obdaac-tea.earthdatacloud.nasa.gov is not currently accepting connections for the files and i try querying multiple times in the day and different days and i get nothing.
Unfortuntly i try this and still get 503 Server Error: Service Temporarily Unavailable.
server at obdaac-tea.earthdatacloud.nasa.gov is not currently accepting connections for the files and i try querying multiple times in the day and different days and i get nothing.
-
- User Services
- Posts: 27
- Joined: Thu Dec 12, 2024 8:45 am America/New_York
- Has thanked: 1 time
- Been thanked: 3 times
Re: access OCI data
Hi Will, were you able to retrieve your data or are you still getting a 503 error?
-
- Posts: 5
- Joined: Mon Apr 21, 2025 11:16 pm America/New_York
Re: access OCI data
do you think it makes sense to get on a call, if so do you have an time and date you are available as well as your email to send an invite :)
-
- Posts: 5
- Joined: Mon Apr 21, 2025 11:16 pm America/New_York
Re: access OCI data
Hey, still getting error, can we jump on a call. let me know what date/ time suits you and what time zone youre from :)
-
- User Services
- Posts: 44
- Joined: Mon Dec 16, 2024 8:43 am America/New_York
- Been thanked: 3 times
Re: access OCI data
A 503 error indicates a server-side error, which may be intermittent. I was able to run your code (after editing it to restore proper indentation - in the future you can wrap the text in the "code" element - see the angle bracket icon above -to preserve indentation). I did have to comment out the cloud_cover option in the earthaccess.search_data call, since the L3m collection doesn't report cloud percentage, but then it work as expected. (as an aside, I did notice there are other issues with your code after the earthaccess dowload that are not relevant to the access issue.)
If you are still getting 503s, send your IP address in an email to connection_problems@oceancolor.sci.gsfc.nasa.gov and our network folks can see if there is an issue with the connection (like a potential block).
Regards,
Sean
If you are still getting 503s, send your IP address in an email to connection_problems@oceancolor.sci.gsfc.nasa.gov and our network folks can see if there is an issue with the connection (like a potential block).
Regards,
Sean