读取原始大气激光雷达数据的软件包。
atmospheric_lidar的Python项目详细描述
概述
此软件包提供处理原始(大气)激光雷达输入数据的实用程序。 支持的主要格式是licel二进制文件(包括raymetrics修改的格式)。
该包提供了一个名为licel2scc的命令行工具,可以将licel二进制文件转换为 earlinet的单微积分链netcdf格式。
安装
安装此模块的最简单方法是使用pip:
python包索引pip install atmospheric-lidar
将其用作licel-to-scc转换器
参数文件
在将licel二进制文件转换为scc格式之前,需要创建一个文件,将licel通道链接到scc通道。
作为一个例子,您可以从更改文件“cf\u netcdf\u parameters.py”开始,该文件描述了 克莱蒙费朗激光雷达的参数。
命令行界面
下面介绍licel2scc程序的用法:
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.
类似地,可以使用licel2scc-depol程序来转换 delta45去极化校准测量的licel文件:
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.
在python代码中的用法
系统类
要从系统读取数据,需要创建一个描述系统的类。 如果您的lidar数据是licel格式的,这非常简单,因为您只需要指定 带有额外scc参数的外部文件。您可以使用文件cf_netcdf_parameters.py:
fromlicelimportLicelLidarMeasurementimportcf_netcdf_parametersclassCfLidarMeasurement(LicelLidarMeasurement):extra_netcdf_parameters=cf_netcdf_parameters
这段代码假设cf_netcdf_parameters.py在python路径中。
使用类
完成上述设置后,即可开始使用。了解如何 它的工作原理是通过一个交互式shell(我建议使用[ipython](http://ipython.org/))。 在下面的示例中,我使用cf_raymetrics设置:
importglob# This is needed to read a list of filenamesimportcf_lidar# Go to the folder where you files are storedcd/path/to/lidar/files# Read the filenamesfiles=glob.glob("*")# The * reads all the files in the folder.# Read the filesmy_measurement=cf_lidar.CfLidarMeasurement(files)# Now the data have been read, and you have a measurement object to work with:# See what channels are presentprint(my_measurement.channels)# Quicklooks of all the channelsmy_measurements.plot()
转换为SCC格式
在转换为SCC格式“测量”、“温度”、“压力”之前,需要输入一些额外的信息:
my_measurement.info["Measurement_ID"]="20101229op00"my_measurement.info["Temperature"]="14"my_measurement.info["Pressure"]="1010"
您只需调用:
my_measurement.get_PT()
您可以通过重写系统的get_PT方法来指定标准值:
fromlicelimportLicelLidarMeasurementimportcf_netcdf_parametersclassCfLidarMeasurement(LicelLidarMeasurement):extra_netcdf_parameters=cf_netcdf_parametersdefget_PT():self.info['Temperature']=25.0self.info['Pressure']=1020.0
如果你有一个外部的温度和压力信息来源(气象站),你可以自动化 这是通过读取get_PT方法中的适当代码实现的。
使用此额外输入后,使用以下命令保存文件:
my_measurement.save_as_SCC_netcdf("filename")
将输出文件名更改为要使用的文件名。