readme.rst

Tue, 09 Oct 2012 11:45:28 +0200

author
ulalume3 <binietoglou@imaa.cnr.it>
date
Tue, 09 Oct 2012 11:45:28 +0200
changeset 5
c13d23a6289c
child 6
9f251fc37530
permissions
-rw-r--r--

Initial readme.rst

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

mercurial