In [2]:
import atmPy
import xarray as xr


/Users/htelg/prog/atm-py/atmPy/general/flightpath.py:8: UserWarning: An error accured while trying to import mpl_toolkits.basemap.Basemap. Plotting of maps will not work!
  warnings.warn("An error accured while trying to import mpl_toolkits.basemap.Basemap. Plotting of maps will not work!")
/Users/htelg/prog/atm-py/atmPy/general/measurement_site.py:5: UserWarning: There seams to be an issue with importing mpl_toolkits.basemap. Make sure it is installed and working (try: "from mpl_toolkits.basemap import Basemap as _Basemap"). For now plotting on map will not be possible
  warnings.warn('There seams to be an issue with importing mpl_toolkits.basemap. Make sure it is installed and working (try: "from mpl_toolkits.basemap import Basemap as _Basemap"). For now plotting on map will not be possible')
/Users/htelg/prog/atm-py/atmPy/radiation/solar.py:12: UserWarning: There seams to be an issue with importing the pysolar library. Make sure it is installed and running correctly (try: "from Pysolar import solar as _solar"). For now conversion of the Atmospheric mass factor will not work.
  warnings.warn('There seams to be an issue with importing the pysolar library. Make sure it is installed and running correctly (try: "from Pysolar import solar as _solar"). For now conversion of the Atmospheric mass factor will not work.')

In [3]:
%matplotlib inline
plt.style.use('hagen_default')

In [ ]:


In [4]:
fname = '/Volumes/HTelg_4TB_Backup/arm_data/SGP/aosuhsasE13.a1/sgpaosuhsasE13.a1.20161115.212954.nc'
# fname = '/Volumes/HTelg_4TB_Backup/arm_data/OLI/uhsas/oliaosuhsasM1.a1.20170401.000008.nc'
dist = atmPy.data_archives.arm.read_uhsas(fname)

In [5]:
dist.plot()


Out[5]:
(<Figure size 800x640 with 2 Axes>,
 <matplotlib.axes._subplots.AxesSubplot at 0x320eb6dd8>,
 <matplotlib.collections.QuadMesh at 0x320d01278>,
 <matplotlib.colorbar.Colorbar at 0x1d246e7b38>)

Oli


In [3]:
fname = '/Volumes/HTelg_4TB_Backup/arm_data/OLI/uhsas/oliaosuhsasM1.a1.20170811.000008.nc'
# fname = '/Volumes/HTelg_4TB_Backup/arm_data/OLI/uhsas/oliaosuhsasM1.a1.20170401.000008.nc'
dist = atmPy.data_archives.arm.read_uhsas(fname)

In [5]:
dist.plot(norm = 'log')


Out[5]:
(<matplotlib.figure.Figure at 0x114408eb8>,
 <matplotlib.axes._subplots.AxesSubplot at 0x114424b38>,
 <matplotlib.collections.QuadMesh at 0x123a83b00>,
 <matplotlib.colorbar.Colorbar at 0x123aaf198>)

In [ ]:


In [ ]:

using xarray


In [6]:
fname = '/Volumes/HTelg_4TB_Backup/arm_data/OLI/uhsas/oliaosuhsasM1.a1.20170401.000008.nc'
fname = '/Volumes/HTelg_4TB_Backup/arm_data/OLI/uhsas/oliaosuhsasM1.a1.20170811.000008.nc'
data = xr.open_dataset(fname)

In [12]:
if 'sample_flow_rate' in data.variables.keys():
    print('bla')


bla

In [11]:
data


Out[11]:
<xarray.Dataset>
Dimensions:                   (bin_num: 99, time: 8639)
Coordinates:
  * time                      (time) datetime64[ns] 2017-08-11T00:00:08.560000 ...
  * bin_num                   (bin_num) int32 0 1 2 3 4 5 6 7 8 9 10 11 12 ...
Data variables:
    base_time                 datetime64[ns] 2017-08-11
    time_offset               (time) datetime64[ns] 2017-08-11T00:00:08.560000 ...
    sample_accumulation_time  (time) float32 10.0 10.0 10.0 10.0 10.0 10.0 ...
    scattering_voltage        (time) float64 0.969 0.955 0.955 0.952 0.967 ...
    current_sensor            (time) float64 1.366 1.367 1.371 1.367 1.372 ...
    sample_flow_rate          (time) float64 49.59 49.58 49.58 49.57 49.58 ...
    laser_reference_voltage   (time) float64 2.494 2.494 2.494 2.494 2.494 ...
    raw_temperature_signal    (time) float64 1.021 1.021 1.021 1.022 1.021 ...
    sheath_flow_rate          (time) float64 640.1 640.1 640.1 640.1 640.1 ...
    differential_voltage      (time) float64 4.095 4.095 4.095 4.095 4.095 ...
    unit_temperature          (time) float64 299.0 299.0 299.1 299.1 299.1 ...
    purge_flow_rate           (time) float64 38.06 38.07 38.06 38.06 38.06 ...
    sample_pressure           (time) float64 100.1 100.1 100.1 100.1 100.1 ...
    auxiliary                 (time) float64 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ...
    flow                      (time) float64 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ...
    lower_size_limit          (bin_num) float64 60.0 61.73 63.51 65.34 67.22 ...
    upper_size_limit          (bin_num) float64 61.73 63.51 65.34 67.22 ...
    size_distribution         (time, bin_num) float64 149.0 185.0 174.0 ...
    concentration             (time, bin_num) float64 18.03 22.38 21.05 ...
    lat                       float64 70.5
    lon                       float64 -149.9
    alt                       float64 2.0
Attributes:
    command_line:            aosuhsas_ingest -s oli -f M1
    Conventions:             ARM-1.2
    process_version:         ingest-aosuhsas-1.1-0.el6
    dod_version:             aosuhsas-a1-2.3
    site_id:                 oli
    platform_id:             aosuhsas
    facility_id:             M1
    data_level:              a1
    location_description:    North Slope of Alaska (NSA), Oliktok Point, Alaska
    input_source:            /data/collection/oli/oliaosuhsasM1.00/oliaosM1.u...
    Instrument_Description:  Ultra-High Sensitivity Aerosol Spectrometer
    mentor_name:             Uin
    mentor_affiliation:      BNL
    serial_number:           1408-047/WD80878
    sampling_interval:       10 seconds
    averaging_interval:      not averaged
    datastream:              oliaosuhsasM1.a1
    doi:                     10.5439/1333828
    history:                 created by user dsmgr on machine ruby at 2017-08...

In [3]:
sd = data.size_distribution.to_pandas()

# normalize total numbers to numbers/(cc)
## normalize to integration interval
sd /= float(data.sampling_interval.split()[0]) #normalize to integration interval

## normalize to flow rate
flowrate = data.sampling_volume.values / 60.
sd = sd.divide(flowrate, axis=0)

binedges = np.append(data.lower_size_limit.data,data.upper_size_limit.data[-1])
sdts = atmPy.aerosols.size_distribution.sizedistribution.SizeDist_TS(sd, binedges, 'numberConcentration')
sdts._data_period = float(data.sampling_interval.split()[0])
sdts = sdts.convert2dNdlogDp()
return sdts

In [11]:
avg.plot()


Out[11]:
(<matplotlib.figure.Figure at 0x11617a2b0>,
 <matplotlib.axes._subplots.AxesSubplot at 0x1190cb710>)

In [ ]: