The main function of this module is to convert recored peak intensities to particle sizes and create a sizedistribution instance.
In [1]:
from atmPy.aerosols.instruments.POPS import peaks,calibration
import matplotlib.pylab as plt
from atmPy.tools import plt_tools
import numpy as np
In [2]:
%matplotlib inline
plt_tools.setRcParams(plt)
Different file formats emerged during the development of POPS, which resulted in different functions with various optional parameters to read the files. Hopefully you will only need to use the following one which emerged in fall 2015.
In [3]:
import pathlib
In [4]:
filename = pathlib.Path('./data/POPS_Peak.bin')
type(filename)
Out[4]:
In [5]:
measurement = peaks.read_binary(filename, version='labview', verbose=True)
In [6]:
measurement.data
Out[6]:
To convert peak heights to particle sizes we first have to load a calibration file. Further information on calibration can be found here.
In [4]:
cal = calibration.read_csv('./data/POPS_calibration.csv')
Then we apply this calibration which adds an extra column to the data set containg the particle size.
In [5]:
measurement.apply_calibration(cal)
Either use use the default bins or define your own.
In [6]:
bins = np.logspace(np.log10(120), np.log10(3000), 100)
sd = measurement.peak2sizedistribution(bins = bins)
In [7]:
sd.plot()
Out[7]:
In [8]:
sd.particle_number_concentration_outside_range.plot()
Out[8]:
You probably want to normalize the particle rates to particle concentrations by dividing by the flow rate. It is important not to apply operations solely to the data container. Instead perform the opperation on the entire sizedistribution instance.
In [9]:
sd /= 3
In [10]:
sd.plot()
Out[10]:
In [11]:
sd.particle_number_concentration_outside_range
Out[11]:
Done! Now you can do what ever you can do with a sizedistribution instance (see here). E.g. save it, or plot it
In [9]:
sd.save_csv('./data/POPS_Peak.bin.dist')
In [ ]: