readme.rst

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

mercurial