bug fix
This commit is contained in:
parent
50b1d93d86
commit
621fe49131
|
@ -11,7 +11,7 @@ def trans2csv(file_list):
|
|||
date = ""
|
||||
file_list.sort()
|
||||
par_list = []
|
||||
lon_str = []
|
||||
cols = []
|
||||
for file_name in file_list:
|
||||
logger.info(file_name)
|
||||
try:
|
||||
|
@ -34,9 +34,10 @@ def trans2csv(file_list):
|
|||
logger.info(par_save.shape)
|
||||
new_par = np.c_[np.array(lat_str)[max_lat_index:min_lat_index], par_save]
|
||||
new_par = np.c_[np.array([str(date_time)] * par_save.shape[0]), new_par]
|
||||
cols = lon_str[min_lon_index:max_lon_index]
|
||||
par_list.extend(new_par)
|
||||
except Exception as e:
|
||||
logger.info(e)
|
||||
continue
|
||||
date_df = pd.DataFrame.from_records(par_list, columns=['time', 'lat'] + lon_str[min_lon_index:max_lon_index])
|
||||
date_df = pd.DataFrame.from_records(par_list, columns=['time', 'lat'] + cols)
|
||||
date_df.to_csv(f'./data/{date}/PAR.csv', encoding='utf-8-sig', index=False)
|
Loading…
Reference in New Issue