Code to process ion spectrometer data files
Project description
NAIS processor
Use this code package to process NAIS (Neutral cluster and Air Ion Spectrometer, Airel Ltd.) data files.
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), which can be useful when comparing aerosol particle and ion data from various locations at different altitudes.
Optionally one can also apply a cleaning procedure to the data where the corona ion band is removed from the particle data and instances of electrometer noise are removed from ion and particle data.
Installation
pip install nais-processor
Example usage
Use the make_config()
method to create a configuration file that is used at processing the data files. You will be asked questions about the measurement and the data. The information is written into a yaml file.
$ python
>>> from nais_processor import *
>>> make_config()
The resulting configuration file may look for example like this:
allow_reprocess: true
apply_cleaning: true
apply_corrections: true
data_folder:
- /home/user/data/2021
- /home/user/data/2022
database_file: /home/user/viikki.json
end_date: 2022-09-30
inlet_length: 1.0
location: Viikki, Helsinki, Finland
processed_folder: /home/user/viikki
sealevel_correction: true
start_date: 2022-09-28
remove_corona_ions: true
remove_noisy_electrometers: true
Then process the data files by running nais_processor()
method with the config file as the input argument.
>>> nais_processor("/home/user/viikki.yml")
/home/user/viikki.yml
building database...
processing 20220928 (Viikki, Helsinki, Finland)
processing 20220929 (Viikki, Helsinki, Finland)
processing 20220930 (Viikki, Helsinki, Finland)
Done!
The code produces daily processed data files for ion and particle data. These files are saved in the destinations given in the configuration file.
The processed data files are named
NAIS[n|p][yyyymmdd][np|nds].sum
where n
and p
refer to negative and positive polarity respectively. yyyymmdd
tells the date in the year-month-day format. np
and nds
refer to particle and ion data respectively.
In the processed data files the header contains the geometric mean diameters of the size bins, the first column is the time and the rest of the data is the number-size distribution matrix with normalized number concentrations (dN/dlogDp).
The locations of raw files, processed files and cleaned processed files are written in the JSON formatted database_file
.
Combining sumfiles
Once you have processed your NAIS data you can extract any time range in a sum matrix format using the combine_spectra()
function.
Example:
import nais_processor as nais
start_time="2022-09-29 02:00+02:00"
end_time="2022-09-30 14:00+02:00"
combined_data = nais.combine_spectra(
config_file,start_time,end_time,spectra_type="negion")
Use the aerosol-functions
package to further analyze and plot the data.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nais-processor-0.0.13.tar.gz
.
File metadata
- Download URL: nais-processor-0.0.13.tar.gz
- Upload date:
- Size: 286.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9adaa7a146537f08d902b7f90aa2b2f46f4f03c6cd976042cd8fa7668b6b6430 |
|
MD5 | a64ca7856a2b2f8efaf62cd0c71ac7ba |
|
BLAKE2b-256 | f697108ad26d3db60999ee085605c76b60c2347c2ac7b5317dd9d14e2460eadd |
File details
Details for the file nais_processor-0.0.13-py3-none-any.whl
.
File metadata
- Download URL: nais_processor-0.0.13-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ef54aae1152157f660bed1ca37a2cb97aed0064271b5899e47382378293acb1 |
|
MD5 | 9a062342ef5a1f775ccc2fe8567c27a5 |
|
BLAKE2b-256 | 0e9f96740e7de137783a1ef072faa6c01b51cd4dd9809a7c6c94967085749ec3 |