glamod / glamod_landQC

QC for land data
0 stars 0 forks source link

Fix remaining issues uncovered in Sept 2022 run #56

Closed rjhd2 closed 1 year ago

rjhd2 commented 1 year ago

Some bugs found when running the September 2022 release

rjhd2 commented 1 year ago

this is the code from the inter_checks.py station-id is not defined in the code: need to be "target_station_id":

station_list = utils.get_station_list(restart_id=restart_id, end_id=end_id)
station_IDs = station_list.id

## read in all the neighbours for these stations to hold ready
all_neighbours = read_neighbours(restart_id=restart_id, end_id=end_id)

## now spin through each ID in the curtailed list
for st, target_station_id in enumerate(station_IDs):
    print("{} {} ({}/{})".format([http://dt.datetime.now](https://t.co/98B1rf6a8L)(), target_station_id, st+1, station_IDs.shape[0]))

    if not clobber:
        ## wanting to skip if files exist
        if os.path.exists(os.path.join(setup.SUBDAILY_BAD_DIR, "{:11s}.qff".format(station_id))):
            print("{} exists and clobber kwarg not set, skipping to next station.".format(
                os.path.join(setup.SUBDAILY_BAD_DIR, "{:11s}.qff".format(target_station_id))))
            continue

        elif os.path.exists(os.path.join(setup.SUBDAILY_OUT_DIR, "{:11s}.qff".format(station_id))):
            print("{} exists and clobber kwarg not set, skipping to next station.".format(
            os.path.join(setup.SUBDAILY_OUT_DIR, "{:11s}.qff".format(target_station_id))))
            continue
        else:
            ## files don't exists, pass
        pass
    else:
        print("Overwriting output for {}".format(target_station_id))
rjhd2 commented 1 year ago

Error in plot_map_of_flagging_rates.py where if no flag file the script doesn't handle the error gracefully.