@@ -0,0 +1,2180 @@
+#-------------------------------------------------------------------------------%0A# Name:        attenuationCor.py%0A# Purpose:%0A#%0A# Author:      stephan lindauer%0A# Institute:   bergische university of wuppertal%0A#%0A# Created:     10.03.2014%0A# Copyright:   (c) lindauer 2014%0A# Licence:     MIT%0A#%0A# Description: attenuation correction of processed RADOLAN DX data based%0A#              on Kraemer algorithm%0A#%0A# Requirement: processed RADOLAN DX Data with wradlib.io.readDX%0A#-------------------------------------------------------------------------------%0A%0Aimport csv%0Aimport os%0A%0A# enter data directory here%0Adatadir = 'DataT4/'%0A# enter where to write new data%0Aexp = 'DataOut/'%0A%0A# entry parameters for correcting the attenuation%0Aalpha=1*10**(-5)%0Abeta=0.90%0A%0Afiles = os.listdir(datadir)%0Aprocessfile=0%0A%0A# processes all files in datadir%0Afor processfile in files:%0A%0A    ifile = open(datadir+processfile, %22rb%22)%0A    reader = csv.reader(ifile, delimiter=' ')%0A    ofile = open(exp+processfile, %22wb%22)%0A    writer = csv.writer(ofile, delimiter=';')%0A    %0A    daten=%5B%5D%0A    %0A    for lines in reader:%0A        lineNum = 1%0A        # lineNum should be maximum line numbers of input files with standard value of 360%0A        while lineNum %3C= 360:%0A            # dbzA = entry value for correction%0A            dbzA=0%0A            dataKor=%5B%5D%0A            dataDBZ=%5B%5D%0A            if reader.line_num == lineNum:%0A                eleNum = 0%0A                while eleNum %3C len(lines):%0A                    # no correcting for first value%0A                    if eleNum == 0:%0A                        dM = float(lines%5BeleNum%5D)+dbzA%0A                    # correction for attenuation for all other elements%0A                    else:%0A                        if float(dataKor%5BeleNum-1%5D/10) %3E 60:%0A                            dbzA = 2.50%0A                        else:%0A                            dbzA=alpha*((10**((float(dataKor%5BeleNum-1%5D))/10))**beta)%0A                        dM = (float(lines%5BeleNum%5D))+dbzA+sum(dataDBZ)%0A                    dataDBZ.append(dbzA)%0A                    eleNum+=1%0A                    dataKor.append(dM)%0A                writer.writerow(dataKor)%0A            lineNum+=1%0A   %0A    ifile.close()%0A    ofile.close()%0A

Create attenuationCor.py