I have a problem with the choice of calculation years.
python flux2nc.py ../data/output/fluxes/ ../data/output/IMPORTANT: ../data/output/fluxes/ SHOULD CONTAIN ONLY FLUXES FILES!!!Choose output parameter1 - Precipitation2 - Evapotranspiration3 - Runoff4 - Base flow5 - Snow Water Equivalent6 - Soil moistureChoose output (1 a 6)>3Enter start year:2011End year:2012Traceback (most recent call last):File "flux2nc.py", line 240, in <module>main()File "flux2nc.py", line 234, in mainflux2nc(sys.argv[1],sys.argv[2])File "flux2nc.py", line 120, in flux2ncinidate = dt.date(start_year,1,1)TypeError: an integer is required (got type str)
I know that this problem is already posed, but I can't find the exact solution given my limited knowledge on python, and the script is pretty much complicated.
here is the part of the source code, related to my question.
# import dependencies
import sys
import os, string
# handle dates...
import datetime as dt
# NetCDF and Numeric
from netCDF4 import *
from numpy import *# if the date information is not set get it from userif start_year == None:# for what date?start_year = input("Enter start year:")if end_year == None:end_year = input("End year:")# set date information in datetime objectinidate = dt.date(start_year,1,1)enddate = dt.date(end_year,12,31)# calculate number of days in time seriesdays = enddate.toordinal() - inidate.toordinal()+1