| |
- ctm_world_cl
class ctm_world_cl |
|
general container for gridded geo-physical variables
Members:
------------------------------------------------------------------------------
1. name :<str>: # name for the object
2. ctm_grd: <ctm_grd_cl>: time tag for the object
3. time_tag:<str/float>: to track time
4. __data_list: <list>: list of ctm_field_cl objections
5. attr_dict:<dict>: dictionary for attributes
6. ndata: <integer>: length of the data set
Functions:
---------------------------------------
# member retrieve
1. find_data: search data matching selection criteria of name, tracer_id, tracer_name, category, group and time range etc
# member manage
3. add_data: add data to the list
4. del_data: delete data from the list
5. update_data: update data
6. copy_data: get a copy of the data
7. get_data: return the data (shared the same address of the data member)
# Interpolation
7. get_ctm_grd: return the ctm_grd member
8. copy_ctm_grd: get a copy of the ctm_grd
7. get_gp_slice: get vertical profiles of for select tracer name at locations
# IO
8. load_gp_from_file: load variable from file(s)
9. save_gp_to_file: save variable to file(s)
10. __getitem__: over-riding index |
|
Methods defined here:
- __delitem__(self, index)
- Inputs:
------------------------------------------------
1. index:<integer/slice/string>:
---Index for elements in __data_lst when integer or slice is provided
---name of the elements in __data_lst when string is provided
Outputs:
------------------------------------------------
1. ndel:<integer>: number of elements deleted from __data_lst
- __getitem__(self, index)
- over-ridding index function
Inputs:
------------------------------------------------
1. index:<integer/slice/string>:
---Index for elements in __data_lst when integer or slice is provided
---name of the elements in __data_lst when string is provided
Outputs:
------------------------------------------------
1. data_lst:<list, t:ctm_field_cl>: list of data
- __init__(self, name, data_lst, ctm_grd=None, time_tag='', extra_axis=None, **keywords)
- Initialize
Inputs:
--------------------------------
1. name :<str>: # name for the object
2. data_list: <dict>: list of ctm_field_cl objections
3. ctm_grd: <ctm_grd_cl>: time tag for the object
4. time_tag:<str/float>: time
- add_attr(self, name, val)
- add or replace attributes
Inputs
---------------------------------
1. name:<str>: attribute name
2. val: <obj>: value of the attribute
- add_data(self, data)
- Add data (ctm_field_cl) into the class
Inputs:
------------------------------
1. data:<ctm_field_cl>: class for ctm data
- copy_attr_dict(self)
- copy the attribute dictionary
- find_data(self, **keywords)
- find the data meeting the requirements
Inputs:
----------------------------------------
1. keywords:<dict>: list of criteria
Returns:
------------------------------------------
1. found_data:<list, t:ctm_field_cl>: datasets meeting the criteria
- get_attr(self, name)
- check attribute
Inputs:
---------------------------------------------
1. name:<str>: attribute name
Returns:
----------------------------------------------
1. val:<obj>: value of the attribute
- get_gp_slice(self, olon, olat, **gp_keys)
- get profiles for variables at given locations.
Inputs:
-------------------------------------------------
1. olon:<array, (nob,)>: longitudes
2. olat:<array, (nob,)>: latitudes
3. gp_keys:<dict>: selection criteria
Returns:
--------------------------------------
1. name_lst: <list,t:str>: name of the profiles
2. prof_lst: <list, t:ctm_profile_cl>: list of the profiles
- get_grid(self)
- get ctm grid
Returns:
1. ctm_grd:<ctm_grid_cl>: ctm grid
- is_data_in_list(self, data, keys)
- check whether a data is in the __data_list
Inputs:
1. data:<ctm_field_cl>: CTM fileds
2. keys:<list, t:string>: a list of key should be checked.
Returns:
1. is_found:<integer>: if a data set with the same attributes of data input
is found in the list, its index will be given;
Otherwise, oob.fill_val_int will be returned
- read_data_from_file(self, yyyy, mm, dd, varnames_lst, key_lst, file_read_m)
- virtual function
- set_grid(self, ctm_grd)
- define the grid
Inputs:
1.ctm_grid:<ctm_grid_cl>: grid
| |