Beispiel #1
0
def work():
    import clean
    import week_control
    while True:
        clean.clear()
        open_file = open(
            ("files/week_report" + "-" + week_control.primer_dia() + '-' +
             week_control.ultimo_dia() + '.txt'), 'w+')
        open_file2 = open("files/LOG.txt", 'r')
        print("""
        +=========================================+
        |Se genero un reporte de semana con exito |
        +=========================================+
        """)

        if ((input('Desea generar el Resumen => ')).upper() == 'Y'):
            array = open_file2.read().splitlines()
            open_file.write("Semana del " + str(week_control.primer_dia()) +
                            ' al ' + str(week_control.ultimo_dia()))
            for i in array:
                array2 = i.split(',')
                open_file.write('---------------------')
                open_file.write("Turno = " + array2[0])
                open_file.write("linea = " + array2[1])
            break
        else:
            break
Beispiel #2
0
def work():
    while True:
        clean.clear()
        global open_file
        print("""
        ==============================================
        WELCOME IT IS TIME TO ADD DATA TO THE SYSTEM
        ==============================================
        """)

        try:
            add_line = int(input("Ingresa la linea => "))
            print("============>")
            add_turn = int(
                input("Ingresa turno (1= Mañana, 2= Tarde, 3=Noche) => "))
            print("============>")
            add_total_num_prod = int(input("Total de Productos => "))
            print("============>")
            add_total_stopped = int(input("Total de detenciones => "))
            print("======================================>")
        except ValueError:
            print("Dato invalido ingresa solo numeros")
        add(add_turn, add_line, add_total_num_prod, add_total_stopped)

        next_pass = input("¿Agregar otro dato? (Y/N) =>")
        if next_pass.upper() == 'N':
            break
def main():
    #pontos = 30
    for file_name in os.listdir("entrada"):
        trataArquivo(file_name)
        W_data = []
        W_valor = []
        with open(
                'output.ou'
        ) as f:  #inicializa os valores de W a partir do arquivo de entrada
            for linha in f:
                linha = linha.strip()
                if linha:
                    valores = linha.split(',')
                    x, y = trataValores(valores)
                    W_data.append(x)
                    W_valor.append(y)

        od_pips, od_volca, od_zigzag = erro.main(file_name, W_data, W_valor)
        #graf.gera_graficos(od_volca, od_pips, od_zigzag, file_name, pontos)
        os.remove("output.ou")
        clean.clear()
Beispiel #4
0
def derive_Selencoords(tlefile):
    import Check_tle
    import Create_SPK
    import Selen_Calc
    import clean

    #Add tle file to cwd and enter name below
    tle = tlefile

    setup = Check_tle.makesetup(tle)
    #setup looks like [setn, setn + '_setup.txt', setn + '.bsp']

    Create_SPK.mkspk(setup[1])

    a = Selen_Calc.Calculate_SCoords(setup[0])

    print a

    clean.clear(setup, tle)

    return a
Beispiel #5
0
win.keypad(1)

write.clear()

fin = False
while (fin == False):

	#initializes all variables

	#initialize colours
	curses.use_default_colors()
	curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_GREEN)
	curses.init_pair(2, curses.COLOR_GREEN, curses.COLOR_GREEN)

	#run difficulty
	clean.clear(win)
	#return chosen difficulty
	dif = diff.choice(win)

	#clear screen
	clean.clear(win)

	''' ADD THREAD FOR INTRO AND REGISTERS '''
	'''
		will run a thread for the word generation as well as the intro scene
		safe variable is for checking if both threads are done
	'''
	#start intro
	def start_thread(c):
		global safe
		if c == 1:
Beispiel #6
0
import clean
while True:
    clean.clear()
    import week_control
    print(
        """
    +-------------------------------------------+
    | Welcome to XETU Manage System V 2.0       |
    +-------------------------------------------+
    -> 1.	Ingresar datos de la línea
    -> 2.	Hacer resumen
    -> 3.	Reiniciar semana
    -> 4.	Consultas parciales
    -> 6.	Salir
    +-------------------------------------------+
    """, "Fecha en el sistema:", week_control.dia(), """
    +===========================================+
    """)

    enter_to = input("Ingresa alguna opción =>")
    if (enter_to == "1"):
        import add_data
        add_data.work()
    elif (enter_to == "2"):
        import make_resume
        make_resume.work()
    elif (enter_to == "3"):
        import reboot_week
    elif (enter_to == "4"):
        import partial_consult
    elif (enter_to == "6"):
Beispiel #7
0
def run(a, xmin, xmax):
    #Run ROLO over all wavelengths for observation date, selenographic
    #coordinates. Values in lunar are assigned as follows with long and lat
    #in selenographic coordinates:
    import numpy as np
    import subprocess
    import math
    from DiskE_Ref import lunar
    from com_sol_rsr import combine_spectra
    from integration import make_traps, trap_integrate, trap_file
    from clean import clear
    from plotspectra import plot_sets

    #This script runs ROLO over all ROLO wavelengths using lunar
    #Saves results to ROLO_Results.txt
    #lunar(date(JD seconds), observer sublongitude (deg),
    #observer sublatitude (deg), sun sublongitude(deg), ROLO wavelength band)
    model = []
    name = a[0]
    date = a[1]
    sat_long = a[2][1] * 180 / math.pi
    sat_lat = a[2][2] * 180 / math.pi
    sun_long = (90 - a[4][1] * 180) / math.pi
    print sat_long
    print sat_lat
    print sun_long

    for j in range(4, 36):
        model.append(lunar(date, sat_long, sat_lat, sun_long, j))
    m3 = np.asarray(model)
    with open('ROLO_Results.dat', 'w') as f:
        f.write('#Disk Reflectance Results\n#Wavelength\t\tReflectance\n')
        np.savetxt(f, m3, fmt='%4f')

    #Integrate ROLO model results over desired wavelength range
    ref_file = 'ROLO_Results.dat'
    trap_file(ref_file, 'trapazoid_' + ref_file, 0, 1)
    area = trap_integrate('trapazoid_' + ref_file, xmin, xmax)

    #Combine (multiply) ROLO model results with the combined
    #solar-rsr spectrum for each band
    combine_spectra('trapazoid_' + ref_file,
                    './rsr_spectrums/trapazoid_r_combined_spectrum.dat',
                    'r_AkSolRSR_')
    trap_file('r_AkSolRSR_combined_spectrum.dat',
              'trapazoid_r_AkSolRSR_combined_spectrum.dat', 0, 1)
    combine_spectra('trapazoid_' + ref_file,
                    './rsr_spectrums/trapazoid_g_combined_spectrum.dat',
                    'g_AkSolRSR_')
    trap_file('g_AkSolRSR_combined_spectrum.dat',
              'trapazoid_g_AkSolRSR_combined_spectrum.dat', 0, 1)
    combine_spectra('trapazoid_' + ref_file,
                    './rsr_spectrums/trapazoid_b_combined_spectrum.dat',
                    'b_AkSolRSR_')
    trap_file('b_AkSolRSR_combined_spectrum.dat',
              'trapazoid_b_AkSolRSR_combined_spectrum.dat', 0, 1)
    combine_spectra('trapazoid_' + ref_file,
                    './rsr_spectrums/trapazoid_p_combined_spectrum.dat',
                    'p_AkSolRSR_')
    trap_file('p_AkSolRSR_combined_spectrum.dat',
              'trapazoid_p_AkSolRSR_combined_spectrum.dat', 0, 1)

    #Calculate the integrated Satellite RSR over specified bands
    rRSR = trap_integrate('./rsr_spectrums/trapazoid_r_RSR_estimate.dat', xmin,
                          xmax)
    gRSR = trap_integrate('./rsr_spectrums/trapazoid_g_RSR_estimate.dat', xmin,
                          xmax)
    bRSR = trap_integrate('./rsr_spectrums/trapazoid_b_RSR_estimate.dat', xmin,
                          xmax)
    pRSR = trap_integrate('./rsr_spectrums/trapazoid_p_RSR_estimate.dat', xmin,
                          xmax)
    rcom = trap_integrate('trapazoid_r_AkSolRSR_combined_spectrum.dat', xmin,
                          xmax)
    gcom = trap_integrate('trapazoid_g_AkSolRSR_combined_spectrum.dat', xmin,
                          xmax)
    bcom = trap_integrate('trapazoid_b_AkSolRSR_combined_spectrum.dat', xmin,
                          xmax)
    pcom = trap_integrate('trapazoid_p_AkSolRSR_combined_spectrum.dat', xmin,
                          xmax)

    print rcom, gcom, bcom, pcom

    #Convert effective disk reflectance to irradiance
    #Ik = Ak*OmegaM*Ek/pi
    OmegaM = 6.4177 * (10**-5)
    AkEk = np.asarray([rcom / rRSR, gcom / gRSR, bcom / bRSR, pcom / pRSR])
    Ik = OmegaM * AkEk / math.pi

    #Add in distance correction
    #1 Astronomical Unit (km)
    AU = 149597870.700
    #Literature Sun-Moon distance (km)
    DSM = a[4][0]
    #Observer-Moon distance (km)
    DOM = a[2][0]
    #Literature Earth-Moon distance (km)
    DEM = 384400.
    #Distance correction factor
    Fd = ((DSM / AU)**2) * ((DOM / DEM)**2)
    #At detector Irradiance
    I = Ik * Fd * 10**6

    print 'At detector irradiance: ', I[:], 'microW/(m**2)'

    with open('trapazoid_r_AkSolRSR_combined_spectrum.dat', 'r') as f:
        r_trap = np.genfromtxt(f)

    with open('trapazoid_b_AkSolRSR_combined_spectrum.dat', 'r') as f:
        b_trap = np.genfromtxt(f)

    with open('trapazoid_g_AkSolRSR_combined_spectrum.dat', 'r') as f:
        g_trap = np.genfromtxt(f)

    with open('trapazoid_p_AkSolRSR_combined_spectrum.dat', 'r') as f:
        p_trap = np.genfromtxt(f)

    with open('trapazoid_ROLO_Results.dat', 'r') as f:
        ROLO_trap = np.genfromtxt(f)

    plot_sets(r_trap, b_trap, g_trap, p_trap, ROLO_trap)

    clear(name, date, ref_file, 'trapazoid_' + ref_file)

    return I
Beispiel #8
0
			inputFile=inputFile,
			net=net,
			top=top,
			key=key,
			mode=mode,
			xpixel=xpixel,
			ypixel=ypixel,
			ignorebackground=b,
			batchsize=batchsize,
			maxiter=maxiter,
			datatype=datatype,
			stepsize=stepsize,
			initweights=initweights,
			createTest=test\
			)
	elif selectedModule == 'ml':
		applyml.apply(\
			outputFolder,
			inputFile,
			mode=mode,
			ignorebackground=b,
			epsg=epsg,
			compare=compare,
			top=top)
			#key=key)
	elif selectedModule == 'clear':
		clean.clear(inputFile)
	else:
		print "error - no valid option"
		cmdParser.print_help()