readme.md

Mon, 18 Feb 2013 12:21:05 +0100

author
ulalume3 <binietoglou@imaa.cnr.it>
date
Mon, 18 Feb 2013 12:21:05 +0100
changeset 15
a0b073b1f684
parent 12
f3ab222acc38
permissions
-rw-r--r--

Added the option to subtrackt dark profiles from raw data. This could be useful for non-scc use of the netcdf files (ex. LIRIC).

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

mercurial