Skip to main content

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.

Installation

pip install nais-processor

Example usage

Open the python prompt and load methods from the nais_processor module. Then use the make_config() method to create a configuration file that is used at processing the data files.

$ python
>>> from nais_processor import *
>>> make_config()

Enter name of configuration file.
E.g. ./configs/campaign.yml
> ./configs/nyc.yml

Give path(s) to raw data. If multiple paths give them as comma separated list.
E.g. /data/nais/2021,/data/nais/2022
> /campaigns/nyc/nais/2015,/campaigns/nyc/nais/2016

Path to where processed data is saved.
E.g. ./data/campaign/processed
> ./data/nyc/processed

Path to where figures are saved. Leave empty if no figures.
E.g. ./data/campaign/figures
> ./data/nyc/figs

Start of measurement (YYYY-MM-DD)
> 2015-01-05

End of measurement (YYYY-MM-DD)
If empty processor assumes current day, use for continuous measurements.
> 2016-06-08

Enter name of database file
E.g. ./logs/campaign.json
> ./logs/nyc.json

Measurement location
E.g. Helsinki, Kumpula
> New York City

Apply corrections to data? (True/False)
Requires a NAIS with temperature and pressure sensors.
> True

Length of the inlet in meters
> 1.0

Correct concentrations to sealevel conditions? (True/False)
> False

Configuration saved to: ./configs/nyc.yml

Then process the data files by running nais_processor() method with the config file as the input argument.

>>> nais_processor("./configs/nyc.yml")
Configuration file: ./configs/nyc.yml
processing 20190101
processing 20190102
processing 20190103
...
Done!

Run do_figs() with the config file in order to create plots of the processed data if needed.

>>> do_figs("./configs/nyc.yml")
plotting 20190101
plotting 20190102
plotting 20190103
...
Done!

The code produces daily processed data files and optionally figures for ion and particle data. These files are saved in the destinations given in the configuration file.

The 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.

The data files have the following structure:

[0,0]  = UTC offset in hours
[1:,0] = Time (MATLAB datenum) 
[0,2:] = Geometric mean diameter of size-channel (m)
[1:,1] = Integrated total number concentration (cm-3)
[1:,2:] = Normalized number concentrations, dN/dlogDp (cm-3)

The locations of raw files, processed files and possible figures are written in the database_file, which is in JSON format.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nais-processor-0.0.1.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

nais_processor-0.0.1-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file nais-processor-0.0.1.tar.gz.

File metadata

  • Download URL: nais-processor-0.0.1.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for nais-processor-0.0.1.tar.gz
Algorithm Hash digest
SHA256 88b2bb6968fa85adad03021936be4fe1dce07b84a976687417d2d5e949874e6a
MD5 6ff21b1b345ae250c6da4c12aefed1dc
BLAKE2b-256 00d6852c57931ccd47378c4e85da22518246cb7887d28fe7708f0a671541346e

See more details on using hashes here.

File details

Details for the file nais_processor-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nais_processor-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ec0c6dd6b0d26713eba848ebd80e0557ee6ee6502921b28074c2012bdab0e2a
MD5 0b91ae5875c882846e619b527290d517
BLAKE2b-256 17438b67cc1bf8bff9a54e14918bd48400a196f0467f17948154a3b690dabb98

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page