Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when modifying planting date #181

Open
cgalea15 opened this issue Oct 7, 2024 · 1 comment
Open

Error when modifying planting date #181

cgalea15 opened this issue Oct 7, 2024 · 1 comment

Comments

@cgalea15
Copy link

cgalea15 commented Oct 7, 2024

I'm trying to apply changes in planting and harvesting dates with the following configuration in the model:

"Climate input
lars_fp=get_filepath('SG02_software.dat')
base=pd.read_csv(lars_fp, sep='\t', engine='python')
base['Date']=pd.to_datetime(base['Date'])
Crop input
crop=Crop('BarleyGDD',planting_date='02/01', CalendarType=2)
Soil input
soil=Soil('SandyLoam')
Initial water condition input
init_wc = InitialWaterContent('FC') # default is field capacity. Maybe we can play with this values to adapt it to the actual yield

model=AquaCropModel('2001/01/01','2023/04/30',base,soil,crop,init_wc)
model.run_model(till_termination=True)"

It works if the planting date is 05/x but it returns the following error when changing it:

"File ~\anaconda3\Lib\site-packages\aquacrop\solution\biomass_accumulation.py:104 in biomass_accumulation
dB = WPadj * (Tr / et0)"

I printed et0 and Tr values in this line and most Tr are 0 and some et0 are 0 too. I imagine that it has something to do with the calculation of Tr maaybe because of the climate data but I wanted to share it in case someone could help me.
Thanks

@cgalea15
Copy link
Author

cgalea15 commented Oct 7, 2024

I forgot to include the actual error that python returns

ZeroDivisionError: float division by zero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant