ESA.surface.split_t3_region
index
/home/lfeng/otool/ESA/surface/split_t3_region.py

Wrapper for functions in divide_region.py to 
generate 144 global regions from T3 standard regions
 
Authors: L. Feng, Edinburgh University
History: v0.9, 2012.06.28
History: v0.95, 2013.01.12
 
 
 
Functions:
==============================================================
1. get_reg_op_lst: generate a list for action (split) for each T3 region 
2. split_t3_region: split t3 region into  sub-regions.

 
Modules
       
ESA.surface.divide_region
ESA.util.geo_constant
ESA.util.gen_plots
ESA.atmosphere.ctm_grid_2d
ESA.util.message_m
ESA.util.otool_ncfile_io
numpy
ESA.util.otool_obj
ESA.util.otool_var_io
pylab

 
Functions
       
get_reg_op_lst(reg_id_lst, nsub_lon_lst, nsub_lat_lst, split_op=<function divide_region_to_subregion>)
construct reg_op_lst for dividing regions 
 
Inputs:
---------------------------------------------------
1. reg_id_lst:<list, t:int>:  region id for parent regions
2. nsub_lon_lst:<list, t:int>: number of subregions along longitudes 
3. nsub_lat_lst: <list, t:int>: number of subregions along latitudes
 
 
returns:
-------------------------------------------
1. reg_op_lst:<list, t:reg_op_cl>: class for operations on region maps
split_t3_region(out_ncflnm, do_debug=False, **keywords)
split T3 regions into sub-regions
 
Inputs:
1. out_ncflnm:<str>: name for the name map file 
2. do_debug:<T/F>: debug 
3. keywords:<dict>: extra inputs 
 
---Reserved keywords
--->1.map_flnm:<str>: original file 
--->2.varnames:<list, t:str>: names for lon,lat and map in original map file 
--->3. reg_id_lst:<list, t:id>: ids for regions to be splited 
--->4. nsub_lon_lst:<list, t:int>: number of subregions along longitudes 
--->5.  nsub_lat_lst: <list, t:int>: number of subregions along latitudes

 
Data
        def_t3_mapflnm = 'reg_flux_t3_05x05.nc'
def_t3_nsub_lat_lst = [1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, ...]
def_t3_nsub_lon_lst = [1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, ...]
def_t3_reg_id_lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...]
def_t3_reg_type_lst = [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, ...]
def_t3_varnames = ['longitude', 'latitude', 'map', 'flux', 'area', 'pid']