initialize
aquacrop.initialize
aquacrop.initialize.calculate_HI_linear
calculate_HI_linear(crop_YldFormCD, crop_HIini, crop_HI0, crop_HIGC)
Function to calculate time to switch to linear harvest index build-up, and associated linear rate of build-up. Only for fruit/grain crops.
Reference Manual (pg. 112)
Arguments:
crop_YldFormCD (int): length of yield formaiton period (calendar days)
crop_HIini (float): initial harvest index
crop_HI0 (float): reference harvest index
crop_HIGC (float): harvest index growth coefficent
Returns:
crop_tLinSwitch (float): time to switch to linear harvest index build-up
crop_dHILinear (float): linear rate of HI build-up
Source code in aquacrop/initialize/calculate_HI_linear.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 |
|
aquacrop.initialize.calculate_HIGC
calculate_HIGC(crop_YldFormCD, crop_HI0, crop_HIini)
Function to calculate harvest index growth coefficient
Reference Manual (pg. 110)
Arguments:
crop_YldFormCD (int): length of yield formation period (calendar days)
crop_HI0 (float): reference harvest index
crop_HIini (float): initial harvest index
Returns:
crop_HIGC (float): harvest index growth coefficient
Source code in aquacrop/initialize/calculate_HIGC.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 |
|
aquacrop.initialize.compute_crop_calendar
compute_crop_calendar(crop, clock_struct_planting_dates, clock_struct_simulation_start_date, clock_struct_simulation_end_date, clock_struct_time_span, weather_df)
Function to compute additional parameters needed to define crop phenological calendar
Reference Manual (pg. 19-20)
Arguments:
crop (Crop): Crop object containing crop paramaters
clock_struct_planting_dates (DatetimeIndex): list of planting dates
clock_struct_simulation_start_date (str): sim start date
clock_struct_time_span (DatetimeIndex): all dates between sim start and end dates
weather_df (DataFrame): weather data for simulation period
Returns:
crop (Crop): updated Crop object
Source code in aquacrop/initialize/compute_crop_calendar.py
14 15 16 17 18 19 20 21 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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
|
aquacrop.initialize.compute_variables
compute_variables(param_struct, weather_df, clock_struct, acfp=dirname(dirname(abspath(__file__))))
Function to compute additional variables needed to run the model eg. CO2 Creates cropstruct jit class objects
Arguments:
param_struct (ParamStruct): Contains model paramaters
weather_df (DataFrame): weather data
clock_struct (ClockStruct): time params
acfp (Path): path to aquacrop directory containing co2 data
Returns:
param_struct (ParamStruct): updated model params
Source code in aquacrop/initialize/compute_variables.py
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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
|
aquacrop.initialize.create_soil_profile
create_soil_profile(param_struct)
funciton to create soil profile namedTuple to store soil info. Its much faster to access the info when its in a namedTuple compared to a dataframe
Arguments:
param_struct (ParamStruct): Contains model crop and soil paramaters
Returns:
param_struct (ParamStruct): updated with soil profile
Source code in aquacrop/initialize/create_soil_profile.py
11 12 13 14 15 16 17 18 19 20 21 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 |
|
aquacrop.initialize.read_clocks_parameters
Inititalize clocks parameters
check_max_simulation_days(sim_start_time, sim_end_time)
Check that the date range of the simulation is less than 580 years. In pandas this cannot happen due to the size of the variable
Arguments:
sim_start_time (str): simulation start date YYYY/MM/DD
sim_end_time (str): simulation start date YYYY/MM/DD
Source code in aquacrop/initialize/read_clocks_parameters.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
read_clock_parameters(sim_start_time, sim_end_time, off_season=False)
Function to read in start and end simulation time and return a ClockStruct object
Arguments:
sim_start_time (str): simulation start date
sim_end_time (str): simulation start date
off_season (bool): True, simulate off season
False, skip ahead to next season post-harvest
Returns:
clock_struct (ClockStruct): simulation time paramaters
Source code in aquacrop/initialize/read_clocks_parameters.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 |
|
aquacrop.initialize.read_field_managment
read_field_management(ParamStruct, FieldMngt, FallowFieldMngt)
store field management variables as FieldMngtStruct object
Arguments:
ParamStruct (ParamStruct): Contains model crop and soil paramaters
FieldMngt (FieldMngt): field mngt params
FallowFieldMngt (FieldMngt): fallow field mngt params
Returns:
ParamStruct (ParamStruct): updated ParamStruct with field management info
Source code in aquacrop/initialize/read_field_managment.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
aquacrop.initialize.read_groundwater_table
read_groundwater_table(ParamStruct, GwStruct, ClockStruct)
Function to initialise groundwater parameters
Arguments:
ParamStruct (ParamStruct): Contains model paramaters
GwStruct (GroundWater): groundwater params
ClockStruct (ClockStruct): time params
Returns:
ParamStruct (ParamStruct): updated with GW info
Source code in aquacrop/initialize/read_groundwater_table.py
13 14 15 16 17 18 19 20 21 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 |
|
aquacrop.initialize.read_irrigation_management
read_irrigation_management(ParamStruct, IrrMngt, ClockStruct)
initilize irrigation management and store as IrrMngtStruct object
Arguments:
ParamStruct (ParamStruct): Contains model crop and soil paramaters
IrrMngt (IrrigationManagement): irr mngt params object
ClockStruct (ClockStruct): time paramaters
Returns:
ParamStruct (ParamStruct): updated model paramaters
Source code in aquacrop/initialize/read_irrigation_management.py
14 15 16 17 18 19 20 21 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 |
|
aquacrop.initialize.read_model_initial_conditions
read_model_initial_conditions(ParamStruct, ClockStruct, InitWC, crop)
Function to set up initial model conditions
Arguments:
ParamStruct (ParamStruct): Contains model paramaters
ClockStruct (ClockStruct): time paramaters
InitWC (InitialWaterContent): initial water content
crop (Crop): crop parameters
Returns:
ParamStruct (ParamStruct): updated ParamStruct object
InitCond (InitialCondition): containing initial model conditions/counters
Source code in aquacrop/initialize/read_model_initial_conditions.py
16 17 18 19 20 21 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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
|
aquacrop.initialize.read_model_parameters
read_model_parameters(clock_struct, soil, crop, weather_df)
Finalise soil and crop paramaters including planting and harvest dates save to new object param_struct
Arguments:
clock_struct (ClockStruct): time params
soil (Soil): soil object
crop (Crop): crop object
weather_df (DataFrame): list of datetimes
Returns:
clock_struct (ClockStruct): updated time paramaters
param_struct (ParamStruct): Contains model crop and soil paramaters
Source code in aquacrop/initialize/read_model_parameters.py
15 16 17 18 19 20 21 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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
|
aquacrop.initialize.read_weather_inputs
Initialize weather data
read_weather_inputs(clock_sctruct, weather_df)
Clip weather to start and end simulation dates
Arguments:
clock_sctruct (ClockStruct): ClockStruct object
weather_df (DataFrame): weather dataframe
Returns:
weather_df (DataFrame): clipped weather dataframe
Source code in aquacrop/initialize/read_weather_inputs.py
10 11 12 13 14 15 16 17 18 19 20 21 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 |
|