Ac_tools

Module for working with global/regional Chemical Transport Model (CTM) output and observations
Alternatives To Ac_tools
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Datacube Core4617183 days ago41November 08, 202341apache-2.0Python
Open Data Cube analyses continental scale Earth Observation data through time
Peroxide4181512 days ago207November 25, 202311apache-2.0Rust
Rust numeric library with R, MATLAB & Python syntax
Gdl248
a day ago246gpl-2.0C++
GDL - GNU Data Language
Regionmask2331142 days ago14September 22, 202346mitPython
create masks of geospatial regions for arbitrary grids
Gis4wrf132
10 months ago29mitPython
QGIS toolkit 🧰 for pre- and post-processing 🔨, visualizing 🔍, and running simulations 💻 in the Weather Research and Forecasting (WRF) model 🌀
Pism90
13 days ago28gpl-3.0C++
Repository for the Parallel Ice Sheet Model (PISM)
Gcpy47
16 days ago11October 26, 202227otherJupyter Notebook
Python toolkit for GEOS-Chem. Contains basic plotting scripts, plus the suite of GEOS-Chem benchmarking utilities.
Wrf41
2 years agon,ullotherFortran
🌀 The Weather Research and Forecasting (WRF) model with CMake support
Auromat10
4 years ago7April 23, 20162otherPython
AUROra MApping Toolkit - Python library / CLI tools for creating and working with georeferenced images for aurora research.
Ac_tools7
9 months ago9mitPython
Module for working with global/regional Chemical Transport Model (CTM) output and observations
Alternatives To Ac_tools
Select To Compare


Alternative Project Comparisons
Readme

AC_tools: Atmospheric Chemistry (AC) tools

Atmospheric Chemistry Tools (AC_Tools) contains functions and scripts used for working with atmospheric model output and observational data. Many functions are included for working with global and regional chemical transport model (CTM) ouput from the GEOS-Chem model.

This package started as a just collection of scripts that were found to be useful for work in atmospheric chemistry and now simply aims to contain functionality outside the remit of the more specialised community packages (e.g PyGChem, xbpch, and gcpy) and use the existing Python stack (e.g. dask, xarray, pandas). Please raise any questions/comments or bugs as issues here on GitHub and pull requests are welcome!

Installation

AC_Tools is currently only installable from source. To do this, you can either install directly via pip (recommended and this includes any dependencies):

$ pip install git+https://github.com/tsherwen/AC_tools.git

or (not recommended), clone the source directory and manually install:

$ git clone https://github.com/tsherwen/AC_tools.git
$ cd AC_tools
$ python setup.py install

If you specifically wish to use the legacy "bpch to NetCDF" (bpch2netCDF) capability, you will need to run AC_tools in a Python2 environment due to use of an iris backend via PyGChem. In this specific case, please install using the later method and ensure that you have iris (version 1.13.0) installed. You will also need to install PyGChem (version 0.3.0) by the same route.

Quick Start

Functions within AC_Tools can be used for various tasks for handling model output and observations.

An example would be importing NetCDF files or converting ctm.bpch files from a directory of GEOS-Chem output (with tracerinfo.dat and diaginfo.dat files). Or using GEOS-Chem NetCDF output to make a quick plot of surface ozone.

If using within a python3 environment and GEOS-Chem

import AC_tools as AC
folder = '<folder containing GEOS-Chem output>'
# Get the GEOS-Chem NetCDF output as a xarray dataset object
# NOTE: this is just a wrapper of get_GEOSChem_files_as_ds, which can retrieve GEOS-Chem NetCDFs as a dataset
ds = AC.GetSpeciesConcDataset(wd=folder)
# Average dataset over time
ds = ds.mean(dim='time')
# Select the surface level
ds = ds.sel( lev=ds.lev[0] )
# Select ozone and do plot basic plot
spec = 'O3'
#ds['SpeciesConc_'+spec].plot() # very simple plot
AC.quick_map_plot( ds, var2plot='SpeciesConc_'+spec) # basic lat-lon plot
plt.show()
# Get global average surface CO
spec = 'CO'
ratio = (ds['SpeciesConc_'+spec] * ds['AREA']).sum() / ds['AREA'].sum()
ratio = float(ratio.values)
# Make a formatted string and then print using this to screen
prt_str = "The global average surface mixing ratio of {spec} (ppbv) is: {ratio}"
print(prt_str.format(spec=spec, ratio=ratio*1E9))

If using within a python2 environment, the below example is a way of accessing GEOS-Chem data. The data is converted from bpch to NetCDF by default via an iris backend through PyGChem (using bpch2netCDF.py).

import AC_tools as AC
folder = '<folder containing GEOS-Chem output>'
# Get the atmospheric ozone burden in Gg O3 as a np.array
array = AC.get_O3_burden_bpch(folder)
print( "The ozone burden is: {burden}".format(burden=array.sum()))
# Get surface area for resolution
s_area = get_surface_area(res)[..., 0]  # m2 land map
# Get global average surface CO
spec = 'CO'
array = AC.get_GC_output(wd=folder, vars=['IJ_AVG_S__{}'.format(spec)])
ratio = AC.get_2D_arr_weighted_by_X(array, res='4x5', s_area=s_area)
# Make a formatted string and then print using this to screen
prt_str = "The global average surface mixing ratio of {spec} (ppbv) is: {ratio}"
print( prt_str.format(spec=spec, ratio=ratio*1E9))

Usage

Example analysis code for using AC_tools is available in the scripts folder.

For more information, please visit the AC_tools_wiki.

License

Copyright (c) 2015 Tomas Sherwen

This work is licensed under a permissive MIT License.

Contact

Tomas Sherwen - [email protected]

Popular Netcdf Projects
Popular Scientific Computing Projects
Popular Data Formats Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
Netcdf
Scientific Computing