From f969442d59b4530a55d246c867307a7617d7084e Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 23 Apr 2021 17:15:13 -0600 Subject: [PATCH] Per #1700, update read_tmp_ascii.py to work for both ascii2nc and stat_analysis. Just create an object named ascii_data and have both instances read it. --- met/data/wrappers/read_tmp_ascii.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/met/data/wrappers/read_tmp_ascii.py b/met/data/wrappers/read_tmp_ascii.py index 071e3bdc7c..66c008e3cd 100644 --- a/met/data/wrappers/read_tmp_ascii.py +++ b/met/data/wrappers/read_tmp_ascii.py @@ -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 """ @@ -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__': """