readme.rst

changeset 5
c13d23a6289c
child 6
9f251fc37530
equal deleted inserted replaced
4:7f9450f40b1e 5:c13d23a6289c
1 Basic instructions
2 ==================
3
4 These classes can be used to handle lidar input data. They are still in a very initial stage. There are many features probably not working, but they work for some specific tasks. They work with Licel input files (and also with the Raymetrics modified format).
5
6
7 Set up
8 ------------
9
10
11 Parameter file
12 ~~~~~~~~~~
13 Before using the classes you need to setup some channel parameters, that are used when converting the lidar data to Single Calculus Chain format.
14
15 All the parameters are read from an external file stored in the same folder as the code. You can start by changing the file “cf_netcdf_parameters.py” that describe such parameters for the Clermont Ferrand lidar.
16
17 System class
18 ~~~~~~~~~~
19 The next thing you need to 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_raymetrics.py”::
20
21 from licel import LicelLidarMeasurement
22
23 import cf_netcdf_parameters
24
25 class CfLidarMeasurement(LicelLidarMeasurement):
26
27 extra_netcdf_parameters = cf_netcdf_parameters
28
29 Using the class
30 ------------------
31
32 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.
33
34 import glob # This is needed to read a list of filenames
35 from lidar import cf_raymetrics #If you have saved the files in a directrory called “lidar”
36
37 # Go to the folder where you files are stored
38 cd /path/to/lidar/files
39
40 # Read the filenames
41 files = glob.glob('*') # The * reads all the files in the folder.
42
43 #Read the files
44 my_measurement = cf_raymetrics.CfLidarMeasurement(files)
45
46 #Now the data have been read, and you have a measurement object to work with:
47 # See what channels are present
48 print my_measurement.channels
49
50 #Quicklooks of all the channels
51
52 my_measurements.plot()
53
54 Converting to SCC format
55 --------------------------------
56
57 There are some extra info you need to put in before converting to SCC format, 'Measurement_ID', 'Temperature', 'Pressure'::
58
59 my_measurement.info['Measurement_ID'] = “20101229op00”
60 my_measurement.info['Temperature'] = “14”
61 my_measurement.info['Pressure'] = “1010”
62
63 You can use standard values of temperature and pressure by just calling:
64 my_measurement.get_PT()
65
66 The standard values can be changed in generic.py. Search the get_PT method and change of what is appropriate for your station. If you have an external source of temperature and pressure information (a meteorological station) you can automate this by overriding the get_PT method in your system's class (in our example in the cf_raymetrics.py file).
67
68 After you have used this extra input, you save the file using this command:
69 my_measurement.save_as_netcdf(“filename”)
70
71 where you change the filename to the filename you want to use.
72

mercurial