This class is used to specify a chunk in a NetCDF file that corresponds to geophysical data. The keyword used are:
Attributes
| t_min | (int) The minimum index along the time dimension |
| t_max | (int) The maximum index along the time dimension |
| z_min | (int) The minimum index along the vertical dimension |
| z_max | (int) The maximum index along the vertical dimension |
| lat_min | (int) The minimum index along the latitudinal dimension |
| lat_max | (int) The maximum index along the latitudinal dimension |
| lon_min | (int) The minimum index along the longitudinal dimension |
| lon_max | (int) The maximum index along the longitudinal dimension |
| The chunk class is derived from the main python dictionnary class. | |
| The values associated with each keywords are set to None by default. |
Methods
Return the maximum of the chunk value along one dimension
| Parameters: | dim : {‘T’, ‘Z’, ‘Y’, ‘X’}
|
|---|
Examples
>>> chk = chunk(t_min=0, t_max=25, lat_min=23, lat_max=125,
... lon_min=65, lon_max=243)
>>> chk.max('T')
25
>>> chk.max('Z')
>>> chk.max('Y')
125
>>> chk.max('X')
243
Return the minimum of the chunk value along one dimension
| Parameters: | dim : {‘T’, ‘Z’, ‘Y’, ‘X’}
|
|---|
Examples
>>> chk = chunk(t_min=0, t_max=25, lat_min=23, lat_max=125,
... lon_min=65, lon_max=243)
>>> chk.min('T')
0
>>> chk.min('Z')
>>> chk.min('Y')
23
>>> chk.min('X')
65
Get the size of the chunk along the depth dimension
| Returns: | n_z : int
|
|---|
Examples
>>> chk = chunk(z_min=4, z_max=7)
>>> chk.size_depth()
3
>>> chk = chunk(z_min=4)
>>> chk.size_depth()
1
Get the size of the chunk along one dimension
| Parameters: | dim : {‘T’, ‘Z’, ‘Y’, ‘X’}
|
|---|---|
| Returns: | n : int
|
Examples
>>> chk = chunk(t_min=0, t_max=25, z_min=4, z_max=7,
... lat_min=23, lat_max=125, lon_min=65, lon_max=243)
>>> chk.size_dim('T')
25
>>> chk.size_dim('Z')
3
>>> chk.size_dim('Y')
102
>>> chk.size_dim('X')
178
Get the size of the chunk along the latitudinal dimension
| Returns: | n_lat : int
|
|---|
Examples
>>> chk = chunk(lat_min=23, lat_max=125)
>>> chk.size_lat()
102
>>> chk = chunk(lat_max=125)
>>> chk.size_lat()
1
Get the size of the chunk along the latitudinal and longitudinal dimensions
| Returns: | n_lat : int
n_lon : int
|
|---|
Examples
>>> chk = chunk(lat_min=23, lat_max=125, lon_min=65,
... lon_max=243)
>>> chk.size_latlon()
(102, 178)
Get the size of the chunk along the longitudinal dimension
| Returns: | n_lon : int
|
|---|
Examples
>>> chk = chunk(lon_min=65, lon_max=243)
>>> chk.size_lon()
178
>>> chk = chunk(lon_min=65)
>>> chk.size_lon()
1