Base
create_grid_file(*args, **kwargs)
Backward-compatible wrapper for creating a grid file.
Source code in isca_tools/time_series/base.py
12 13 14 | |
create_time_arr(*args, **kwargs)
Backward-compatible wrapper for creating time coordinates.
Source code in isca_tools/time_series/base.py
17 18 19 | |
create_time_series_file(file_name, namelist_file, var_name, var_func, time_spacing, exp_dir=None, grid_file=None, pressure_var=None, **kwargs)
Create an Isca time-varying input file from a user-supplied function.
This is a convenience wrapper around :mod:isca_tools.run.create_files.write_var.
The callback should produce values for the supplied time, pressure, latitude and longitude arrays,
with the time axis first. For example::
def co2_func(days, pressure, lat, lon):
arr = np.ones((len(days), len(pressure), len(lat), len(lon))) * 600
arr[days < 360 * 5] = 300
return arr
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name
|
str
|
Output file name, usually ending in |
required |
namelist_file
|
str
|
Path to the experiment namelist. |
required |
var_name
|
str
|
Name to store in the NetCDF file. |
required |
var_func
|
Callable
|
Function returning the variable values on the chosen grid. |
required |
time_spacing
|
int
|
Interval between values in days. |
required |
exp_dir
|
Optional[str]
|
Optional override for the experiment directory. Defaults to the namelist directory. |
None
|
grid_file
|
Optional[str]
|
Optional explicit grid file path. If omitted one is created for the experiment resolution. |
None
|
pressure_var
|
Optional[ndarray]
|
Optional pressure coordinate override. |
None
|
Source code in isca_tools/time_series/base.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
write_var(*args, **kwargs)
Backward-compatible wrapper for the general variable writer.
Source code in isca_tools/time_series/base.py
110 111 112 | |