From 172fa1a7b25548f3530ea45d1d9f94124bf01252 Mon Sep 17 00:00:00 2001 From: bnb32 Date: Mon, 6 Jan 2025 12:20:12 -0700 Subject: [PATCH] fix config creation for post proc blend collection --- nsrdb/config/create_configs.py | 16 +++++++++++++--- nsrdb/gap_fill/mlclouds_fill.py | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/nsrdb/config/create_configs.py b/nsrdb/config/create_configs.py index eab7dbfb..9acb539a 100755 --- a/nsrdb/config/create_configs.py +++ b/nsrdb/config/create_configs.py @@ -385,6 +385,7 @@ def post(cls, kwargs): pipeline_config = {'pipeline': []} out_dir = os.path.abspath(kwargs.get('out_dir', './')) post_proc_dir = os.path.join(out_dir, 'post_proc') + kwargs['post_proc_dir'] = kwargs.get('post_proc_dir', post_proc_dir) kwargs['main_dir'] = out_dir if kwargs['year'] > 2018: @@ -411,6 +412,10 @@ def post(cls, kwargs): config['out_dir'] = os.path.join( post_proc_dir, config['run_name'] ) + if mod_name == 'collect-blend': + config['collect_dir'] = os.path.join( + post_proc_dir, config['run_name'].replace('_collect', '') + ) cls._write_config( config, os.path.join(post_proc_dir, fname), @@ -611,16 +616,21 @@ def _collect_blend(cls, kwargs): config = cls.init_kwargs(kwargs, COLLECT_BLEND_KWARGS) config['meta_final'] = cls._get_meta(config, run_type='collect-blend') - config['collect_dir'] = cls._get_run_name(config, run_type='blend') - config['collect_tag'] = config['collect_dir'].replace('_blend', '') + config['collect_dir'] = os.path.join( + config['out_dir'], + 'post_proc', + cls._get_run_name(config, run_type='blend'), + ) config['fout'] = os.path.join( f'{config["out_dir"]}', f'{config["basename"]}_{config["year"]}.h5', ) - config['run_name'] = cls._get_run_name( config, run_type='collect-blend' ) + config['collect_tag'] = config['run_name'].replace( + '_collect_blend', '' + ) return config @classmethod diff --git a/nsrdb/gap_fill/mlclouds_fill.py b/nsrdb/gap_fill/mlclouds_fill.py index ae74cfa5..32aad327 100755 --- a/nsrdb/gap_fill/mlclouds_fill.py +++ b/nsrdb/gap_fill/mlclouds_fill.py @@ -74,7 +74,7 @@ def __init__( 'Initializing MLCloudsFill with model: {}'.format(model_path) ) logger.info( - 'MLCloudsFill fill filling all cloud properties: {}'.format( + 'MLCloudsFill filling all cloud properties: {}'.format( self._fill_all ) )