Skip to content

Commit

Permalink
Update ODR.py
Browse files Browse the repository at this point in the history
The arclist file in the more complete ODR orbit files downloaded from http://www.deos.tudelft.nl/AS/pieter/Local/ERS/index.html (contains ERS-2 orbit files beyond 2003) has slight format change and the original hard coded line parser no longer works. The updated version should work both for the new and old versions of arclist.
  • Loading branch information
yjzhenglamarmota committed Jun 28, 2023
1 parent 532da8f commit 9ee285a
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions components/isceobj/Orbit/ODR.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,17 @@ def parse(self):

def parseLine(self,line):
arc = Arc()
arc.number = line[0:3] # Arc number
arc.start = datetime.datetime.strptime(line[5:17],'%y%m%d %H:%M') # Starting time for the arc
arc.stop = datetime.datetime.strptime(line[20:32],'%y%m%d %H:%M') # End time for the arc
arc.slrResidual = line[34:38] # Satellite laser ranging residual in cm
arc.crossOver = line[39:43]
arc.altimeter = line[45:49]
arc.repeat = line[51:57] # Repeat cycle in days
arc.version = line[58:61] # Version number
arc.precise = datetime.datetime.strptime(line[63:78],'%y%m%d %H:%M:%S') # Starting time of the precise segment of the arc
###### Change to also work for the new arclist format in the recalcuated ODR orbit files.#######
arc.number = line.split()[0] # Arc number
arc.start = datetime.datetime.strptime(" ".join(line.split()[1:3]),'%y%m%d %H:%M') # Starting time for the arc
arc.stop = datetime.datetime.strptime(" ".join(line.split()[4:6]),'%y%m%d %H:%M') # End time for the arc
###### commented the following because it is not always present in the new arclist file ############
# arc.slrResidual = line[34:38] # Satellite laser ranging residual in cm
# arc.crossOver = line[39:43]
# arc.altimeter = line[45:49]
# arc.repeat = line[51:57] # Repeat cycle in days
# arc.version = line[58:61] # Version number
arc.precise = datetime.datetime.strptime(" ".join(line.split()[-2:]),'%y%m%d %H:%M:%S') # Starting time of the precise segment of the arc

return arc

Expand Down

0 comments on commit 9ee285a

Please sign in to comment.