pyadapt.datastreams

ARMCLASS

class pyadapt.datastreams.default.ARMCLASS(F, kind)

Defines the default ARMCLASS for the different data streams. This generally isn’t called directlly, but rather used as a template for the other classes and their plotting routines.

INPUTS

Parameters:
  • F (netCDF4.Dataset) – netCDF4 Dataset Object
  • kind (str) – String describing the type of data
Returns:

ARMCLASS Class

The ARMCLASS Class contains all the data from the original netCDF file that was input into the individual routines. A description of each of the attributes is as follows.

.keys:a list containing all the data keys
.data:dictionary containing the actual data. The keys for the dict are found in self.keys
.long_name:dict containing the long_name description of the variable
.missing_value:dict containing the missing_values for masking
.dimensions:dict with the dimensions for each of the data variables
.units:dict containing the units for each of the data variables
.kind:string describing the kind of data this is (eg sounding, sfcmet...)
.site_id:site ID for the data file
.comment:any comments added by the file creator
.datetime:an array of datetime objects the same shape as the ‘time’
>>> ARM = pyadapt.datastreams.default.ARMCLASS(F, kind='example kind')
# to get a variable called 'temperature' from ARM use:
>>> temperature = ARM.data['temperature']
# you can also see the units of 'temperature'
>>> ARM.units['temperature']
u'degrees celcius'

Note

You will not usually call a particular ARMCLASS by name. Rather, the preferred method is to use the pyadapt.autodetect.read() function which automatically calls the appropriate ARMCLASS for you.

CCN

class pyadapt.datastreams.ccn.CCN(F, kind)

Defines a CCN class

Inherits the attributes found in pyadapt.datastreams.default.ARMCLASS

This particular class defines a ccn particle counter file.

INPUTS

Parameters:
  • F (netCDF4.Dataset) – netCDF4 Dataset Object
  • kind (str) – String describing the type of data
Returns:

ARMCLASS object

plot(save_plot=False, out_dir='', out_name='', out_fmt='png', autoname=True)

Makes one figure to describe the ccn amount data:

  • Timeseries - highlights the interday behavior of the ccn amount as a function of supersaturation. The timeseries shows ccn particle counts for three supersaturation ranges:

    • 0.0 - 0.15%
    • 0.3 - 0.45%
    • 0.75 - 1.0%
Parameters:
  • save_plot (bool) – Whether to save output
  • out_dir (string) – Directory to save figures
  • out_name (string) – Name of the plot
  • out_fmt (string) – Image format for the plot
  • autoname (bool) – Whether to automatically name plots

EXAMPLE:

>>> S = pyadapt.datastreams.ccn.CCN(F, 'ccnfile.nc')
>>> S.plot(save_plot=True, autoname=True)

Supported output types are anything that matplotlib can normally output, such as:

  • png
  • eps
  • pdf

SCATTERING

class pyadapt.datastreams.scattering.SCATTERING(F, kind)

Defines a SCATTERING class

Inherits the attributes found in pyadapt.datastreams.default.ARMCLASS

This particular class defines a nephelometer aerosol scattering file.

INPUTS

Parameters:
  • F (netCDF4.Dataset) – netCDF4 Dataset Object
  • kind (str) – String describing the type of data
Returns:

ARMCLASS object

plot(save_plot=False, out_dir='', out_name='', out_fmt='png', autoname=True)

Makes one figure to describe the nephelometer scattering data:

  • Timeseries - highlights the interday behavior of the dry aerosol scattering properties. Each panel shows the aerosol scattering at a particular cutoff size for

    • red wavelength
    • blue wavelength
    • green wavelength
Parameters:
  • save_plot (bool) – Whether to save output
  • out_dir (string) – Directory to save figures
  • out_name (string) – Name of the plot
  • out_fmt (string) – Image format for the plot
  • autoname (bool) – Whether to automatically name plots

EXAMPLE:

>>> S = pyadapt.datastreams.scattering.SCATTERING(F, 'surface met file')
>>> S.plot(save_plot=True, autoname=True)

Supported output types are anything that matplotlib can normally output, such as:

  • png
  • eps
  • pdf

SFCMET

class pyadapt.datastreams.sfcmet.SFCMET(F, kind)

Defines a SFCMET class

Inherits the attributes found in pyadapt.datastreams.default.ARMCLASS

This particular class defines a surface meteorology file.

INPUTS

Parameters:
  • F (netCDF4.Dataset) – netCDF4 Dataset Object
  • kind (str) – String describing the type of data
Returns:

ARMCLASS object

plot(save_plot=False, out_dir='', out_name='', out_fmt='png', autoname=True)

Makes two figures to describe the surface meteorology data:

  • Windrose - polar histogram describing the wind speed and direction

    for the entire day

  • Timeseries - highlights the interday behavior of a selection of

    surface meteorology variables:

    • max wind speed
    • mean and max precipitation rates
    • temperature
Parameters:
  • save_plot (bool) – Whether to save output
  • out_dir (string) – Directory to save figures
  • out_name (string) – Name of the plot
  • out_fmt (string) – Image format for the plot
  • autoname (bool) – Whether to automatically name plots

EXAMPLE:

>>> S = pyadapt.datastreams.sfcmet.SFCMET(F, 'surface met file')
>>> S.plot(save_plot=True, autoname=True)

Supported output types are anything that matplotlib can normally output, such as:

  • png
  • eps
  • pdf

SOUNDING

class pyadapt.datastreams.sounding.SOUNDING(F, kind)

Defines a SOUNDING class

Inherits the attributes found in pyadapt.datastreams.default.ARMCLASS

This particular class defines a sounding. It uses as input a netcdf file that has been detected as a sounding.

INPUTS

Parameters:
  • F (netCDF4.Dataset) – netCDF4 Dataset Object
  • kind (str) – String describing the type of data
Returns:

ARMCLASS object

plot(altmax=None, ptop=100.0, skew=90.0, save_plot=False, out_dir='', out_name='', out_fmt='png', autoname=True)

Plot a sounding for quick visualization

Parameters:
  • altmax (float) – Maximum altitude to show (m)
  • ptop (float) – Uppermost pressure level for the plot
  • save_plot (bool) – Whether to save output
  • out_dir (string) – Directory to save figures
  • out_name (string) – Name of the plot
  • out_fmt (string) – Image format for the plot
  • autoname (bool) – Whether to automatically name plots

As of right now, there are a lot of keywords input directly into the method. On the to-do list is to move those out into a **kwargs part of the plot method and set up a list of defaults so that passing something into kwargs overwrites the defaults instead of putting all the defaults into the method call.

EXAMPLE:

>>> S.plot(ptop=100, save_plot=True, autoname=True)

Supported output types are anything that matplotlib can normally output, such as:

  • png
  • eps
  • pdf

Table Of Contents

Previous topic

Py-ADAPT Package

Next topic

pyadapt.extras

This Page