-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtransfer_specific_data.py
43 lines (32 loc) · 1.82 KB
/
transfer_specific_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from get_timestamp_data import GetTimestampData
from progress_bar import ProgressPercentage
from upload_data import UploadData
class TransferSpecificData():
"""
Obtain directories for the datasets requested by the user.
"""
def __init__(self, input_ts, bl_ts, ww3_input_ts, bmic_ts, linked_home_dir, platform="orion"):
"""
Args:
linked_home_dir (str): User directory linked to the RDHPCS' root
data directory.
platform (str): RDHPCS of where the datasets will be sourced.
"""
# Establish locality of where the datasets will be sourced.
self.linked_home_dir = linked_home_dir
if platform == "orion":
self.orion_rt_data_dir = self.linked_home_dir + "/noaa/nems/emc.nemspara/RT/NEMSfv3gfs/"
else:
print("Select a different platform.")
# Select timestamp dataset to transfer from RDHPCS on-disk to cloud
self.input_ts, self.bl_ts, self.ww3_input_ts, self.bmic_ts = input_ts, bl_ts, ww3_input_ts, bmic_ts
self.filter2specific_ts_datasets = GetTimestampData(self.orion_rt_data_dir, None).get_specific_ts_files(input_ts, bl_ts, ww3_input_ts, bmic_ts)
# Upload datasets requested by user.
UploadData(self.orion_rt_data_dir, self.filter2specific_ts_datasets, use_bucket='rt').upload_files2cloud()
#print("Reach to upload")
#print(self.filter2specific_ts_datasets.keys())
#print(self.filter2specific_ts_datasets)
if __name__ == '__main__':
# Obtain directories for the datasets requested by the user.
input_ts, bl_ts, ww3_input_ts, bmic_ts = [], ['develop-20220304'], [], []
TransferSpecificData(input_ts, bl_ts, ww3_input_ts, bmic_ts, linked_home_dir="/home/schin/work", platform="orion")