26 |
26 |
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 |
32 |
33 :::python |
33 :::python |
34 import glob # This is needed to read a list of filenames |
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” |
35 from lidar import cf_raymetrics #If you have saved the files in a directrory called “lidar” |
36 |
36 |
37 # Go to the folder where you files are stored |
37 # Go to the folder where you files are stored |
38 cd /path/to/lidar/files |
38 cd /path/to/lidar/files |
39 |
39 |
40 # Read the filenames |
40 # Read the filenames |
41 files = glob.glob('*') # The * reads all the files in the folder. |
41 files = glob.glob("*") # The * reads all the files in the folder. |
42 |
42 |
43 #Read the files |
43 #Read the files |
44 my_measurement = cf_raymetrics.CfLidarMeasurement(files) |
44 my_measurement = cf_raymetrics.CfLidarMeasurement(files) |
45 |
45 |
46 #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: |
52 |
52 |
53 |
53 |
54 Converting to SCC format |
54 Converting to SCC format |
55 --------------------- |
55 --------------------- |
56 |
56 |
57 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": |
58 |
58 |
59 :::python |
59 :::python |
60 my_measurement.info['Measurement_ID'] = “20101229op00” |
60 my_measurement.info["Measurement_ID"] = "20101229op00" |
61 my_measurement.info['Temperature'] = “14” |
61 my_measurement.info["Temperature"] = "14" |
62 my_measurement.info['Pressure'] = “1010” |
62 my_measurement.info["Pressure"] = "1010" |
63 |
63 |
64 You can use standard values of temperature and pressure by just calling: |
64 You can use standard values of temperature and pressure by just calling: |
65 |
65 |
66 :::python |
66 :::python |
67 my_measurement.get_PT() |
67 my_measurement.get_PT() |
68 |
68 |
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). |
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). |
70 |
70 |
71 |
71 |
72 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: |
73 |
73 |
74 :::python |
74 :::python |
75 my_measurement.save_as_netcdf(“filename”) |
75 my_measurement.save_as_netcdf("filename") |
76 |
76 |
77 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. |
78 |
78 |