ESA.instrument.aod_m
index
/home/lfeng/otool/ESA/instrument/aod_m.py

class for AOD PDF 
 
Authors: L. Feng, Edinburgh University
History: v0.9, 2012.06.28
History: v0.95, 2013.02.24
 
Classes:
==========================================
1. aod_cl: class for AOD PDF data

 
Modules
       
ESA.instrument.aod_file_m
ESA.util.gp_axis_m
ESA.atmosphere.compute_gc_grid
ESA.util.geo_constant
ESA.util.gp_grid_m
numpy
ESA.util.otool_obj
numpy.random
ESA.util.time_module

 
Classes
       
aod_cl

 
class aod_cl
    class for aod data 
 
 
Members
======================================
 
1. datapath:<str>: file path for aod data 
2. flnm: <flnm>: file name (for future use)
 
3. yyyy: <int>:  year 
4. mm:<int>:     month 
5. dd:<int>:     day 
6. fio_keywords:<dict>: key words for reading aod data
7. varname_dict:<dict>: translations between names in the class 
8. and column names in the file. 
9. fdesc:<grdfile_desc_cl>: file access to aod data
10. fopen:<func>: open data file 
11. fread:<func>: read data in 
12. fclose:<func>: close file 
13. fget: <func>:  get value at given coordinates
14. attr_dict:<dict>: attributes
 
 
 
 
Functions
=======================================================
1. __init___: intialization
2. load_data: load data from file
3. get_data : get aod at given locations
 
  Methods defined here:
__init__(self, datapath, flnm, yyyy, mm, dd, varname_dict={'aod': 'aod', 'lat': 'lat', 'lon': 'lon'}, fopen=<function open_aod_file>, fread=<function read_aod_file>, fclose=<function close_aod_file>, fget=<function get_aod_data>, fio_keywords={}, **keywords)
initialization 
 
Inputs:
------------------------------------------------------
1. datapath:<str>: file path for aod data 
2. flnm: <flnm>: file name for aod file
3. yyyy: <int>:  year 
4. mm:<int>:     month 
5. dd:<int>:     day 
6. varname_dict:<dict>: tranlation between var names 
7. fopen:<func>: open data file 
8. fread:<func>: read data into 
9. fclose:<func>: close file 
10. fget: <func>:  get aod at given locations
11. keywords:<dict>: attribute
get_data(self, olon, olat, oyyyy, omm, odd, osec, **keywords)
get aod coverage at given location 
 
Inputs:
---------------------------------------------
1.olon:<array, (nob,)>: longitude
2.olat:<array, (nob,)>: latitude  
3.oyyyy:<int/array, (nob,)>:  year  (Note 2)
4.omm:<int/array, (nob,)>:  month   (Note 2)
5.odd:<int/array, (nob,)>:  day      (Note 2)
6.osec:<int/array, (nob,)>:  seconds in the day  (Note 2).
 
7. keywords:<dict>: extra inputs
---Reserved Entries
-->common_ref:<str/numeric>: the reference shared by observations.
 
 
 
Returns:
------------------------------------------
1. aod: <array, (nob, naod)>: AOD values 
2. paod: <array, (nob, naod)>:  Probability for AOD values
 
 
 
Notes:
--------------------------------------------
1. keywords passed to self.fget will be = self.fio_keywords+keywords
2. time (yyyy, mm, dd, sec) can be single values while olon and olat 
two arrays of same sizes.
load_data(self, datapath, flnm, yyyy, mm, dd, **keywords)
read data from file to array/table 
 
Inputs:
------------------------------------------------------
1. datapath:<str>: file path for aod data 
2. flnm: <flnm>: file name for aod file
3. yyyy: <int>:  year 
4. mm:<int>:     month 
5. dd:<int>:     day 
6. keywords:<dict>: extra inputs for reading file 
 
 
 
 
Returns:
-------------------------------------
1. is_ready:<T/F>: True if data are read successifully. 
 
 
Notes:
-----------------------------------------------

 
Functions
       
aod_sample(olon, olat, otime, ocnt, aod, paod, aod_limit, mask_val=-999.0)
sampling AOD 
 
Inputs:
----------------------------------------
1. olon:<array, (nobs,)>: observation longitude 
2. olat:<array, (nobs,)>: observation latitude
3. otime:<array, (nobs,)>: observation time
4. ocnt:<array, (nobs,)>: observation number 
5. aod:<array, (nobs,naod)>: AOD values
6. paod:<array, (nobs,naod)>: Probability for AOD values.
7. aod_limit:<float>: upper limit 
8. mask_val:<float>: masking value 
 
 
Returns:
--------------------------------------------
1. mean_aod:<array, (nobs,)>: mean AOD  values for measurements of each observation (see Note 1).
2. mean_cnt:<array, (nobs,)>: counts for good measurements of each observation.
 
Notes:
-----------------------------------------------
1. mean_aod will be calculated only for those measurement below aod_limit, 
if there are some good (small) AOD values sampled