readme.md

changeset 11
86a5a05f6305
parent 10
77ef39c45e90
child 12
f3ab222acc38
equal deleted inserted replaced
10:77ef39c45e90 11:86a5a05f6305
5 5
6 6
7 Set up 7 Set up
8 ------ 8 ------
9 9
10 10 ### Parameter file
11 Parameter file
12 ~~~~~~~~~~~~~~
13 11
14 Before using the classes you need to setup some channel parameters, that are used when converting the lidar data to Single Calculus Chain format. 12 Before using the classes you need to setup some channel parameters, that are used when converting the lidar data to Single Calculus Chain format.
15 13
16 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. 14 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.
17 15
18 System class 16 ### System class
19 ~~~~~~~~~~~~ 17
20 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”:: 18 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”:
21 19
22 :::python 20 :::python
23 from licel import LicelLidarMeasurement 21 from licel import LicelLidarMeasurement
24 import cf_netcdf_parameters 22 import cf_netcdf_parameters
25 23
26 class CfLidarMeasurement(LicelLidarMeasurement): 24 class CfLidarMeasurement(LicelLidarMeasurement):
27 extra_netcdf_parameters = cf_netcdf_parameters 25 extra_netcdf_parameters = cf_netcdf_parameters
28 26
29 27
30 Using the class 28 Using the class
31 --------------- 29 -------------
32 30
33 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:: 31 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:
34 32
35 :::python 33 :::python
36 import glob # This is needed to read a list of filenames 34 import glob # This is needed to read a list of filenames
37 from lidar import cf_raymetrics #If you have saved the files in a directrory called “lidar” 35 from lidar import cf_raymetrics #If you have saved the files in a directrory called “lidar”
38 36
39 # Go to the folder where you files are stored 37 # Go to the folder where you files are stored
40 cd /path/to/lidar/files 38 cd /path/to/lidar/files
41 39
42 # Read the filenames 40 # Read the filenames
43 files = glob.glob('*') # The * reads all the files in the folder. 41 files = glob.glob('*') # The * reads all the files in the folder.
44 42
45 #Read the files 43 #Read the files
46 my_measurement = cf_raymetrics.CfLidarMeasurement(files) 44 my_measurement = cf_raymetrics.CfLidarMeasurement(files)
47 45
48 #Now the data have been read, and you have a measurement object to work with: 46 #Now the data have been read, and you have a measurement object to work with:
49 # See what channels are present 47 # See what channels are present
50 print my_measurement.channels 48 print my_measurement.channels
51 49
52 #Quicklooks of all the channels 50 #Quicklooks of all the channels
53 my_measurements.plot() 51 my_measurements.plot()
54 52
55 53
56 Converting to SCC format 54 Converting to SCC format
57 ------------------------ 55 ---------------------
58 56
59 There are some extra info you need to put in before converting to SCC format, 'Measurement_ID', 'Temperature', 'Pressure':: 57 There are some extra info you need to put in before converting to SCC format, 'Measurement_ID', 'Temperature', 'Pressure':
60 58
61 :::python 59 :::python
62 my_measurement.info['Measurement_ID'] = “20101229op00” 60 my_measurement.info['Measurement_ID'] = “20101229op00”
63 my_measurement.info['Temperature'] = “14” 61 my_measurement.info['Temperature'] = “14”
64 my_measurement.info['Pressure'] = “1010” 62 my_measurement.info['Pressure'] = “1010”
65 63
66 64 You can use standard values of temperature and pressure by just calling:
67 You can use standard values of temperature and pressure by just calling::
68 65
69 :::python 66 :::python
70 my_measurement.get_PT() 67 my_measurement.get_PT()
71 68
72 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). 69 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).
73 70
74 71
75 After you have used this extra input, you save the file using this command:: 72 After you have used this extra input, you save the file using this command:
76 73
77 :::python 74 :::python
78 my_measurement.save_as_netcdf(“filename”) 75 my_measurement.save_as_netcdf(“filename”)
79 76
80 where you change the filename to the filename you want to use. 77 where you change the filename to the filename you want to use.
81 78

mercurial