Skip to content

Commit 35062d8

Browse files
committed
FIX: bug in read_data_sensor when one or more IGRA names are nan
1 parent 42953f7 commit 35062d8

12 files changed

+15
-10
lines changed

src/pyrad_proc/pyrad/flow/flow_aux.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,8 @@ def _create_cfg_dict(cfgfile):
10801080
try:
10811081
print("- Main config file : {}".format(cfgfile))
10821082
cfg = read_config(cfg["configFile"], cfg=cfg, defaults=DEFAULT_CONFIG["main"])
1083+
if not cfg["configpath"]:
1084+
cfg["configpath"] = os.path.dirname(cfgfile)
10831085
# Convert loc and prod config files to absolute paths if needed
10841086
filenames = [
10851087
"locationConfigFile",

src/pyrad_proc/pyrad/io/default_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"iconpath": None,
8585
"psrpath": None,
8686
"iqpath": None,
87+
"configpath": None,
8788
"colocgatespath": None,
8889
"excessgatespath": None,
8990
"dempath": None,

src/pyrad_proc/pyrad/io/read_data_sensor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2639,7 +2639,9 @@ def read_radiosounding_igra(station, dtime):
26392639
return
26402640

26412641
# get igra code
2642-
code = stations_ref["CODE"][stations_ref["CODE"].str.contains(station)].iloc[0]
2642+
code = stations_ref["CODE"][
2643+
stations_ref["CODE"].str.contains(station, na=False)
2644+
].iloc[0]
26432645

26442646
# Check if specified time is after 2021
26452647
if dtime > datetime.datetime(2021, 1, 1):

src/pyrad_proc/scripts/main_process_cosmo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def main():
124124
proc_endtime = None
125125
if args.endtime is not None:
126126
proc_endtime = datetime.datetime.strptime(args.endtime, "%Y%m%d%H%M%S")
127-
cfgfile_proc = args.cfgpath + args.proc_cfgfile
127+
cfgfile_proc = os.path.join(args.cfgpath, args.proc_cfgfile)
128128

129129
if args.infostr == "None":
130130
infostr = ""

src/pyrad_proc/scripts/main_process_cosmo_rt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def main():
115115
cfgfile_list = []
116116
for ind, cfgfile in enumerate(args.cfgfiles):
117117
print("config file " + str(ind) + ": " + cfgfile)
118-
cfgfile_list.append(args.cfgpath + cfgfile)
118+
cfgfile_list.append(os.path.join(args.cfgpath, cfgfile))
119119
if args.starttime is not None:
120120
print("start time: " + args.starttime)
121121
else:

src/pyrad_proc/scripts/main_process_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def main():
172172
proc_endtime = None
173173
if args.endtime is not None:
174174
proc_endtime = datetime.datetime.strptime(args.endtime, "%Y%m%d%H%M%S")
175-
cfgfile_proc = args.cfgpath + args.proc_cfgfile
175+
cfgfile_proc = os.path.join(args.cfgpath, args.proc_cfgfile)
176176

177177
if args.infostr == "None":
178178
infostr = ""

src/pyrad_proc/scripts/main_process_data_birds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def main():
9393

9494
proc_starttime = datetime.datetime.strptime(args.starttime, "%Y%m%d%H%M%S")
9595
proc_endtime = datetime.datetime.strptime(args.endtime, "%Y%m%d%H%M%S")
96-
cfgfile_proc = args.cfgpath + args.proc_cfgfile
96+
cfgfile_proc = os.path.join(args.cfgpath, args.proc_cfgfile)
9797

9898
pyrad_main(cfgfile_proc, starttime=proc_starttime, endtime=proc_endtime)
9999

src/pyrad_proc/scripts/main_process_data_period.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def main():
159159
seconds=float(args.endtime[4:6]),
160160
)
161161

162-
cfgfile_proc = args.cfgpath + args.proc_cfgfile
162+
cfgfile_proc = os.path.join(args.cfgpath, args.proc_cfgfile)
163163
if args.postproc_cfgfile is not None:
164164
cfgfile_postproc = args.cfgpath + args.postproc_cfgfile
165165

src/pyrad_proc/scripts/main_process_data_rt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def main():
122122
cfgfile_list = []
123123
for ind, cfgfile in enumerate(args.cfgfiles):
124124
print("config file " + str(ind) + ": " + cfgfile)
125-
cfgfile_list.append(args.cfgpath + cfgfile)
125+
cfgfile_list.append(os.path.join(args.cfgpath, cfgfile))
126126
if args.starttime is not None:
127127
print("start time: " + args.starttime)
128128
else:

0 commit comments

Comments
 (0)