You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working adapting SimpleCrop to be PyMT compatible and was wondering how you usually dealt with temporal mismatch between model components. The SimpleCrop model (as a wrapper around the command line interface at least) operates on a yearly basis. It takes in weather and irrigation data for each day of the year as well as some cross sectional soil and plant data. It returns plant and soil data for each day of the year. How would you deal with this mismatch? I was thinking that this could be made easier by having some generic memory components to build up results in. I was thinking of something like
fromsimplecrop.modelsimportWeather, Irrigation, Crop# may need to choose a different storage strategy in many model timesteps don't fit into memoryfrompymt.storageimportMemoryfrompymt.model_adaptersimportTimeAggregator# the weather and models crop operate on a daily basis but are converted to yearly componentsweather=TimeAggregator(Weather(), to='year', storage=Memory())
# you may specify a keep option so that only model state used by other models is kept irrigation=TimeAggregator(Irrigation(), to='year', storage=Memory(), keep= ['irrigation_volume__total'])
weather.initialize(*weather.setup())
irrigation.initialize(*irrigation.setup())
# the crop model operates on a yearly basiscrop=Crop()
crop.initialize(*crop.setup())
# run the model for five yearsfortimeinrange(5):
weather.update()
irrigation.update()
crop.set_value('irrigation_volume__total', irrigation.get_value('irrigation_volume__total'))
crop.set_value('soil_temperature__max', weather.get_value('soil_temperature__max'))
crop.set_value('soil_temperature__min', weather.get_value('soil_temperature__min'))
crop.set_value(
'soil_top_surface_raditation~incoming__energy_flux',
weather.get_value('soil_top_surface_raditation~incoming__energy_flux'))
crop.update()
What do you think? How do you currently handle differences in temporal range and resolution?
The text was updated successfully, but these errors were encountered:
I've been working adapting
SimpleCrop
to be PyMT compatible and was wondering how you usually dealt with temporal mismatch between model components. The SimpleCrop model (as a wrapper around the command line interface at least) operates on a yearly basis. It takes in weather and irrigation data for each day of the year as well as some cross sectional soil and plant data. It returns plant and soil data for each day of the year. How would you deal with this mismatch? I was thinking that this could be made easier by having some generic memory components to build up results in. I was thinking of something likeWhat do you think? How do you currently handle differences in temporal range and resolution?
The text was updated successfully, but these errors were encountered: