diff --git a/docs/api.rst b/docs/api.rst
index 6abdc27..72ae5f4 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -144,6 +144,20 @@ Quality checks for weather data.
    quality.weather.temperature_limits
    quality.weather.wind_limits
 
+In addition to validating temperature by comparing with limits, module
+temperature should be positively correlated with irradiance. Poor
+correlation could indicate that the sensor has become detached from
+the module, for example. Unlike other functions in the
+:py:mod:`quality` module which return Boolean masks over the input
+series, this function returns a single Boolean value indicating
+whether the entire series has passed (``True``) or failed (``False``)
+the quality check.
+
+.. autosummary::
+   :toctree: generated/
+
+   quality.weather.module_temperature_check
+
 .. rubric:: References
 
 .. [1]  C. N. Long and Y. Shi, An Automated Quality Assessment and Control
diff --git a/pvanalytics/quality/weather.py b/pvanalytics/quality/weather.py
index caa7d88..5e331ba 100644
--- a/pvanalytics/quality/weather.py
+++ b/pvanalytics/quality/weather.py
@@ -1,5 +1,6 @@
 """Quality control functions for weather data."""
 from pvanalytics.quality import util
+from scipy import stats
 
 
 def temperature_limits(air_temperature, limits=(-35.0, 50.0)):
@@ -97,3 +98,30 @@ def wind_limits(wind_speed, limits=(0.0, 50.0)):
         upper_bound=limits[1],
         inclusive_lower=True
     )
+
+
+def module_temperature_check(module_temperature, irradiance,
+                             correlation_min=0.5):
+    """Test whether the module temperature is correlated with irradiance.
+
+    Parameters
+    ----------
+    module_temperature : Series
+        Time series of module temperature.
+    irradiance : Series
+        Time series of irradiance with the same index as
+        `module_temperature`. This should be of relatively high
+        quality (outliers and other problems removed).
+    correlation_min : float, default 0.5
+        Minimum correlation between `module_temperature` and
+        `irradiance` for the module temperature sensor to 'pass'
+
+    Returns
+    -------
+    bool
+        True if the correlation between `module_temperature` and
+        `irradiance` exceeds `correlation_min`.
+
+    """
+    _, _, r, _, _ = stats.linregress(module_temperature, irradiance)
+    return r > correlation_min

Add module-temperature/irradiance correlation check
PVFleets QA checks that the module temperature is correlated with the irradiance. This is a pass/fail quality check: if the temperature and irradiance have sufficiently high correlation over the entire series then the temperature sensor passes. It might be useful to apply the correlation check on rolling windows as well and return a boolean series rather than just a pass/fail.

I'm not sure where this should go in the `quality` module.
diff --git a/pvanalytics/tests/quality/test_weather.py b/pvanalytics/tests/quality/test_weather.py
index c2807e3..a32138e 100644
--- a/pvanalytics/tests/quality/test_weather.py
+++ b/pvanalytics/tests/quality/test_weather.py
@@ -2,6 +2,7 @@
 import pytest
 import pandas as pd
 import numpy as np
+from pvlib import location
 from pandas.util.testing import assert_series_equal
 from pvanalytics.quality import weather
 
@@ -87,3 +88,23 @@ def test_wind_limits(weather_data):
         weather_data['extreme_wind_flag'],
         check_names=False
     )
+
+
+def test_module_temperature():
+    """Module temperature is correlated with GHI."""
+    albuquerque = location.Location(
+        35.0844, -106.6504, altitude=5312, tz='MST'
+    )
+    times = pd.date_range(
+        start='01/01/2020',
+        end='03/01/2020',
+        freq='H',
+        tz='MST'
+    )
+    clearsky = albuquerque.get_clearsky(times, model='simplified_solis')
+    assert weather.module_temperature_check(
+        clearsky['ghi']*0.6, clearsky['ghi']
+    )
+    assert not weather.module_temperature_check(
+        clearsky['ghi']*(-0.6), clearsky['ghi']
+    )

pip install -e .[all]
parse_log_pytest
requirements.txt
pytest
3.7
requirements.txt docs/requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
Babel==2.14.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
docutils==0.20.1
exceptiongroup==1.2.2
h5py==3.8.0
idna==3.10
imagesize==1.4.1
importlib-metadata==6.7.0
iniconfig==2.0.0
Jinja2==3.1.6
MarkupSafe==2.1.5
numpy==1.21.6
packaging==24.0
pandas==1.3.5
pluggy==1.2.0
-e git+https://github.com/pvlib/pvanalytics.git@e4b6c8cc04756c3134ae935dda25794e20dfab5b#egg=pvanalytics
pvlib==0.10.4
Pygments==2.17.2
pytest==7.4.4
python-dateutil==2.9.0.post0
pytz==2025.2
requests==2.31.0
scipy==1.7.3
six==1.17.0
snowballstemmer==2.2.0
Sphinx==2.2.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==2.0.1
typing_extensions==4.7.1
urllib3==2.0.7
zipp==3.15.0

name: pvanalytics
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - babel==2.14.0
      - charset-normalizer==3.4.1
      - docutils==0.20.1
      - exceptiongroup==1.2.2
      - h5py==3.8.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - jinja2==3.1.6
      - markupsafe==2.1.5
      - numpy==1.21.6
      - packaging==24.0
      - pandas==1.3.5
      - pluggy==1.2.0
      - pvlib==0.10.4
      - pygments==2.17.2
      - pytest==7.4.4
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - requests==2.31.0
      - scipy==1.7.3
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==2.2.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - zipp==3.15.0
prefix: /opt/conda/envs/pvanalytics

pvanalytics/tests/quality/test_weather.py::test_module_temperature
pvanalytics/tests/quality/test_weather.py::test_check_temperature_limits pvanalytics/tests/quality/test_weather.py::test_relative_humidity_limits pvanalytics/tests/quality/test_weather.py::test_wind_limits
docs/api.rst pvanalytics/quality/weather.py
docs/api.rst pvanalytics/quality/weather.py