acgc API documentation

# acgc

Data analysis programs from the ACGC research group

# Installation

For conda users:

`conda install -c conda-forge acgc`

For pip users:

`pip install acgc`

### For developers

If you plan to modify or improve the acgc package, an editable installation may be better: `pip install -e git+https://github.com/cdholmes/acgc-python` Your local files can then be managed with git, including keeping up-to-date with the github source repository (e.g. `git pull`).

# Get started

Submodules within `acgc` contain all the capabilities of the package. Submodules are imported via `import acgc.<submodule>` or `from acgc import <submodule>`.

## Better looking figures

The default appearance of figures from Matplotlib doesn't meet the standards of most scientific journals (high-resolution, Helvetica-like font). With the `acgc.figstyle` module, figures meet these criteria. Simply use `from acgc import figstyle` before creating your figures. See example

## Standard major axis (SMA) line fitting

SMA line fitting (also called reduced major axis or RMA) quantifies the linear relationship between variables in which neither one depends on the other. It is available via `from acgc.stats import sma`. See example

# Demos

The demo folder contains examples of how to accomplish common data analysis and visualization tasks. The examples include uses of the `acgc` library as well as other libraries for geospatial data analysis.

# Quick summary of submodules

## Key submodules

- `acgc.figstyle`
  Style settings for matplotlib, for publication-ready figures. demo

- `acgc.stats`
  Collection of statistical methods. demo

## Other submodules

- `acgc.erroranalysis`
  Propagation of error through complex numerical models

- `acgc.geoschem` or `acgc.gc`
  Tools for GEOS-Chem grids (e.g. indexing, remapping, interpolating)

- `acgc.hysplit`
  Read HYSPLIT output and write HYSPLIT CONTROL files

- `acgc.icartt`
  Read and write ICARTT format files

- `acgc.igra`
  Read IGRA radiosonde data files

- `acgc.map_scalebar`
  Scale bar for display on maps

- `acgc.met`
  Miscelaneous functions for PBL properties

- `acgc.modetools`
  Visualization of eigenmode systems

- `acgc.netcdf`
  High-level functions for reading and writing netCDF files. Legacy code. `acgc.netcdf.write_geo_nc` is still useful for concisely creating netCDF files, but xarray is better for reading netCDF.

- `acgc.solar`
  Solar zenith angle, azimuth, declination, equation of time

- `acgc.time`
  Functions for manimulating times and dates. Legacy code.

View Source

      1'''Data analysis programs from the ACGC research group
      2
      3# Installation
      4
      5For conda users:
      6
      7 `conda install -c conda-forge acgc`
      8
      9For pip users:
     10
     11 `pip install acgc`
     12
     13### For developers
     14If you plan to modify or improve the acgc package, an editable installation may be better:
     15`pip install -e git+https://github.com/cdholmes/acgc-python`
     16Your local files can then be managed with git, including keeping up-to-date with the
     17github source repository (e.g. `git pull`).
     18
     19<!-- ----------------------- SECTION BREAK ----------------------- -->
     20
     21# Get started
     22
     23Submodules within `acgc` contain all the capabilities of the package.
     24Submodules are imported via `import acgc.<submodule>` or `from acgc import <submodule>`.
     25
     26## Better looking figures
     27
     28The default appearance of figures from Matplotlib doesn't meet the standards of most
     29scientific journals (high-resolution, Helvetica-like font). With the `acgc.figstyle` module,
     30figures meet these criteria. Simply use `from acgc import figstyle` before creating your figures.
     31See [example](https://github.com/cdholmes/acgc-python/blob/main/demo/demo_figstyle.ipynb)
     32
     33## Standard major axis (SMA) line fitting
     34
     35SMA line fitting (also called reduced major axis or RMA) quantifies the linear relationship
     36between variables in which neither one depends on the other.
     37It is available via `from acgc.stats import sma`.
     38See [example](https://github.com/cdholmes/acgc-python/blob/main/demo/demo_sma.ipynb)
     39
     40<!-- ----------------------- SECTION BREAK ----------------------- -->
     41
     42# Demos
     43The [demo](https://github.com/cdholmes/acgc-python/blob/main/demo)
     44folder contains examples of how to accomplish common data analysis and visualization tasks.
     45The examples include uses of the `acgc` library as well as other libraries for
     46geospatial data analysis.
     47
     48<!-- ----------------------- SECTION BREAK ----------------------- -->
     49
     50# Quick summary of submodules
     51
     52## Key submodules
     53
     54- `acgc.figstyle`
     55Style settings for matplotlib, for publication-ready figures.
     56[demo](https://github.com/cdholmes/acgc-python/blob/main/demo/demo_figstyle.ipynb)
     57
     58- `acgc.stats`
     59Collection of statistical methods.
     60[demo](https://github.com/cdholmes/acgc-python/blob/main/demo/demo_stats.ipynb)
     61
     62## Other submodules
     63
     64- `acgc.erroranalysis`
     65Propagation of error through complex numerical models
     66
     67- `acgc.geoschem` or `acgc.gc`
     68Tools for GEOS-Chem grids (e.g. indexing, remapping, interpolating)
     69
     70- `acgc.hysplit`
     71Read HYSPLIT output and write HYSPLIT CONTROL files
     72
     73- `acgc.icartt`
     74Read and write ICARTT format files
     75
     76- `acgc.igra`
     77Read IGRA radiosonde data files
     78
     79- `acgc.map_scalebar`
     80Scale bar for display on maps
     81
     82- `acgc.met`
     83Miscelaneous functions for PBL properties
     84
     85- `acgc.modetools`
     86Visualization of eigenmode systems
     87
     88- `acgc.netcdf`
     89High-level functions for reading and writing netCDF files. Legacy code.
     90`acgc.netcdf.write_geo_nc` is still useful for concisely creating netCDF files,
     91but xarray is better for reading netCDF.
     92
     93- `acgc.solar`
     94Solar zenith angle, azimuth, declination, equation of time
     95
     96- `acgc.time`
     97Functions for manimulating times and dates. Legacy code.
     98'''
     99
    100def _package_version(package_name):
    101    '''Find version string for package name'''
    102    from importlib.metadata import version, PackageNotFoundError
    103    try:
    104        result = version(package_name)
    105    except PackageNotFoundError:
    106        result = "unknown version"
    107    return result
    108
    109__version__ = _package_version('acgc')
    110
    111__all__ = [
    112    'erroranalysis',
    113    'figstyle',
    114    'gc',
    115    'geoschem',
    116    'hysplit',
    117    'icartt',
    118    'igra',
    119    'map_scalebar',
    120    'met',
    121    'modetools',
    122    'netcdf',
    123    'stats',
    124    'solar',
    125    'time'
    126]