Differences between revisions 2 and 10 (spanning 8 versions)
Revision 2 as of 2008-07-07 14:01:30
Size: 288
Editor: RonnyPetrik
Comment:
Revision 10 as of 2008-07-10 11:57:24
Size: 2649
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
  Trockenprogrammierung: insbesondere die Konsistenz von Bildkoordinaten von ASAR und Freibord-Footprint klären  . Trockenprogrammierung: insbesondere die Konsistenz von Bildkoordinaten von ASAR und Freibord-Footprint klären die Klasseneinteilungen von ASAR und Freibordhöhen vergleichen Frage "welche Statistik will man anwenden" beantworten
Line 5: Line 5:
  die Klasseneinteilungen von ASAR und Freibordhöhen vergleichen ----------
 . '''Am Dienstag erzeugtes Programm:'''
Line 7: Line 8:
  Frage "welche Statistik will man anwenden" beantworten {{{
#!python

from pylab import *
from scipy import *
import time,calendar,os,pipes,struct,string
import random
import scipy.ndimage as ndi

nk=3 #number of classes
ndim=[100,100] #dimension of ASAR image in pixels

fx0,fy0,fx2,fy2=[20.,100.,100.,10.] # freeboard coordinates from input file
nf=11 #number of freeboard footprints
fz_h=zeros(nf) #fz_h is the freeboard heights
# produce a random array of freeboard heights
for i in range(nf):
   fz_h[i]=random.random()*70

# the x,y positions of the freeboard footprints
if fx2==fx0:
   fx=zeros(nf)+fx0
   fy=linspace(0,ndim[1],nf)
else:
   teta=(fy2-fy0)/(fx2-fx0)
   fx=linspace(fx0,fx2,nf)
   fy=(fx-fx0)*teta+fy0
#produce a random matrix of ASAR image classes (in 3 classes)

a=zeros((ndim[0],ndim[1]))
for i in range(ndim[0]):
   for j in range(ndim[1]):
      a[i,j]=int(random.random()*(nk)+1)

#tranform from float to int

#A=ndimage.gaussian_filter(a,1)+0.5
#B=A.astype(int)
B=a.astype(int)

#select the class of footprints from ASAR Image
fz=zeros(nf)
for i in range(nf):
   fz[i]=B[int(fx[i]-1),int(fy[i]-1)]

#calculation of mean and standard deviation of freeboard heights in each class
mean=zeros(nk)
std_kl=zeros(nk)
for kl in (1,2,3):
   s=(fz==kl)
   fh_kl=fz_h[s]
   mean[kl-1]=fh_kl.sum()/fh_kl.shape[0]
   std_kl[kl-1]=std(fh_kl)

#plot mean and error bar
kl=[1,2,3]
bar(kl,mean,yerr=std_kl,ecolor='r',align='center')


#calculate correlation coefficient
#corr=xcorr(fz,fz_h,normed=True)[1][nf]

figure()
#plot ASAR image class together with freeboard heights
x=arange(nf)
bar(x,fz,align='center')
ylim(0,6)
ax=twinx()
plot(x,fz_h,'r+-')
xlim(-2,12)

#plot ASAR image with freeboard flight
figure()
plot(fx,fy,'r+-',linewidth=2)
xlim(0,100)
ylim(0,100)
colorbar()
imshow(B,origin='lower',interpolation=None)
hold(True)

#figure()
#imshow(a)
show()
}}}
'''Ziele für Mittwoch: '''

 * Vom gestern erzeugte Graphen verfeinen
 * Programm für ASAR-Rohdaten & Freiborddaten Vergleich

'''Mittwoch<<BR>><<BR>><<BR>><<BR>>Ziele für Donnerstag<<BR>>'''

 * Farbtabelle für Freibordhöhen eibauen
 * Programpaketen der anderen Gruppe übernehmen und ins Programm einbauen
 * Testen und erste Ergebnisse liefern
 * Bericht schreiben

'''Donnerstag'''

die Besprechung ergab fuer diese Gruppe:

  • Trockenprogrammierung: insbesondere die Konsistenz von Bildkoordinaten von ASAR und Freibord-Footprint klären die Klasseneinteilungen von ASAR und Freibordhöhen vergleichen Frage "welche Statistik will man anwenden" beantworten


  • Am Dienstag erzeugtes Programm:

   1 from pylab import *
   2 from scipy import *
   3 import time,calendar,os,pipes,struct,string
   4 import random
   5 import scipy.ndimage as ndi
   6 
   7 nk=3 #number of classes
   8 ndim=[100,100] #dimension of ASAR image in pixels
   9 
  10 fx0,fy0,fx2,fy2=[20.,100.,100.,10.] # freeboard coordinates from input file
  11 nf=11 #number of freeboard footprints
  12 fz_h=zeros(nf) #fz_h is the freeboard heights
  13 # produce a random array of freeboard heights
  14 for i in range(nf):
  15    fz_h[i]=random.random()*70
  16 
  17 # the x,y positions of the freeboard footprints
  18 if fx2==fx0:
  19    fx=zeros(nf)+fx0
  20    fy=linspace(0,ndim[1],nf)
  21 else:
  22    teta=(fy2-fy0)/(fx2-fx0)
  23    fx=linspace(fx0,fx2,nf)
  24    fy=(fx-fx0)*teta+fy0
  25 #produce a random matrix of ASAR image classes (in 3 classes)
  26 
  27 a=zeros((ndim[0],ndim[1]))
  28 for i in range(ndim[0]):
  29    for j in range(ndim[1]):
  30       a[i,j]=int(random.random()*(nk)+1)
  31 
  32 #tranform from float to int
  33 
  34 #A=ndimage.gaussian_filter(a,1)+0.5
  35 #B=A.astype(int)
  36 B=a.astype(int)
  37 
  38 #select the class of footprints from ASAR Image
  39 fz=zeros(nf)
  40 for i in range(nf):
  41    fz[i]=B[int(fx[i]-1),int(fy[i]-1)]
  42 
  43 #calculation of mean and standard deviation of freeboard heights in each class
  44 mean=zeros(nk)
  45 std_kl=zeros(nk)
  46 for kl in (1,2,3):
  47    s=(fz==kl)
  48    fh_kl=fz_h[s]
  49    mean[kl-1]=fh_kl.sum()/fh_kl.shape[0]
  50    std_kl[kl-1]=std(fh_kl)
  51 
  52 #plot mean and error bar
  53 kl=[1,2,3]
  54 bar(kl,mean,yerr=std_kl,ecolor='r',align='center')
  55 
  56 
  57 #calculate correlation coefficient
  58 #corr=xcorr(fz,fz_h,normed=True)[1][nf]
  59 
  60 figure()
  61 #plot ASAR image class together with freeboard heights
  62 x=arange(nf)
  63 bar(x,fz,align='center')
  64 ylim(0,6)
  65 ax=twinx()
  66 plot(x,fz_h,'r+-')
  67 xlim(-2,12)
  68 
  69 #plot ASAR image with freeboard flight
  70 figure()
  71 plot(fx,fy,'r+-',linewidth=2)
  72 xlim(0,100)
  73 ylim(0,100)
  74 colorbar()
  75 imshow(B,origin='lower',interpolation=None)
  76 hold(True)
  77 
  78 #figure()
  79 #imshow(a)
  80 show()

Ziele für Mittwoch:

  • Vom gestern erzeugte Graphen verfeinen
  • Programm für ASAR-Rohdaten & Freiborddaten Vergleich

Mittwoch



Ziele für Donnerstag

  • Farbtabelle für Freibordhöhen eibauen
  • Programpaketen der anderen Gruppe übernehmen und ins Programm einbauen
  • Testen und erste Ergebnisse liefern
  • Bericht schreiben

Donnerstag

LehreWiki: \AG3_Zusammensetzung (last edited 2008-07-11 11:15:06 by anonymous)