Skip to content

Commit 797d863

Browse files
Merge pull request #116 from IPGP/dev_2406_sitlog_update_01a
add err & warn
2 parents 0bd9042 + 7dcfaf1 commit 797d863

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

rinexmod/rinexmod_api.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,12 @@ def rinexmod(
948948
rnxobj.set_site(marker)
949949

950950
### load the metadata from sitelog or GAMIT files if any
951+
952+
if not sitelog and (not station_info or not lfile_apriori):
953+
logger.error(
954+
"No metadata provided. (sitelog or station.info/lfile **couple**)."
955+
"RINEX header with default rec. values will remain!")
956+
951957
## sitelogs
952958
if sitelog:
953959
metadata_obj_list = metadata_input_manage(sitelog, force=force_sitelog)
@@ -956,7 +962,11 @@ def rinexmod(
956962
# Indeed, the GAMIT files might have been read outside this function
957963
# (most likely actually). The already read GAMIT files are then stored
958964
# in the 'sitelog' variable as a list of MetaData objects
959-
965+
966+
if (station_info and not lfile_apriori) or (not station_info and lfile_apriori):
967+
logger.critical("station_info and lfile_apriori must be provided together")
968+
raise RinexModInputArgsError
969+
960970
if not sitelog and (not station_info or not lfile_apriori):
961971
logger.warning("No sitelog nor station.info+lfile provided. Per default rec.'s header will remain & no new"
962972
"metdata will be written!")
@@ -1212,7 +1222,8 @@ def rinexmod_cli(
12121222
and not lfile_apriori
12131223
):
12141224
logger.critical(
1215-
"No action asked, provide at least one of the following args : --sitelog, --modif_kw, --marker, --longname, --station_info, --lfile_apriori"
1225+
"No action asked, provide at least one of the following args:"
1226+
"--sitelog, --modif_kw, --marker, --longname, --station_info, --lfile_apriori"
12161227
)
12171228
raise RinexModInputArgsError
12181229

0 commit comments

Comments
 (0)