Skip to main content

Package for reading raw atmospheric lidar data.

Project description

Overview

This package provides utilities to handle raw (atmospheric) lidar input data. The main format supported are Licel binary files (including the Raymetrics modified format).

The package provides a single command line tool, called licel2scc that can convert Licel binary files to the EARLINET’s Single Calculus Chain NetCDF format.

Installation

The easiest way to install this module is from the python package index using pip:

pip install atmospheric-lidar

Using it as a Licel to SCC converter

Parameter file

Before converting Licel binary to SCC format, you need to create a file linking Licel channels to SCC channels.

As an example, you can start by changing the file “cf_netcdf_parameters.py” that describe such parameters for the Clermont Ferrand lidar.

Command line interface

The usage of the licel2scc program is described below:

A program to convert Licel binary files to the SCC NetCDF format.

positional arguments:
  parameter_file        The path to a parameter file linking licel and SCC
                        channels.
  files                 Location of licel files. Use relative path and
                        filename wildcards. (default './*.*')

optional arguments:
  -h, --help            show this help message and exit
  -i, --id_as_name      Use transient digitizer ids as channel names, instead
                        of descriptive names
  -m MEASUREMENT_ID, --measurement_id MEASUREMENT_ID
                        The new measurement id
  -n MEASUREMENT_NUMBER, --measurement_number MEASUREMENT_NUMBER
                        The measurement number for the date from 00 to 99.
                        Used if no id is provided
  -t TEMPERATURE, --temperature TEMPERATURE
                        The temperature (in C) at lidar level, required if
                        using US Standard atmosphere
  -p PRESSURE, --pressure PRESSURE
                        The pressure (in hPa) at lidar level, required if
                        using US Standard atmosphere
  -D DARK_FILES, --dark_files DARK_FILES
                        Location of files containing dark measurements.
                        Use relative path and filename wildcars, see 'files'
                        parameter for example.
  -d, --debug           Print dubuging information.
  -s, --silent          Show only warning and error messages.
  --version             Show current version.

Similarly, the licel2scc-depol program can be used to convert Licel files from Delta45 depolarization calibration measurements:

A program to convert Licel binary files from depolarization calibration
measurements to the SCC NetCDF format.

positional arguments:
  parameter_file        The path to a parameter file linking licel and SCC
                        channels.
  plus45_string         Search string for plus 45 degree files (default '*.*')
  minus45_string        Search string for minus 45 degree files (default
                        '*.*')

optional arguments:
  -h, --help            show this help message and exit
  -i, --id_as_name      Use transient digitizer ids as channel names, instead
                        of descriptive names
  -m MEASUREMENT_ID, --measurement_id MEASUREMENT_ID
                        The new measurement id
  -n MEASUREMENT_NUMBER, --measurement_number MEASUREMENT_NUMBER
                        The measurement number for the date from 00 to 99.
                        Used if no id is provided
  -t TEMPERATURE, --temperature TEMPERATURE
                        The temperature (in C) at lidar level, required if
                        using US Standard atmosphere
  -p PRESSURE, --pressure PRESSURE
                        The pressure (in hPa) at lidar level, required if
                        using US Standard atmosphere
  -d, --debug           Print dubuging information.
  -s, --silent          Show only warning and error messages.
  --version             Show current version.

Usage in python code

System class

To read data from a system, you need create a class that describes you system. This is very simple if your lidar data are in the Licel format, as you only need to specify the external file with the extra SCC parameters. You can use as an example the file cf_netcdf_parameters.py:

from licel import LicelLidarMeasurement
import cf_netcdf_parameters

class CfLidarMeasurement(LicelLidarMeasurement):
    extra_netcdf_parameters = cf_netcdf_parameters

This code assumes that the cf_netcdf_parameters.py is in your python path.

Using the class

Once you have made the above setup you can start using it. The best way to understand how it works is through an interactive shell (I suggest [ipython](http://ipython.org/)). In the following example I use the cf_raymetrics setup:

import glob  # This is needed to read a list of filenames
import cf_lidar

# Go to the folder where you files are stored
cd /path/to/lidar/files

# Read the filenames
files  = glob.glob("*") # The * reads all the files in the folder.

# Read the files
my_measurement = cf_lidar.CfLidarMeasurement(files)

# Now the data have been read, and you have a measurement object to work with:
# See what channels are present
print(my_measurement.channels)

# Quicklooks of all the channels
my_measurements.plot()

Converting to SCC format

There are some extra info you need to put in before converting to SCC format, “Measurement_ID”, “Temperature”, “Pressure”:

my_measurement.info["Measurement_ID"] = "20101229op00"
my_measurement.info["Temperature"] = "14"
my_measurement.info["Pressure"] = "1010"

You can use standard values of temperature and pressure by just calling:

my_measurement.get_PT()

You can specify the standard values by overriding your system’s get_PT method:

from licel import LicelLidarMeasurement
import cf_netcdf_parameters

class CfLidarMeasurement(LicelLidarMeasurement):
    extra_netcdf_parameters = cf_netcdf_parameters

    def get_PT():
        self.info['Temperature'] = 25.0
        self.info['Pressure'] = 1020.0

If you have an external source of temperature and pressure information (a meteorological station) you can automate this by reading the appropriate code in the get_PT method .

After you have used this extra input, you save the file using this command:

my_measurement.save_as_SCC_netcdf("filename")

where you change the output filename to the filename you want to use.

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

atmospheric_lidar-0.3.5.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atmospheric_lidar-0.3.5-py2-none-any.whl (41.2 kB view details)

Uploaded Python 2

File details

Details for the file atmospheric_lidar-0.3.5.tar.gz.

File metadata

  • Download URL: atmospheric_lidar-0.3.5.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.4.1 requests/2.13.0 setuptools/39.2.0 requests-toolbelt/0.7.1 clint/0.5.1 CPython/2.7.12 Linux/4.4.0-137-generic

File hashes

Hashes for atmospheric_lidar-0.3.5.tar.gz
Algorithm Hash digest
SHA256 c2bdef5e6943d9777c67994a7d16658baa03ceec858cfe8b6dcd1bfa0af3c105
MD5 e8db9658259daf4b21f5d144f33cf53f
BLAKE2b-256 d10dc0c932f57703479b6f1ab4aa88878a77a78703a68a221a3d8f0311054429

See more details on using hashes here.

File details

Details for the file atmospheric_lidar-0.3.5-py2-none-any.whl.

File metadata

  • Download URL: atmospheric_lidar-0.3.5-py2-none-any.whl
  • Upload date:
  • Size: 41.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.4.1 requests/2.13.0 setuptools/39.2.0 requests-toolbelt/0.7.1 clint/0.5.1 CPython/2.7.12 Linux/4.4.0-137-generic

File hashes

Hashes for atmospheric_lidar-0.3.5-py2-none-any.whl
Algorithm Hash digest
SHA256 c7e60b8f2e817f629a6f5356a7b6880f60e2aa3f41a13062c3544e68d01ba02e
MD5 2ed06c4dbeaa1e57f2264c7e8fcd16cb
BLAKE2b-256 ff4375736c97f467ddcbfc34068c270ee374c01b856b8aee629f3c66788e9b30

See more details on using hashes here.

Supported by

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