| |
- ctm_field_2d
class ctm_field_2d |
|
general container for geo-physical variables defined in a 2D-grid
It can be used to store multiple surface fields, and contains transform and interploations etc
Members:
------------------------------------------------------------------------------
1. name: <str>: name (container name etc)
2. ctm_grid:<ctm_grid_cl>: the grid for ctm field.
3. is_xy_data:<T/F>: True when data is in form of [lon, lat, ...]
4. ndim: <integer>: number of dimensions.
5. dims: <array>: sizes in each directions.
6. extra_axis:<gp_axis>: extra axis.
7. attr_dict:<dict>: dictionary for attributes.
8. data: <array>: data
9. unit:<str/float>: unit of the data
Attributes (expected or reserved)
---------------------------------------------------
1. tracer_name:<str>: tracer name
2. tracer_id:<integer>: tracer number
3. category:<str>: tracer category
4. group:<str/integer>: group id for the tracer
5. tau_st:<float>: start time (Seconds since 1985.01.01 00:00)
6. tau_end:<float>:end time (Seconds since 1985.01.01 00:00)
Functions:
-----------------------------------------------------------------------------
1. __init__:Initialization
2. get_grid: get CTM grid
# data retieval and maintainence.
3. update_data: update the data set and its attributes
4. copy_data: get the copy of the data set.
5. get_data: return the class data member.
5. __getitem__: (over-riding) index function
6. get_profile: get profiles at the horizontal locations
# attributes
7. set_attr: set attribute
8. get_attr: get attribute
9. is_matched: compare attributes
10. copy_attr_dict: get attriute dictionary
11. copy: make a copy of the class
# attribute functions |
|
Methods defined here:
- __getitem__(self, index)
- over-ridding index function
Inputs:
---------------------------------
1. index:<array,(ndim, )>: element indexs of data array
Returns:
---------------------------------
1. data[index]:<array>: data values at the elements specified by index.
- __init__(self, name, data, unit='', ctm_grd=None, is_xy_data=True, extra_axis=None, **keywords)
- initialization
Input:
--------------------------------------
1. name:<str>:name of the object
2. data:<array>: (2D, or 3D) data over ctm_grid
Data is assumed to be in the form of
--->(a). (lon, lat) for 2D spatial distributions or
--->(b). (lon, lat, ntime) for 2D time serie,
--->(c). (lon, lat, ne) 2D data ensemble
3. ctm_grd:<ctm_grid_cl>: grid
4. is_xy_data:<T/F>:I
5. keywords:<dict>: attributes
reserved keywords:
--->tracer_name:<str>: tracer name
--->tracer_id:<integer>: tracer number
--->category:<str>: tracer category
--->group:<str/integer>:tracer group
--->tau0:<float>: start time (hours since 1985.01.01 00:00)
--->tau1:<float>:end time (hours since 1985.01.01 00:00)
- copy(self)
- make a copy of the class
Returns:
--------------------------------------
1. new_field: a copy of field
- copy_attr_dict(self)
- get the attribute dictionary
- copy_data(self)
- get a copy of the data
Outputs:
-------------------------------------------
1. data:<array,>: one copy of the data stored here
- get_attr(self, name)
- get attribute
Inputs:
-----------------------------
1. name:<str>: attribute name
Returns:
-------------------------------
1. val: <obj>: attribute value
- get_data(self)
- get the data
Outputs
----------------------------------
1. self.data:<array,>: the data member
- get_grid(self)
- retrieve CTM grid
Returns:
-----------------------------------------------------
1. ctm_grd:<ctm_grd_cl>: class
- get_profile(self, olon, olat)
- get profiles at the horizontal locations (olon, olat)
Inputs:
---------------------------------
1. olon:<array, (nob,)>: longitudes at nob locations
2. olat:<array, (nob,)>: latitudes at nob locations
Returns:
---------------------------------
1. prof:<array, (nob, nz)>: profiles at nob locations
- is_matched(self, **keywords)
- Check whether attribute is matched what is required
Inputs:
-------------------------------------------------
1. keywords:<dictionary>: Attributes to be compared
- set_attr(self, name, val)
- set attribute
Inputs:
-----------------------------
1. name:<str>: attribute name
2. val: <obj>: attribute value
- set_grid(self, ctm_grd)
- define the grid
Inputs:
---------------------------------
1.ctm_grid:<ctm_grid_cl>: grid
- update_data(self, data, **keywords)
- change data member
Inputs:
----------------------------------------
1.data:<array, ([nlon], [nlat], [nz], ,,,)>:
data array with shape assumed to be consistent with ctm_grid
2. keywords:<dict>: extra inputs
| |