/nais-processor

Primary LanguageStandard MLGNU General Public License v3.0GPL-3.0

NAIS processor

Use this code package to process NAIS (Neutral cluster and Air Ion Spectrometer, Airel Ltd.) measurements.

The code corrects for diffusion losses in the inlet line (Gromley and Kennedy, 1948) and applies an ion mode calibration (Wagner et al. 2016). Optionally the data can be corrected to standard conditions (273.15 K, 101325 Pa).

NAIS data processed with this script can be found here

Install

git clone https://github.com/daliagachc/nais-processor.git
cd nais-processor
conda env create -f nais_processor.yml
source activate env-nais-processor

# install this packaje
pip install -e ../nais-processor

Test run

# make sure the created env is active
source activate env-nais-processor

#go to the test directory 
cd test
python test.py

remove test files

# make sure you are in the nais-procesor directory 
cd nais-processor

# remove sum files 
rm ./test/data_out/*.sum

#remove figures 
rm ./test/figures/*.png


#remove database 
rm ./test/db.json

delete the created environment

# if your current environment is env-nais-processor you need to deactivate it: 
conda deactivate  

# then you can remove the environment 
conda env remove -n env-nais-processor

Files:

# config.yml
#todo--diego-- i have added a default yaml config at ./default_config.yaml
database_file: './db.json'
inlet_length: 1.0 # in meters
location: 'My measurement site'
data_folder: '/path/to/raw/nais/data/'
processed_folder: './processed/'
figure_folder: './figures/'
start_date: '2018-01-01'
end_date: '2018-12-31'
sealevel_correction: False
# process.py

from nais_processor import *
nais_processor('config.yml')
nais_plotter('config.yml')

Hints

  • For continuous measurements:
    • Leave end_date out, it will default to current date.
    • The NAIS creates a new file once a day, so run process.py once a day.
  • The locations of raw files, processed files and figures as well as possible errors during processing are written in the database_file. Inspect the database with jq and query with tinydb.

License

This project is licensed under the terms of the GNU GPLv3.

References

Gormley P. G. and Kennedy M., Diffusion from a Stream Flowing through a Cylindrical Tube, Proceedings of the Royal Irish Academy. Section A: Mathematical and Physical Sciences, 52, (1948-1950), pp. 163-169.

Wagner R., Manninen H.E., Franchin A., Lehtipalo K., Mirme S., Steiner G., Petäjä T. and Kulmala M., On the accuracy of ion measurements using a Neutral cluster and Air Ion Spectrometer, Boreal Environment Research, 21, (2016), pp. 230–241.