readme.rst

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

mercurial