Documentation Index
Fetch the complete documentation index at: https://mintlify.com/NASAARSET/PM2.5_AQ_Online_2026/llms.txt
Use this file to discover all available pages before exploring further.
F_subset_and_combine is the primary data-ingestion utility in the ARSET PM2.5 workflow. It accepts a list of file paths (typically NetCDF or HDF5 files from satellite products such as SatPM2.5 or MERRA-2), opens and concatenates them along the time dimension, and then trims the merged dataset to the latitude/longitude bounding box and the start/end timestamps you specify. The result is a compact, analysis-ready xarray.Dataset that only contains the region and period of interest — making every downstream step faster and less memory-intensive.
Use this function at the very beginning of a notebook session, right after you have assembled your file list with glob.glob or a similar utility, and before calling F_plot_map or F_compute_metrics.
Parameters
List of file paths to load and concatenate. All files must share the same
grid structure and variable names. Typical source: the output of
glob.glob('/path/to/SatPM/*.nc') sorted chronologically.Minimum (western) longitude of the spatial bounding box, in decimal degrees.
Use negative values for the Western Hemisphere (e.g.,
-76.0 for western
Chile).Minimum (southern) latitude of the spatial bounding box, in decimal degrees.
Use negative values for the Southern Hemisphere (e.g.,
-46.0 for
southern Patagonia).Maximum (eastern) longitude of the spatial bounding box, in decimal degrees.
Maximum (northern) latitude of the spatial bounding box, in decimal degrees.
Start of the time window of interest. Must be a
numpy.datetime64 object.
Records with timestamps strictly before this value are excluded.End of the time window of interest. Must be a
numpy.datetime64 object.
Records with timestamps strictly after this value are excluded.Name of the latitude dimension/coordinate in the source files. Override this
if your files use a non-standard name such as
'latitude', 'Lat', or
'y'.Name of the longitude dimension/coordinate in the source files. Override
this if your files use
'longitude', 'Lon', or 'x'.Name of the time dimension/coordinate in the source files. Override this if
your files use
'Time', 'datetime', etc.An optional function that accepts a file path string and returns a
numpy.datetime64 timestamp. Provide this when the source files do not
contain an embedded time coordinate (e.g., monthly SatPM2.5 files whose
timestamp is encoded only in the filename). The returned timestamp is used
to populate the time dimension for that file before concatenation.Return Value
An
xarray.Dataset (or DataArray) containing all variables from the
source files, trimmed to the specified spatial bounding box and time window.
Dimension coordinates are lat, lon, and time (or the custom names
supplied via s_lat, s_lon, s_time). The dataset is suitable for
direct use with F_plot_map and F_compute_metrics.Usage Example
The following example loads monthly SatPM2.5 files for the Biobío region of Chile (covering the 2023 calendar year), parses timestamps from filenames, and clips to the region bounding box.All files in
l_files are opened with xarray.open_dataset and concatenated
with xarray.concat along the time dimension before the spatial and temporal
subsetting is applied. For very large collections of files, consider
pre-filtering the list to only those files that fall within the time window
before passing it to F_subset_and_combine.Related
F_plot_map— visualise the clipped dataset on a map.F_compute_metrics— compare the clipped dataset against ground observations.F_get_OpenAQ_from_API— retrieve collocated ground-based measurements for the same bounding box.- SatPM2.5 Data Source — details on the satellite product files consumed by this function.
- MERRA-2 CNN Data Source — details on the MERRA-2-derived CNN product files.
