コード例 #1
0
    gatech.lon =  str(gps_lon) #'-122.41755' #datetimeloc[3] #'-84.39733'

    gatech.elevation = gps_alt
    gatech.temp = 23.0 #float(datetimeloc[5])

    sol_obj = ephem.Sun(gatech)
    sol=[sol_obj.alt, sol_obj.az]

    icarus_desired=[0.5*target[0]+0.5*sol[0],0.5*target[1]+0.5*sol[1]]
    #print('%s %s %s %f %f' % (time, sol_obj.alt, sol_obj.az,icarus_desired[0],icarus_desired[1]))
    
    sol_alt=sol[0]*rad2deg
    sol_az=sol[1]*rad2deg
    
    icarus_alt=icarus_desired[0]*rad2deg
    icarus_az=icarus_desired[1]*rad2deg
    

    print('%s %s %s %i %i' % (time, sol_obj.alt, sol_obj.az,hf.alt_to_pos2(sol_alt),hf.az_to_pos1(sol_az)))

    # if(hf.az_to_pos1(sol_az) >= 1 and hf.az_to_pos1(sol_az) <= 1023):
    #     if(hf.alt_to_pos2(sol_alt) >= 205 and hf.alt_to_pos2(sol_alt) <= 819): 
    #         hf.movedyn(hf.az_to_pos1(sol_az),hf.alt_to_pos2(sol_alt))
    #         t.sleep(5)
    
    if(hf.az_to_pos1(icarus_az) >= 1 and hf.az_to_pos1(icarus_az) <= 1023):
        if(hf.alt_to_pos2(icarus_alt) >= 205 and hf.alt_to_pos2(icarus_alt) <= 819): 
            hf.movedyn(hf.az_to_pos1(icarus_az),hf.alt_to_pos2(icarus_alt))
            t.sleep(0.2)
	    
コード例 #2
0
ファイル: helios4.py プロジェクト: perezbecker/icarus
    sol_obj._dec = 89.25
    sol_obj.compute(gatech)



    #sol_obj = ephem.Polaris(gatech)
    sol=[sol_obj.alt, sol_obj.az]

    icarus_desired=[0.5*target[0]+0.5*sol[0],0.5*target[1]+0.5*sol[1]]
    #print('%s %s %s %f %f' % (time, sol_obj.alt, sol_obj.az,icarus_desired[0],icarus_desired[1]))
    
    sol_alt=sol[0]*rad2deg
    sol_az=sol[1]*rad2deg
    
    icarus_alt=icarus_desired[0]*rad2deg
    icarus_az=icarus_desired[1]*rad2deg
    

    #print('%s %s %s %i %i' % (time, sol_obj.alt, sol_obj.az,hf.alt_to_pos2(sol_alt),hf.az_to_pos1(sol_az)))

    # if(hf.az_to_pos1(sol_az) >= 1 and hf.az_to_pos1(sol_az) <= 1023):
    #     if(hf.alt_to_pos2(sol_alt) >= 205 and hf.alt_to_pos2(sol_alt) <= 819): 
    #         hf.movedyn(hf.az_to_pos1(sol_az),hf.alt_to_pos2(sol_alt))
    #         t.sleep(5)
    
    if(hf.az_to_pos1(icarus_az) >= 1 and hf.az_to_pos1(icarus_az) <= 1023):
        if(hf.alt_to_pos2(icarus_alt) >= 205 and hf.alt_to_pos2(icarus_alt) <= 819): 
            hf.movedyn(hf.az_to_pos1(icarus_az),hf.alt_to_pos2(icarus_alt))
            t.sleep(5)