Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Update to b1 level glue file creation script #41

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions scripts/sail_glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,9 @@ def fix_times(ds):
return ds

def granule(Dvolume):
print('in granule')
n_tilts = 8
#data_dir = "/gpfs/wolf/atm124/proj-shared/gucxprecipradarS2.00/nc_files/" + month + "_nc/"
#out_dir = "/gpfs/wolf/atm124/proj-shared/gucxprecipradarS2.00/glue_files/" + month + "_glued/"
month = Dvolume[0].split('/')[-2].split('_')[0]
out_dir = Dvolume[0].split('nc_files')[0] + "glue_files/" + month + "_glued/"
out_dir = '/gpfs/wolf2/arm/atm124/proj-shared/gucxprecipradarS2_new/glue_files/%s_glued/' % month

# Read the base scan to determine if it can be read in
if len(Dvolume) == 8:
Expand Down Expand Up @@ -120,7 +117,7 @@ def main(args):
# Define directories
month = args.month
path = '/gpfs/wolf/atm124/proj-shared/gucxprecipradarS2.00/nc_files/%s_nc/*.nc' % month
out_path = '/gpfs/wolf/atm124/proj-shared/gucxprecipradarS2.00/glue_files/%s_glued/' % month
out_path = '/gpfs/wolf2/arm/atm124/proj-shared/gucxprecipradarS2_new/glue_files/%s_glued/' % month

# Define files and determine volumes
all_files = sorted(glob.glob(path))
Expand All @@ -146,8 +143,13 @@ def main(args):

if args.serial is True:
granule(volumes[0])
granule(volumes[1])
granule(volumes[2])
print("processing finished: ", time.strftime("%H:%M:%S"))
else:
cluster = LocalCluster(n_workers=20, processes=True, threads_per_worker=1)
print("starting dask cluster...")
cluster = LocalCluster(n_workers=32, threads_per_worker=1)
print(cluster)
with Client(cluster) as c:
results = c.map(granule, volumes)
wait(results)
Expand All @@ -167,7 +169,7 @@ def main(args):
default=False,
dest='serial',
type=bool,
help="Process in Serial"
help="Process in Serial for testing"
)
args = parser.parse_args()

Expand Down
Loading