I am invoking a function header_gps,header_glonass etc. in if else statement but the variables defined in there seem not be stored as they should be. May be i am missing something , please help. I am writing my code here itself.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
"""Script for header section of rinex navigation file""" from header_gps import header_gps from header_glonass import header_glonass from header_galileo import header_galileo from header_beidou import header_beidou def header(filepath): with open (filepath) as fp: data = fp.read() data = data.split( "END OF HEADER" ) data = data[ 0 ] i = 0 while i> = 0 : if data[i] = = ' ' : i = i + 1 continue else : break if data[i] = = '2' : print ( "Rinex_2" ) #Rinex_2 elif data[i] = = '3' : print ( "Rinex_3" ) if 'GPS' in data[ 0 : 80 ]: print ( " GPS" ) header_gps(data) elif 'GALILEO' in data[ 0 : 80 ]: print ( " GALILEO" ) header_galileo(data) elif 'GLONASS' in data[ 0 : 80 ]: header_glonass(data) print ( "glonass" ) elif 'BEIDOU' in data[ 0 : 80 ]: print ( "BEIDOU" ) header_beidou(data) #Rinex_3 else : print ( "Version is not defined" ) filepath = '/home/ibaad/Downloads/rinexfile/ABMF00GLP_R_20180010000_01H_EN.rnx' header(filepath) |