@@ -344,6 +344,7 @@ def read_obsFile_v2(observationFile):
344
344
else :
345
345
interval = epochList [1 ] - epochList [0 ]
346
346
interval = interval .seconds
347
+ f .close () # close the file
347
348
#---------------------------------------------------------------------------------------
348
349
finish = time .time ()
349
350
print ("Observation file " , observationFile ," is read in" , "{0:.2f}" .format (finish - start ), "seconds." )
@@ -553,6 +554,7 @@ def read_obsFile_v3(obsFileName):
553
554
else :
554
555
interval = epochList [1 ] - epochList [0 ]
555
556
interval = interval .seconds
557
+ f .close () # close the file
556
558
# =============================================================================
557
559
finish = time .time () # Time of finish
558
560
print ("Observation file " , obsFileName ," is read in" , "{0:.2f}" .format (finish - start ), "seconds." )
@@ -625,6 +627,7 @@ def read_sp3File(sp3file):
625
627
position .index .name = 'SV'
626
628
position .set_index ('Epoch' , append = True , inplace = True )
627
629
position = position .reorder_levels (["Epoch" ,"SV" ])
630
+ f .close () # close the file
628
631
# ------------------------------------------------------------------
629
632
end = time .time ()
630
633
print ('{}' .format (sp3file ), 'file is read in' , '{0:.2f}' .format (end - start ), 'seconds' )
@@ -690,6 +693,7 @@ def read_clockFile(clkFile):
690
693
SVtime .append (float (timelist [i ][9 ]))
691
694
SVTimelist = pd .DataFrame (list (zip (Epochlist , SVtime )), index = Sat ,
692
695
columns = ['Epoch' ,'DeltaTSV' ])
696
+ f .close () # close the file
693
697
end = time .time ()
694
698
print ('{}' .format (clkFile ), 'file is read in' , '{0:.2f}' .format (end - start ), 'seconds' )
695
699
return SVTimelist
@@ -736,6 +740,7 @@ def read_ionFile(IonFile):
736
740
del obsLines [0 :6 ]
737
741
del obsLines [0 ]
738
742
#---------------------------------------------------------------------------------------
743
+ f .close () # close the file
739
744
finish = time .time ()
740
745
print ("Ionosphere file " , IonFile ," is read in" , "{0:.2f}" .format (finish - start ), "seconds." )
741
746
return tecuList
0 commit comments