Beispiel #1
0
def date_label(s,x,y,xpos):
    global h
    xx = x[logical_not(isnan(x))]
    yy = y[logical_not(isnan(x))]
    xx = xx[logical_not(isnan(yy))]
    yy = yy[logical_not(isnan(yy))]
    ypos = interp(xpos,xx,yy)
    text(xpos[0]-0.1,ypos[0],s,fontsize=6,\
         horizontalalignment='right',verticalalignment='center')
    text(xpos[1]+0.1,ypos[1],s,fontsize=6,\
         horizontalalignment='left',verticalalignment='center')


# Winter solstice
Dec21 = (date(2012,12,21)-Jan1).days
x,y = shadowtime.day_path(phi,delta,h,Dec21)
x = x/h
y = y/h
plot(x,y,'k',linewidth=1.0)
date_label('dec21',x,y,xlimits)

# Equinox
March20 = (date(2012,3,20)-Jan1).days
x,y = shadowtime.day_path(phi,delta,h,March20)
x = x/h
y = y/h
plot(x,y,'k',linewidth=1.0)
date_label('mar20',x,y,xlimits)

# Summer solstice
June20 = (date(2012,6,20)-Jan1).days
for hour in [2,16,17,18,19,20,21,22,23,24]:
    x,y = shadowtime.analemma(phi,delta,h,hour)
    x = x/h
    y = y/h
    x[x < -4] = None
    y[x < -4] = None
    x[x > 4] = None
    y[x > 4] = None    
    plot(Tx(x),Ty(y),'k')

plot(Tx(0),Ty(0),'ks')    
axis('off')


x,y = shadowtime.day_path(phi,delta,h,365+shadowtime.solstice_offset)
x = x/h
y = y/h

x[x < -4] = None
y[x < -4] = None
x[x > 4] = None
y[x > 4] = None 
plot(Tx(x),Ty(y),'k',linewidth=2.0)
x,y = shadowtime.day_path(phi,delta,h,365/2+shadowtime.solstice_offset)
x = x/h
y = y/h

x[x < -4] = None
y[x < -4] = None
x[x > 4] = None