# README #

* Hosted location
https://parkfalls.gps.caltech.edu/tccon/stable/hg/egi/

NOTE: This changed in 2020 to be hosted in the same location as GGG. 
Please update your
.hg/hgrc file if necessary.

### What is EGI? ###

* Quick summary:
The EM27/SUN GGG Interferogram (EGI) processing suite is a collection of open-source scripts designed to simplify 
processing of the raw interferograms collected using commercial EM27/SUN instruments through GGG. It can 
take 7 different steps to run GGG for each instrument. With EGI, it takes just one line for all instruments. 
All of the subroutines 
(e.g., coordinating meteorological data with the interferograms, running I2S, creating runlogs,
obtaining .mod files, running GFIT, and running post-processing) are done for you. In addition,
EGI includes a few quality checks along the way to prevent further processing if there are errors 
such as missing files. It also is designed to better optimize running things on parallel, including
from multiple instruments at once. Basic diagnostic plots are also created to help with basic
human visual quality assurance of the data.

The end products are GGG outputs i.e., column abundances of various atmospheric gases.
EGI can also average some of these outputs to better match other retrieval algorithms.

* Who uses this?
This software primarily designed for other EM27/SUN operators. These operators are usually
atmospheric scientists who are involved in ground-based remote-sensing of various atmospheric
trace gases (e.g., CO2, CH4, H2O, CO, N2O).


* What is an EM27/SUN?
EM27/SUN instruments are solar viewing spectrometers, made and sold by Bruker. 
(https://www.bruker.com/products/infrared-near-infrared-and-raman-spectroscopy/remote-sensing/em27sun/learn-more.html)

References:

 Gisi, M., Hase, F., Dohe, S., Blumenstock, T., Simon, A., and Keens, A.: XCO2-measurements with a tabletop FTS 
 using solar absorption spectroscopy, Atmos. Meas. Tech., 5, 2969-2980, https://doi.org/10.5194/amt-5-2969-2012, 2012. 

 Hedelius, J. K., Viatte, C., Wunch, D., Roehl, C. M., Toon, G. C., Chen, J., Jones, T., Wofsy, S. C., Franklin, J. E., 
 Parker, H., Dubey, M. K., and Wennberg, P. O.: Assessment of errors and biases in retrievals of XCO2, XCH4, XCO, and 
 XN2O from a 0.5 cm–1 resolution solar-viewing spectrometer, Atmos. Meas. Tech., 9, 3527-3546, 
 https://doi.org/10.5194/amt-9-3527-2016, 2016.
 
 Pak, N. M., Hedelius, J., Roche, S., Cunningham, L., Baier, B., Sweeney, C., Roehl, C., Laughner, J., Toon, G., 
 wennberg, P., Parker, H., Arrowsmith, C., Mendonca, J., Fogal, P., Wizenberg, T., Herrera, B., Strong, K., Vogel, F., 
 and Wunch, D.: Using portable low-resolution spectrometers to evaluate TCCON biases in North America, Atmos. Meas. Tech.
 Discussions (submitted), 2023.

* What is GGG?
GGG is a collection of software for FFTs on interferograms to spectra, and then fitting the spectra to obtain
column abundances of various gases. GGG is open-source and is used by the TCCON.

Reference:

 Wunch, D., G. C. Toon, V. Sherlock, N. M. Deutscher, X. Liu, D. G. Feist, and P. O. Wennberg. The Total
 Carbon Column Observing Network's GGG2014 Data Version. doi:10.14291/tccon.ggg2014.documentation.R0/1221662, 2015.

* Version
Major versions correspond with GGG releases (e.g., EGI2020.0 with GGG2020).
Less-major updates are indicated after the first decimal.


### How do I get set up? ###

Please see the online wiki for a more complete description
https://tccon-wiki.caltech.edu/Software/GGG/EGI

GGG needs to be downloaded and compiled prior to running EGI. See the TCCON wiki for instructions
https://tccon-wiki.caltech.edu/Software/GGG/Download/GGG_2020_Release_Notes

GGGPATH, and EGIPATH need to be set in your source file (e.g., ~/.bash. ~/.bashrc, ~/.bash_profile or ~/.cshrc).

With GGG2020, a separate version of I2S is no longer needed!

The repository can be cloned with:
$ hg clone https://parkfalls.gps.caltech.edu/tccon/stable/hg/egi/

I highly recommend you run the setup_test first time through
$ ./setup_test

To setup EGI to work with your particular instruments & file structure you will need to create
a file_loc.lst for each instrument. See the [wiki file loc page](https://tccon-wiki.caltech.edu/Software/GGG/EGI/File_loc.lst)
for more information.

### Issues ###

To report issues, bugs, or request features please contact Jacob directly.
Suggestions, additions, and fixes are welcome!


### Licenses ###

As of 2020 EGI now falls under a simlar [license as GGG](https://tccon-wiki.caltech.edu/@api/deki/files/1321/=GFIT-License-2011-09-29-1.doc). 
Accepting the terms of that agreement qualifies you for access to EGI and is required
to obtain TCCON wiki account credentials. 

EGI is distributed freely (as in beer) and in source code format in hopes that it will 
aid the scientific community. Software is provided AS IS with no warrenty of fitness.

The initial versions of EGI were developed while Jacob was employed as a graduate 
student at the California Institute of Technology under the direction of Paul
Wennberg. Financial support is acknowledged. 



