diff --git a/joanne/Level_2/dicts.py b/joanne/Level_2/dicts.py index 48098dc..6418b61 100644 --- a/joanne/Level_2/dicts.py +++ b/joanne/Level_2/dicts.py @@ -146,7 +146,7 @@ def get_global_attrs(Platform, file_time, sonde_ds): nc_global_attrs = { "title": "EUREC4A JOANNE Level-2", "doi": f"{joanne.data_doi}", - "created with": f"doi:{joanne.software_doi}", + "created with": f"run_joanne.py doi:{joanne.software_doi}", "Conventions": "CF-1.8", "campaign_id": "EUREC4A", "project_id": "JOANNE", diff --git a/joanne/Level_3/dicts.py b/joanne/Level_3/dicts.py index c93c1ac..75e47cb 100644 --- a/joanne/Level_3/dicts.py +++ b/joanne/Level_3/dicts.py @@ -280,7 +280,7 @@ nc_global_attrs = { "title": "EUREC4A JOANNE Level-3", "doi": f"{joanne.data_doi}", - "created with": f"doi:{joanne.software_doi}", + "created with": f"run_joanne.py doi:{joanne.software_doi}", "Conventions": "CF-1.8", "campaign_id": "EUREC4A", "project_id": "JOANNE", diff --git a/joanne/Level_4/dicts.py b/joanne/Level_4/dicts.py index 74f7233..cdc994c 100644 --- a/joanne/Level_4/dicts.py +++ b/joanne/Level_4/dicts.py @@ -571,7 +571,7 @@ nc_global_attrs = { "title": "EUREC4A JOANNE Level-4", "doi": f"{joanne.data_doi}", - "created with": f"doi:{joanne.software_doi}", + "created with": f"run_joanne.py doi:{joanne.software_doi}", "Conventions": "CF-1.8", "campaign_id": "EUREC4A", "project_id": "JOANNE", diff --git a/joanne/run_joanne.py b/joanne/run_joanne.py new file mode 100644 index 0000000..1441559 --- /dev/null +++ b/joanne/run_joanne.py @@ -0,0 +1,67 @@ +import os +import joanne +import glob +from pylab import size +import joanne.Level_2.QC as qc + + +data_directory = "/Users/geet/Documents/JOANNE/Data/" +save_directory = "/Users/geet/Documents/JOANNE/Data/QC/" +qc_dir = os.path.join(data_directory, "QC") + +jo_version = joanne.__version__ + +halo_status_file = sorted(glob.glob(f"{qc_dir}*HALO*{jo_version}.nc")) +p3_status_file = sorted(glob.glob(f"{qc_dir}*P3*{jo_version}.nc")) + +if (len(halo_status_file) >= 1) and (len(p3_status_file) >= 1): + print("QC Status files of the current version found for both P3 and HALO") +else: + print( + "QC Status files of the current version not found for both P3 and HALO. Therefore, running QC..." + ) + + qc.run_qc( + data_directory=data_directory, save_directory=save_directory, + ) + + +l2_files = sorted(glob.glob(f"{data_directory}Level_2/*{jo_version}.nc")) + +no_of_l2_files = size(l2_files) + +if no_of_l2_files > 1000: + print( + f"{no_of_l2_files} Level-2 files found with the current JOANNE version. Therefore not running Level-2 script again." + ) +else: + print("Starting Level-2") + import joanne.Level_2.Level_2 + + print("Level-2 finished") + + +l3_files = sorted(glob.glob(f"{data_directory}Level_3/*{jo_version}.nc")) + +if size(l3_files) > 0: + print( + "Level-3 file found with the current JOANNE version. Therefore not running Level-3 script again." + ) +else: + print("Starting Level-3") + import joanne.Level_3.Level_3 + + print("Level-3 finished") + + +l4_files = sorted(glob.glob(f"{data_directory}Level_4/*{jo_version}.nc")) + +if size(l4_files) > 0: + print( + "Level-4 file found with the current JOANNE version. Therefore not running Level-4 script again." + ) +else: + print("Starting Level-4") + import joanne.Level_4.Level_4 + + print("Level-4 finished")