This is not possible because I'm using ArcGIS at my office which doesn't have enough money to buy a newer version.
The first thing you'll want to do is install the latest service pack. There are a host of issues that have been resolved and this could very possibly be one.http://support.esri.com/en/downloads/patches-servicepacks/view/productid/160/metaid/1876
1. I'm using ArcGIS 10.0 SP0
#import import sys import os import math import csv from xlwt import Workbook from decimal import Decimal import arcpy from arcpy import env from arcpy.sa import * # Check out any necessary licenses arcpy.CheckOutExtension("spatial") #choice of model model = "reticB1" #defining time period byear = "2020" eyear = "2099" #read global data from .csv file filePath = "F:/Documents/projections_climatiques/" fileEvapn = "/evapn/" filePrtot = "/prtot/" nomEvapn = model + "_evapn_output.csv" nomPrtot = model + "_prtot_output.csv" #path for recording directory for shapefile and .xls dirfiles = "F:\\Documents\\these2009-2010\\BHspatialise\\avecCLC\\journalier\\" pathfiles = dirfiles+model+'\\' if os.path.exists(pathfiles): arcpy.env.workspace = pathfiles os.chdir(pathfiles) else: print("Directory %s do not exist" % pathfiles) raise #counting days to manage nbday=0 for year in range (2001, int(byear)): if (year%4 == 0 and year%100 != 0 or year%400 == 0): count_day=366 nbday=nbday+count_day else : count_day=365 nbday=nbday+count_day nbday=str(nbday) print ("number of days before studied period : "+nbday) an_bi=[] for year_p in range (int(byear), int(eyear)+1): if (year_p%4 == 0 and year_p%100 != 0 or year_p%400 == 0): an_bi.append(year_p) print ("bissextiles years during period: ") print (an_bi[:]) nbAnneesBi = len(an_bi) print (nbAnneesBi) nbday=int(nbday) #number of days before studied period nbcol=3+nbday #number of columns before studied period byear=int(byear) eyear=int(eyear) nbcolfin=3+nbday+nbAnneesBi*366+(eyear-byear-nbAnneesBi+1)*365-1 dataFiPath1 = filePath+model+fileEvapn+nomEvapn dataFiPath2 = filePath+model+filePrtot+nomPrtot csv.field_size_limit(1000000000) csv.field_size_limit() x=0 for col in range (nbcol, nbcolfin, 1): dataFichier1=open(dataFiPath1,"rb") dataFichier2=open(dataFiPath2,"rb") book = Workbook() sheet1 = book.add_sheet('ET', cell_overwrite_ok=True) sheet2 = book.add_sheet('P', cell_overwrite_ok=True) ET=dataFichier1.readline() P=dataFichier2.readline() x=0 while ET and P: P=P.split(';') ET=ET.split(';') ET1=ET[0] ET2=ET[1] ET3=ET[2] ETval=ET[col] P1=P[0] P2=P[1] P3=P[2] Pval=P[col] row1=sheet1.row(x) row2=sheet2.row(x) if x!=0: row1.write(0,ET1) row1.write(1,Decimal(ET2)) row1.write(2,Decimal(ET3)) row1.write(3,Decimal(ETval)) row2.write(0,P1) row2.write(1,Decimal(P2)) row2.write(2,Decimal(P3)) row2.write(3,Decimal(Pval)) else : row1.write(0,ET1) row1.write(1,ET2) row1.write(2,ET3) date2 = ETval date = date2.replace(" ","_") row1.write(3,ETval) row2.write(0,P1) row2.write(1,P2) row2.write(2,P3) row2.write(3,Pval) ET=dataFichier1.readline() P=dataFichier2.readline() x=x+1 book.save(pathfiles+model+date+'.xls') dataFichier1.close() dataFichier2.close() month = date[5:7] year = date[0:4] day = date[8:10]
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.