Metadata-Version: 2.4
Name: geepers
Version: 0.4.0
Summary: Download GPS data and compare to InSAR
Author-email: Scott Staniewicz <scott.j.staniewicz@jpl.nasa.gov>
License: 
                                         Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
           1. Definitions.
        
              "License" shall mean the terms and conditions for use, reproduction,
              and distribution as defined by Sections 1 through 9 of this document.
        
              "Licensor" shall mean the copyright owner or entity authorized by
              the copyright owner that is granting the License.
        
              "Legal Entity" shall mean the union of the acting entity and all
              other entities that control, are controlled by, or are under common
              control with that entity. For the purposes of this definition,
              "control" means (i) the power, direct or indirect, to cause the
              direction or management of such entity, whether by contract or
              otherwise, or (ii) ownership of fifty percent (50%) or more of the
              outstanding shares, or (iii) beneficial ownership of such entity.
        
              "You" (or "Your") shall mean an individual or Legal Entity
              exercising permissions granted by this License.
        
              "Source" form shall mean the preferred form for making modifications,
              including but not limited to software source code, documentation
              source, and configuration files.
        
              "Object" form shall mean any form resulting from mechanical
              transformation or translation of a Source form, including but
              not limited to compiled object code, generated documentation,
              and conversions to other media types.
        
              "Work" shall mean the work of authorship, whether in Source or
              Object form, made available under the License, as indicated by a
              copyright notice that is included in or attached to the work
              (an example is provided in the Appendix below).
        
              "Derivative Works" shall mean any work, whether in Source or Object
              form, that is based on (or derived from) the Work and for which the
              editorial revisions, annotations, elaborations, or other modifications
              represent, as a whole, an original work of authorship. For the purposes
              of this License, Derivative Works shall not include works that remain
              separable from, or merely link (or bind by name) to the interfaces of,
              the Work and Derivative Works thereof.
        
              "Contribution" shall mean any work of authorship, including
              the original version of the Work and any modifications or additions
              to that Work or Derivative Works thereof, that is intentionally
              submitted to Licensor for inclusion in the Work by the copyright owner
              or by an individual or Legal Entity authorized to submit on behalf of
              the copyright owner. For the purposes of this definition, "submitted"
              means any form of electronic, verbal, or written communication sent
              to the Licensor or its representatives, including but not limited to
              communication on electronic mailing lists, source code control systems,
              and issue tracking systems that are managed by, or on behalf of, the
              Licensor for the purpose of discussing and improving the Work, but
              excluding communication that is conspicuously marked or otherwise
              designated in writing by the copyright owner as "Not a Contribution."
        
              "Contributor" shall mean Licensor and any individual or Legal Entity
              on behalf of whom a Contribution has been received by Licensor and
              subsequently incorporated within the Work.
        
           2. Grant of Copyright License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              copyright license to reproduce, prepare Derivative Works of,
              publicly display, publicly perform, sublicense, and distribute the
              Work and such Derivative Works in Source or Object form.
        
           3. Grant of Patent License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              (except as stated in this section) patent license to make, have made,
              use, offer to sell, sell, import, and otherwise transfer the Work,
              where such license applies only to those patent claims licensable
              by such Contributor that are necessarily infringed by their
              Contribution(s) alone or by combination of their Contribution(s)
              with the Work to which such Contribution(s) was submitted. If You
              institute patent litigation against any entity (including a
              cross-claim or counterclaim in a lawsuit) alleging that the Work
              or a Contribution incorporated within the Work constitutes direct
              or contributory patent infringement, then any patent licenses
              granted to You under this License for that Work shall terminate
              as of the date such litigation is filed.
        
           4. Redistribution. You may reproduce and distribute copies of the
              Work or Derivative Works thereof in any medium, with or without
              modifications, and in Source or Object form, provided that You
              meet the following conditions:
        
              (a) You must give any other recipients of the Work or
                  Derivative Works a copy of this License; and
        
              (b) You must cause any modified files to carry prominent notices
                  stating that You changed the files; and
        
              (c) You must retain, in the Source form of any Derivative Works
                  that You distribute, all copyright, patent, trademark, and
                  attribution notices from the Source form of the Work,
                  excluding those notices that do not pertain to any part of
                  the Derivative Works; and
        
              (d) If the Work includes a "NOTICE" text file as part of its
                  distribution, then any Derivative Works that You distribute must
                  include a readable copy of the attribution notices contained
                  within such NOTICE file, excluding those notices that do not
                  pertain to any part of the Derivative Works, in at least one
                  of the following places: within a NOTICE text file distributed
                  as part of the Derivative Works; within the Source form or
                  documentation, if provided along with the Derivative Works; or,
                  within a display generated by the Derivative Works, if and
                  wherever such third-party notices normally appear. The contents
                  of the NOTICE file are for informational purposes only and
                  do not modify the License. You may add Your own attribution
                  notices within Derivative Works that You distribute, alongside
                  or as an addendum to the NOTICE text from the Work, provided
                  that such additional attribution notices cannot be construed
                  as modifying the License.
        
              You may add Your own copyright statement to Your modifications and
              may provide additional or different license terms and conditions
              for use, reproduction, or distribution of Your modifications, or
              for any such Derivative Works as a whole, provided Your use,
              reproduction, and distribution of the Work otherwise complies with
              the conditions stated in this License.
        
           5. Submission of Contributions. Unless You explicitly state otherwise,
              any Contribution intentionally submitted for inclusion in the Work
              by You to the Licensor shall be under the terms and conditions of
              this License, without any additional terms or conditions.
              Notwithstanding the above, nothing herein shall supersede or modify
              the terms of any separate license agreement you may have executed
              with Licensor regarding such Contributions.
        
           6. Trademarks. This License does not grant permission to use the trade
              names, trademarks, service marks, or product names of the Licensor,
              except as required for reasonable and customary use in describing the
              origin of the Work and reproducing the content of the NOTICE file.
        
           7. Disclaimer of Warranty. Unless required by applicable law or
              agreed to in writing, Licensor provides the Work (and each
              Contributor provides its Contributions) on an "AS IS" BASIS,
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
              implied, including, without limitation, any warranties or conditions
              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
              PARTICULAR PURPOSE. You are solely responsible for determining the
              appropriateness of using or redistributing the Work and assume any
              risks associated with Your exercise of permissions under this License.
        
           8. Limitation of Liability. In no event and under no legal theory,
              whether in tort (including negligence), contract, or otherwise,
              unless required by applicable law (such as deliberate and grossly
              negligent acts) or agreed to in writing, shall any Contributor be
              liable to You for damages, including any direct, indirect, special,
              incidental, or consequential damages of any character arising as a
              result of this License or out of the use or inability to use the
              Work (including but not limited to damages for loss of goodwill,
              work stoppage, computer failure or malfunction, or any and all
              other commercial damages or losses), even if such Contributor
              has been advised of the possibility of such damages.
        
           9. Accepting Warranty or Additional Liability. While redistributing
              the Work or Derivative Works thereof, You may choose to offer,
              and charge a fee for, acceptance of support, warranty, indemnity,
              or other liability obligations and/or rights consistent with this
              License. However, in accepting such obligations, You may act only
              on Your own behalf and on Your sole responsibility, not on behalf
              of any other Contributor, and only if You agree to indemnify,
              defend, and hold each Contributor harmless for any liability
              incurred by, or claims asserted against, such Contributor by reason
              of your accepting any such warranty or additional liability.
        
           END OF TERMS AND CONDITIONS
        
           APPENDIX: How to apply the Apache License to your work.
        
              To apply the Apache License to your work, attach the following
              boilerplate notice, with the fields enclosed by brackets "[]"
              replaced with your own identifying information. (Don't include
              the brackets!)  The text should be enclosed in the appropriate
              comment syntax for the file format. We also recommend that a
              file or class name and description of purpose be included on the
              same "printed page" as the copyright notice for easier
              identification within third-party archives.
        
          Copyright (c) 2025-2026 California Institute of Technology ("Caltech"). U.S. Government sponsorship acknowledged.
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
               http://www.apache.org/licenses/LICENSE-2.0
        
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
        
Project-URL: Homepage, https://github.com/opera-adt/geepers
Project-URL: Bug Tracker, https://github.com/opera-adt/geepers/issues
Project-URL: Discussions, https://github.com/opera-adt/geepers/discussions
Project-URL: Changelog, https://github.com/opera-adt/geepers/releases
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pyproj
Requires-Dist: requests
Requires-Dist: scipy
Requires-Dist: tqdm
Requires-Dist: tyro>=0.9.24
Provides-Extra: grid
Requires-Dist: shapely>=2; extra == "grid"
Provides-Extra: analysis
Requires-Dist: geopandas; extra == "analysis"
Requires-Dist: pyogrio; extra == "analysis"
Requires-Dist: xarray; extra == "analysis"
Requires-Dist: dask>=2025; extra == "analysis"
Requires-Dist: rasterio; extra == "analysis"
Requires-Dist: rioxarray; extra == "analysis"
Requires-Dist: zarr; extra == "analysis"
Requires-Dist: pandera; extra == "analysis"
Requires-Dist: lxml; extra == "analysis"
Requires-Dist: shapely>=2; extra == "analysis"
Provides-Extra: plot
Requires-Dist: matplotlib>=3.8; extra == "plot"
Requires-Dist: contextily; extra == "plot"
Provides-Extra: all
Requires-Dist: geepers[analysis,grid,plot]; extra == "all"
Provides-Extra: test
Requires-Dist: pre-commit; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-randomly; extra == "test"
Requires-Dist: pytest-recording>=0.13.2; extra == "test"
Requires-Dist: pytest-xdist; extra == "test"
Requires-Dist: ruff; extra == "test"
Requires-Dist: matplotlib>=3.8; extra == "test"
Dynamic: license-file

# geepers

[![Actions Status][actions-badge]][actions-link]
[![PyPI version][pypi-version]][pypi-link]
[![Documentation Status][rtd-badge]][rtd-link]

[![Conda-Forge][conda-badge]][conda-link]
[![GitHub Discussion][github-discussions-badge]][github-discussions-link]


<!-- prettier-ignore-start -->
[actions-badge]:            https://github.com/isce-framework/geepers/workflows/CI/badge.svg
[actions-link]:             https://github.com/isce-framework/geepers/actions
[conda-badge]:              https://img.shields.io/conda/vn/conda-forge/geepers
[conda-link]:               https://github.com/conda-forge/geepers-feedstock
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
[github-discussions-link]:  https://github.com/isce-framework/geepers/discussions
[pypi-link]:                https://pypi.org/project/geepers/
[pypi-platforms]:           https://img.shields.io/pypi/pyversions/geepers
[pypi-version]:             https://img.shields.io/pypi/v/geepers
[rtd-badge]:                https://readthedocs.org/projects/geepers/badge/?version=latest
[rtd-link]:                 https://opera-adt.github.io/geepers/docs/

<!-- prettier-ignore-end -->

## Overview

Geepers provides a unified interface to access GPS time series data from multiple sources and compare the time series to InSAR line-of-sight (LOS) measurements.

The current available GPS data sources are:

- `UnrSource`: [Nevada Geodetic Laboratory (UNR) GPS data](https://geodesy.unr.edu/)
- `UnrGridSource`: [Nevada Geodetic Laboratory (UNR) Gridded Data](https://geodesy.unr.edu/grid_timeseries/)
- `SideshowSource`: [Jet Propulsion Laboratory (JPL) Sideshow GPS data](https://sideshow.jpl.nasa.gov/post/series.html)

All sources implement a common interface through the `BaseGpsSource` class, making it easy to switch between data providers or combine data from multiple sources.

## Installation

geepers has a lean core and optional extras, so the operational DISP-CAL image
can install only GNSS retrieval:

| Install | What you get | Dependencies added |
|---|---|---|
| `pip install geepers` | GNSS retrieval: `UnrSource`, `UnrGridSource`, `SideshowSource` (plain DataFrames) | numpy, pandas, scipy, pyproj, requests, tqdm, tyro |
| `pip install "geepers[grid]"` | + GPS Imaging re-interpolation with exclusion areas, Euler poles and plate-motion tables | shapely |
| `pip install "geepers[analysis]"` | + InSAR comparison, MIDAS, strain, validation, schemas; sources return GeoDataFrames | geopandas, pyogrio, xarray, dask, rasterio, rioxarray, zarr, pandera, lxml |
| `pip install "geepers[plot]"` | + plotting | matplotlib, contextily |
| `pip install "geepers[all]"` | everything above | |

Without `[analysis]`, `stations()` and `timeseries_many()` return plain
`pandas.DataFrame`s with `lon`/`lat` columns and pandera validation is
skipped; with it installed the behaviour is the one shown below.

With [pixi](https://pixi.sh) (lock file committed):

```bash
pixi install -e dev                     # grid + analysis + test/docs tooling
pixi run -e dev pytest --record-mode none
pixi install -e ops                     # the core only, as in the operational image
```

## Quick Start

### Basic Usage

```python
from geepers.gps_sources import UnrSource

# Create a GPS data source
unr = UnrSource()

# Get station information within a bounding box
stations = unr.stations(bbox=(-120, 35, -115, 40))  # (west, south, east, north)
print(f"Found {len(stations)} stations")
print(stations[['name', 'lat', 'lon']].head())

# Load time series data for a specific station
timeseries = unr.timeseries('P123', frame='ENU', zero_by='mean')
print(timeseries.head())

# Load data for many stations into one GeoDataFrame

df_many = unr.timeseries_many(bbox=(-115, 32, -105, 37))
print(df_many.head())
```

## Example: Comparing GPS and InSAR Data

The InSAR/GNSS comparison workflow is offered by the `geepers` command line tool:

```bash
geepers \
    --los F33039_los_enu.tif \
    --timeseries-files displacement_20160711_*tif \
    --temporal-coherence-files temporal_coherence_*.tif \
    --similarity-files phase_similarity*.tif \
    --insar-buffer-meters 100 \
    --requirement-mm 3 0.5 \
    --wavelength 0.2384    # NISAR L-band; omit for Sentinel-1
```

Results are saved in the `GPS` folder by default: per-station time-series
and rate comparisons, plus the structure function (pairwise relative RMSE
vs station separation, checked against the requirement curve) and the
per-epoch network misfit. See
[How-To Guides](https://geepers.readthedocs.io/en/latest/how-to-guides/)
and the runnable
[validation notebook](docs/notebooks/gnss_insar_validation.ipynb).

## Analysis toolbox

Beyond data access and the comparison workflow, geepers ships analysis
modules for GNSS velocity fields (see
[Analysis modules](docs/analysis-modules.md) for usage and the
[tour notebook](docs/notebooks/geepers_tour.ipynb) for a runnable demo):

| Module | Purpose |
|---|---|
| `geepers.midas` | Robust MIDAS velocities (Blewitt et al., 2016) |
| `geepers.trend` | Velocities with realistic uncertainties under power-law + white noise (validated against HectorP); fast Whittle method and parallel `estimate_trend_many` for networks |
| `geepers.linearity` | Linearity test (linear vs quadratic vs piecewise under colored noise) and the validity horizon of a rate |
| `geepers.variability` | Temporal & spatial velocity-stability metrics, spatial structure function |
| `geepers.quality` | Gap percentage, station quality, reference selection |
| `geepers.steps` | Detection of uncatalogued jumps (AIC sliding window) |
| `geepers.cme` | Common-mode error estimation/removal (PCA/ICA) |
| `geepers.gps_imaging` | Robust weighted-median interpolation (Hammond et al., 2016 GPS Imaging port) |
| `geepers.collocation` | Least-squares collocation, ordinary kriging, plate-boundary separation |
| `geepers.surface` | Polynomial trend surfaces for remove-restore interpolation |
| `geepers.spline` | Elastically coupled east/north spline interpolation (Sandwell & Wessel, 2016) |
| `geepers.cross_validation` | Spatially blocked cross-validation for choosing interpolation parameters and comparing methods |
| `geepers.gridding` | Rebuild UNR-style gridded rates and daily time series from station positions (OPERA DISP-CAL ATBD recipe) |
| `geepers.euler` | Euler pole estimation and plate-motion prediction |
| `geepers.strain` | Strain-rate/rotation fields from gridded velocities |
| `geepers.masks` | Distance and convex-hull masks to blank grid nodes not supported by stations |
| `geepers.validation` | GNSS-vs-InSAR validation: velocity scatter (MAD/RMSE/R²), structure function, semivariogram, per-epoch misfit |
| `geepers.synthetic` | Schema-valid synthetic networks and series for testing |

An interactive MapLibre viewer for UNR gridded time series is hosted at
**[opera-adt.github.io/geepers](https://opera-adt.github.io/geepers/)**
(globe view, velocity/vector overlays, plate boundaries, per-point time
series). See the [viewer docs](scripts/README.md) to run it locally or
build your own dataset.

### Working with Multiple Sources

```python
from geepers.gps_sources import UnrSource, SideshowSource

# Compare data from different sources
unr = UnrSource()
jpl = SideshowSource()

# Get the same station from both sources
station_id = 'P123'
unr_data = unr.timeseries(station_id, frame='ENU')
jpl_data = jpl.timeseries(station_id, frame='ENU')

print(f"UNR: {len(unr_data)} observations")
print(f"JPL: {len(jpl_data)} observations")
```

## Data Sources

### 1. UnrSource - Nevada Geodetic Laboratory (UNR)

The UNR source provides access to high-quality GPS time series data from the Nevada Geodetic Laboratory.

```python
from geepers.gps_sources import UnrSource

unr = UnrSource()

# Get all available stations
all_stations = unr.stations()

# Load time series with date filtering
data = unr.timeseries(
    'P123',
    frame='ENU',                    # 'ENU' or 'XYZ'
    start_date='2020-01-01',       # ISO format date
    end_date='2023-12-31',
    zero_by='mean',                # 'mean' or 'start'
    download_if_missing=True       # Download if not cached
)
```

Data characteristics:
- High spatial coverage
- Both ENU and XYZ coordinate frames

### 2. UnrGridSource - Nevada Geodetic Laboratory (UNR) Gridded Data

The UNR Grid source provides interpolated GPS velocities on a regular grid, useful for regional studies.

```python
from geepers.gps_sources import UnrGridSource

grid = UnrGridSource()

# Get grid points within a region
grid_points = grid.stations(bbox=(-120, 35, -115, 40))

# Load grid time series (note: different parameters)
data = grid.timeseries(
    '000123',                      # 6-digit grid point ID
    frame='ENU',                   # Only ENU supported
    plate='IGS14',                 # 'NA', 'PA', or 'IGS14'
    zero_by='mean'
)

```

Data characteristics:
- Reprocessed data onto a regular hexagonal grid (~10-20 km)
- ENU coordinates only
- Different plate reference frames
- Regional coverage

### 3. SideshowSource - Jet Propulsion Laboratory (JPL) Sideshow

[JPL's Sideshow](https://sideshow.jpl.nasa.gov/post/series.html) provides high quality processed GPS time series using the GipsyX software.

```python
from geepers.gps_sources import SideshowSource

jpl = SideshowSource()

# Get all available stations
stations = jpl.stations()

# Load time series for a specific station
data = jpl.timeseries(
    'AB01',
    frame='ENU',
    start_date='2010-01-01',
    end_date='2020-12-31'
)
```

Data characteristics:
- Reprocessed for consistency
- High precision

## Common Workflows

### 1. Regional GPS Analysis

```python
from geepers.gps_sources import UnrSource
import matplotlib.pyplot as plt

# Define study region (e.g., Southern California)
bbox = (-121, 34, -117, 36)  # (west, south, east, north)
# Get GPS stations in the region
unr = UnrSource()
stations = unr.stations(bbox=bbox)
print(f"Found {len(stations)} stations in California")

# Load data for all stations
df_all = unr.timeseries_many(bbox=bbox)
print(df_all.head())
#      id       date      east     north        up  sigma_east  sigma_north  sigma_up   corr_en   corr_eu   corr_nu         lon        lat         alt                     geometry
# 0  CHIR 2010-08-20  0.054361  0.027192 -0.007630    0.000737     0.000847  0.003072  0.058084 -0.134020 -0.073392 -109.366439  32.005681  1614.17452  POINT (-109.36644 32.00568)
# 1  CHIR 2010-08-21  0.056075  0.028543 -0.022277    0.000742     0.000844  0.003166  0.075097 -0.176761 -0.122798 -109.366439  32.005681  1614.17452  POINT (-109.36644 32.00568)
# ...


# Plot time series from 2 example stations
df = df_all[df_all.id.isin (["BAK1", "P809"])]
df_wide = df.pivot(index="date", columns=["id"], values=["east", "north", "up"])

fig, axes = plt.subplots(3, 1, figsize=(12, 8), sharex=True)
for i, component in enumerate(['east', 'north', 'up']):
    df_wide[component].plot(ax=axes[i])
    axes[i].set_ylabel(f'{component.title()} (mm)')

plt.tight_layout()
plt.show()
```

![](docs/images/readme_ca_example1.png)

### 2. Spatial GPS Visualization

```python
import geopandas as gpd
import matplotlib.pyplot as plt
from geepers.gps_sources import UnrSource

# Get stations and plot on map
unr = UnrSource()
stations = unr.stations(bbox=(-121, 34, -117, 36))

# Create a simple map
fig, ax = plt.subplots(figsize=(10, 8))
stations.plot(ax=ax, markersize=50, alpha=0.6)

# Add basemap context
import contextily as ctx
ctx.add_basemap(ax, crs=stations.crs, source=ctx.providers.OpenStreetMap.Mapnik)

ax.set_title('GPS Stations in Southern California')
ax.set_xlabel('Longitude')
ax.set_ylabel('Latitude')
plt.show()
```

### 3. Data Quality Assessment

```python
# Assess data quality for a station
station_name = 'P123'
data = unr.timeseries(station_name)

# Basic statistics
print(f"Station: {station_name}")
print(f"Date range: {data['date'].min()} to {data['date'].max()}")
print(f"Number of observations: {len(data)}")

# Check uncertainties
print("\nUncertainty statistics (mm):")
for component in ['sigma_east', 'sigma_north', 'sigma_up']:
    sigma = data[component].describe()
    print(f"{component}: mean={sigma['mean']:.2f}, std={sigma['std']:.2f}")

# Plot uncertainties over time
fig, ax = plt.subplots(figsize=(12, 6))
for component, sigma_col in [('East', 'sigma_east'), ('North', 'sigma_north'), ('Up', 'sigma_up')]:
    ax.plot(data['date'], 1000 *data[sigma_col], label=f'{component} σ', alpha=0.7)

ax.set_ylabel('Uncertainty (mm)')
ax.set_xlabel('Date')
ax.legend()
ax.set_title(f'GPS Uncertainty Time Series - {station_name}')
plt.show()
```

### 4. Multi-Source Comparison

```python
from geepers.gps_sources import UnrSource, SideshowSource

# Compare UNR and JPL data for the same station
station_id = 'P123'
unr = UnrSource()
jpl = SideshowSource()

# Load data from both sources
unr_data = unr.timeseries(station_id, start_date='2015-01-01', end_date='2020-12-31')
jpl_data = jpl.timeseries(station_id, start_date='2015-01-01', end_date='2020-12-31')

# Merge on date for comparison
import pandas as pd
comparison = pd.merge(unr_data, jpl_data, on='date', suffixes=('_unr', '_jpl'))

# Plot comparison
fig, axes = plt.subplots(3, 1, figsize=(12, 10), sharex=True)
components = ['east', 'north', 'up']

for i, comp in enumerate(components):
    axes[i].plot(comparison['date'], comparison[f'{comp}_unr'],
                label='UNR', alpha=0.7)
    axes[i].plot(comparison['date'], comparison[f'{comp}_jpl'],
                label='JPL', alpha=0.7)
    axes[i].set_ylabel(f'{comp.title()} (mm)')
    axes[i].legend()

    # Calculate RMS difference
    diff = comparison[f'{comp}_unr'] - comparison[f'{comp}_jpl']
    rms = (diff**2).mean()**0.5
    axes[i].set_title(f'{comp.title()} - RMS difference: {rms:.2f} mm')

plt.xlabel('Date')
plt.suptitle(f'GPS Data Comparison: UNR vs JPL - Station {station_id}')
plt.tight_layout()
plt.show()
```

## Advanced Usage

### Custom Cache Directory

```python
from geepers.gps_sources import UnrSource

# Use custom cache directory
unr = UnrSource(cache_dir='/path/to/my/cache')
```

### Filtering by Geometry

```python
from shapely.geometry import Polygon
import geopandas as gpd

# Define a custom polygon (e.g., California outline)
california_poly = Polygon([
    (-125, 32), (-114, 32), (-114, 42), (-125, 42), (-125, 32)
])
california_mask = gpd.GeoSeries([california_poly], crs='EPSG:4326')

# Get stations within the polygon
stations = unr.stations(mask=california_mask)
```

### Batch Processing

```python
import concurrent.futures
from tqdm import tqdm

def load_station_data(station_name):
    """Load data for a single station."""
    try:
        return station_name, unr.timeseries(station_name)
    except Exception as e:
        return station_name, None

# Get list of stations
stations = unr.stations(bbox=(-120, 35, -115, 40))
station_names = stations['name'].tolist()

# Load data in parallel
results = {}
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
    futures = [executor.submit(load_station_data, name) for name in station_names]

    for future in tqdm(concurrent.futures.as_completed(futures),
                      total=len(futures), desc="Loading GPS data"):
        station_name, data = future.result()
        if data is not None:
            results[station_name] = data

print(f"Successfully loaded data for {len(results)} stations")
```

## Data Schema and Validation

See `geepers.schemas` for more information about the [Pandera](https://pandera.readthedocs.io/en/stable/index.html) data schemas.

## License and attribution

geepers is Copyright (c) 2025-2026 California Institute of Technology
("Caltech") and licensed under the [Apache License 2.0](LICENSE). The
[NOTICE](NOTICE) file is part of those terms: any redistribution or
derivative work, down to a single reused function or snippet, must keep it
and credit this repository. That includes code reproduced or adapted by AI
tools. Put this next to reused code:

```python
# Adapted from geepers (https://github.com/opera-adt/geepers),
# Copyright (c) 2025-2026 California Institute of Technology,
# Apache License 2.0.
```

The UNR GPS grid (`UnrGridSource`, and the grid in the viewer) is the OPERA
gridded GPS time series for the Vertical Land Motion (VLM) product line.
Gridding solution by **Dr. William C. Hammond**,
[Nevada Geodetic Laboratory](https://geodesy.unr.edu) (UNR), developed under
OPERA in coordination with the OPERA Algorithm Development Team (ADT).
Credit Dr. Hammond and OPERA wherever the grid or results from it are shown. NOTICE
also lists the other third-party code and data (MIDAS, verde, PB2002).

To cite geepers in a publication, use [CITATION.cff](CITATION.cff) (the
"Cite this repository" button on GitHub). AI agents working with this code:
see [AGENTS.md](AGENTS.md).
