File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import numpy as np
44import gzip
55import datetime as dt
6+ from os import path
67
78class open_gzip_or_dat :
89 def __init__ (self , filename ):
@@ -201,6 +202,7 @@ def to_dataset(lma_file, event_id_start=0):
201202 ds .attrs ['history' ] = "LMA source file created " + lma_file .file_created
202203 ds .attrs ['event_algorithm_name' ] = lma_file .analysis_program
203204 ds .attrs ['event_algorithm_version' ] = lma_file .analysis_program_version
205+ ds .attrs ['original_filename' ] = path .basename (lma_file .file )
204206
205207 # -- Populate the station mask information --
206208 # int, because NetCDF doesn't have booleans
@@ -361,7 +363,7 @@ def __init__(self,filename):
361363 file_created = line .decode ().split (':' )[1 :]
362364 self .file_created = ':' .join (file_created )[:- 1 ]
363365 if line .startswith (b'Location:' ):
364- self .network_location = ':' .join (line .decode ().split (':' )[1 :])[:- 1 ]
366+ self .network_location = ':' .join (line .decode ().split (':' )[1 :])[:- 1 ]. replace ( ' ' , '' )
365367 if line .startswith (b'Data start time:' ):
366368 timestring = line .decode ().split ()[- 2 :]
367369 self .startday = dt .datetime .strptime (timestring [0 ],'%m/%d/%y' )
You can’t perform that action at this time.
0 commit comments