Skip to content

Commit

Permalink
Per #1700, update read_tmp_ascii.py to work for both ascii2nc and sta…
Browse files Browse the repository at this point in the history
…t_analysis. Just create an object named ascii_data and have both instances read it.
  • Loading branch information
JohnHalleyGotway committed Apr 23, 2021
1 parent 9c31d61 commit f969442
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions met/data/wrappers/read_tmp_ascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
Message_Type, Station_ID, Valid_Time, Lat, Lon, Elevation,
GRIB_Code or Variable_Name, Level, Height, QC_String, Observation_Value
MPR format: See documentation of the MPR line type
Version Date
1.0.0 2021/02/18 David Fillmore Initial version
"""
Expand All @@ -18,24 +20,22 @@

import argparse

point_data = None

def read_tmp_ascii(filename):
"""
Arguments:
filename (string): temporary file created by write_tmp_point.py
filename (string): temporary file created by write_tmp_point.py or write_tmp_mpr.py
Returns:
(list of lists): point data
(list of lists): point or mpr data
"""
f = open(filename, 'r')
lines = f.readlines()
f.close()

global point_data
point_data = [eval(line.strip('\n')) for line in lines]

return point_data
global ascii_data
ascii_data = [eval(line.strip('\n')) for line in lines]
return ascii_data

if __name__ == '__main__':
"""
Expand Down

0 comments on commit f969442

Please sign in to comment.