Skip to content

simonrp84/PyCoxMunk

Repository files navigation

PyCoxMunk Tests codecov

PyCoxMunk

A python library for simulating satellite-viewed sea surface reflectances.

The pycoxmunk library computes the sea surface reflectance, using the Cox-Munk method, as expected to be seen from space based on the satellite and weather conditions at the sea surface. A description of the algorithm and this library are given in this paper, published in the Journal of Open Source Software.

The main purpose of this library is to enable an easy method for computing sea surface reflectance that is applicable to a wide variety of low-earth and geostationary orbit satellites and sensors. The library is closely linked to the satpy library that loads, calibrates and produces projection information for many satellites. Under the hood, pycoxmunk uses dask and xarray to store and process data. Results are made available via the same satpy scene used to provide the input satellite images.

As well as computing the sea surface reflectance, pycoxmunk can also compute the four BRDF terms, which can be useful in radiative transfer, cloud and aerosol properties retrieval codes, and other uses such as cloud or sea ice detection.

Installation

pycoxmunk can be installed from PyPI with pip:

    pip install pycoxmunk

It is also available from conda-forge for conda installations:

    conda install -c conda-forge pycoxmunk

Tests

pycoxmunk comes with a set of scripts for testing the functionality of the library. These are located in the ./Tests/ subdirectory and can be run using pytest:


cd Tests
pytest .

This will run all tests. You can also run just a single test script with, for example, pytest test_CMCalcs.py. You may first need to install pytest via: conda install pytest.

Once testing is complete, a summary will be displayed. This should indicate that all tests have passed, as well as potentially listing some warnings depending on your environment and the current status of pycoxmunk's dependencies.

Credits

This code was written by Simon Proud and is based on a fortran implementation of the Cox-Munk algorithm written by Greg McGarragh as part of the ORAC algorithm.

Feedback and Contribution

Feedback, suggestions, bug reports or any other type of contribution is welcome.

If you encounter any problems with this code or the documentation then please file an issue. It may help in debugging any problems to enable satpy's debug mode:

    from satpy import debug_on
    debug_on()

This will print additional log and diagnostic information.

Suggestions for new features are welcome, but may not always be possible for me to code due to limited time. You can also submit your own pull requests that add features of fix bugs. This is the recommended way to change the library code, rather than emailing me your updates. By submitting a pull request please ensure that your code changes and additions are documented and, where appropriate, covered by tests.