In [1]:
from atmPy import sizedistribution
In [2]:
%matplotlib inline
In [87]:
sd = sizedistribution.simulate_sizedistribution(diameter=[10, 2500],
numberOfDiameters=100,
centerOfAerosolMode=200,
widthOfAerosolMode=0.2,
numberOfParticsInMode=1000)
f,a = sd.plot_distribution()
In [4]:
sd = sd.convert2dNdlogDp() #this is not an inplace operation. It returns a new object
f,a = sd.plot_distribution()
In [8]:
sd.save_csv('data/size_distribution.cvs')
In [9]:
unsave = sizedistribution.read_distribution_csv('data/size_distribution.cvs')
f,a = unsave.plot_distribution()
In [23]:
sdtsf = sizedistribution.simulate_sizedistribution_timeseries()
sdtsf = sdtsf.convert2dNdlogDp()
f,a,pc,cb = sdtsf.plot_distribution(removeTickLabels=['50', '70', '90', '500','700', '900'])
The following procedure will actually truncate your data. This is usefull if your data volume is very big. And it is necessary when you want to create a single sizedistribution instance from this particular stretch of time (see below)
In [24]:
sdtsf.get_timespan()
Out[24]:
In [25]:
sdtsfZ = sdtsf.zoom_time('2014-11-24 17:10:00','2014-11-24 17:20:00')
sdtsfZ.plot_distribution()
Out[25]:
In [35]:
sdtsfL = sdtsf.average_overTime('60S')
f,a,pc,cb = sdtsfL.plot_distribution()
In [36]:
sd = sdtsf.average_overAllTime()
In [37]:
sd.plot_distribution()
Out[37]:
In [129]:
sdls = sizedistribution.simulate_sizedistribution_layerseries()
f,a,pc,cb = sdls.plot_distribution()
In [273]:
reload(sizedistribution)
Out[273]:
In [321]:
sdls = sizedistribution.aerosolSizeDistribution_layerseries(None, sd.bins, sd.distributionType, None)
sd = sizedistribution.simulate_sizedistribution(centerOfAerosolMode=100)
lb = [0,10]
sdls.add_layer(sd, lb)
sd = sizedistribution.simulate_sizedistribution(centerOfAerosolMode=200)
lb = [10,20]
sdls.add_layer(sd, lb)
sd = sizedistribution.simulate_sizedistribution(centerOfAerosolMode=300)
lb = [20,30]
sdls.add_layer(sd, lb)
sd = sizedistribution.simulate_sizedistribution(centerOfAerosolMode=400)
lb = [30,40]
sdls.add_layer(sd, lb)
In [322]:
sdls = sdls.convert2dNdlogDp()
sdls.plot_eachLayer()
Out[322]:
ACTION required:
In [417]:
sdls = sizedistribution.aerosolSizeDistribution_layerseries(None, sd.bins, sd.distributionType, None)
sd = sizedistribution.simulate_sizedistribution(centerOfAerosolMode=400)
lb = [0,10]
sdls.add_layer(sd, lb)
sd = sizedistribution.simulate_sizedistribution(centerOfAerosolMode=200)
lb = [10,20]
sdls.add_layer(sd, lb)
sd = sizedistribution.simulate_sizedistribution(centerOfAerosolMode=300)
lb = [20,30]
sdls.add_layer(sd, lb)
sd = sizedistribution.simulate_sizedistribution(centerOfAerosolMode=400)
lb = [30,40]
sdls.add_layer(sd, lb)
In [418]:
AOD = sdls.calculate_AOD()
In [419]:
AOD.keys()
Out[419]:
In [420]:
AOD['AOD']
Out[420]:
In [421]:
AOD['AOD_layer'].plot()
Out[421]:
In [424]:
for e,lay in enumerate(AOD['extCoeffPerLayer'].values):
plt.plot(sdls.bincenters,lay)
plt.semilogx()
Out[424]: