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

Class for cloud PDF data
 
Authors: L. Feng, Edinburgh University
History: v0.9, 2012.06.28
History: v0.95, 2013.02.26
 
Classes:
============================================
1. cloud_cl: class for cloud PDF data

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

 
Classes
       
cloud_cl

 
class cloud_cl
    class for cloud data 
 
 
Members
======================================
 
1. datapath:<str>: file path for cloud 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 cloud 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 cloud 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 cloud at given locations
 
  Methods defined here:
__init__(self, datapath, flnm, yyyy, mm, dd, varname_dict={'cloud': 'val', 'lat': 'lat', 'lon': 'lon'}, fopen=<function open_cloud_file>, fread=<function read_cloud_file>, fclose=<function close_cloud_file>, fget=<function get_cloud_data>, fio_keywords={}, **keywords)
initialization 
 
Inputs:
------------------------------------------------------
1. datapath:<str>: file path for cloud data 
2. flnm: <flnm>: file name for cloud file
3. yyyy: <int>:  year 
4. mm:<int>:     month 
5. dd:<int>:     day 
6. read_to_array:<T/F>: if True, data will be read from file as arrays. 
7. use_current_time:<T/F>: 
 
---if True, input time (yyyy, mm, dd) will be used to read data.
---if False, default time will be used to read data 
 
 
8. fopen:<func>: open data file 
9. fread:<func>: read data into 
10. fclose:<func>: close file 
11. fget: <func>:  get cloud at given locations
12. keywords:<dict>: attribute
get_data(self, olon, olat, oyyyy, omm, odd, osec, **keywords)
get cloud 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. pcld: <array, (nob)>: cloud coverage percentage
 
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 cloud data 
2. flnm: <flnm>: file name for cloud 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
       
cloud_sample(olon, olat, otime, ocnt, cloud_pdf, fpenalty=None, **keywords)
Set cloud flag according cloud PDF 
 
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. cloud_pdf:<array>: cloud percentage
6. fpenalty:<funct>:cloud  PDF penality function.   
7. keywords:<dict>: extra contral variables
 
Returns:
----------------------------------------------------------
1. clear_cnt:<array>: the count number of cloud free scene