Marine gravitymeter, S-99
Land gravitymeter, G-936 Data format, conversion Air/Sea operation Base readings Data processing Projects Other information June 07, 2024, at 11:36 AM |
SOFTWARE FOR FORMAT CONVERSIONInput fileInput file has this format: Time,Position: Filtered vessel position: East,North,Lat,Long,Data: Depth {input 3: ch1},Data: Gravimeter {input 2: ch1},Data: Magnetometer {input 1: ch1}, 19:59:18 09.08.2008, 448842.7430,8119926.7155, 073°10.095816', 013°25.020571', 0.0000, 10080.4100, 53616.4760 19:59:28 09.08.2008, 448822.5048,8119909.8114, 073°10.086439', 013°24.983845', 1328.1900, 10080.3300, 53616.8390 19:59:38 09.08.2008, 448802.1602,8119892.8544, 073°10.077033', 013°24.946924', 1328.1500, 10080.2500, 53616.3550 Output fileOutput file has this format: 09.08.2008 19:59:18 073 10.095816' 013 25.020571' 0.0000 10080.4100 53616.4760 09.08.2008 19:59:28 073 10.086439' 013 24.983845' 1328.1900 10080.3300 53616.8390 09.08.2008 19:59:38 073 10.077033' 013 24.946924' 1328.1500 10080.2500 53616.3550 SoftwareThis Python script does the re-formatting job: Attach:preprocess-gravitydata-27Oct2009.py #!/usr/bin/python # ''' ************************************************************************* PRE-PROCESSING OF GRAVITY DATA Program version: ------------------------------------------ Ver. Date By Description ------------------------------------------ 0.1 27 Oct 2009 O.M. Initial version Dept. of Earth Science University of Bergen Norway ************************************************************************* ''' from string import split, replace from sys import argv, exit if len(argv) <> 2: print "Need name of input file as argument" exit(-1) FileName = argv[1] #--------------------------------------------------- #--- S t a r t o f p r o g r a m #--------------------------------------------------- f = open(FileName) # Open input file. for line in f: # Loop over all lines in input file. if line[0].isdigit(): # First get rid of lines with text or comments #print line, line = line.replace(',','') # Get rid of all ',' s = line.split() date = s[1] time = s[0] lat = s[3] lon = s[4] depth = s[5] gravity = s[6] magnetometer = s[7] #print '------------' #print line, #---- We need to split lat/long on the degree symbol, which has ASCII code 0xb0 print date, time, \ lat.split(chr(0xb0))[0], lat.split(chr(0xb0))[1], \ lon.split(chr(0xb0))[0], lon.split(chr(0xb0))[1], \ depth, gravity, magnetometer f.close() |