Skip to content

Commit 0f969e3

Browse files
committed
refcator to_netcdf to get config_file instead of dict
1 parent 3f0ec43 commit 0f969e3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

PyStemmusScope/save.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import numpy as np
2525
import pandas as pd
2626
import xarray as xr
27-
from PyStemmusScope import forcing_io
27+
from PyStemmusScope import forcing_io, config_io
2828
from . import variable_conversion as vc
2929

3030

@@ -250,18 +250,21 @@ def _update_dataset_attrs_dims(dataset: xr.Dataset, forcing_dict: Dict) -> xr.Da
250250
return dataset
251251

252252

253-
def to_netcdf(config: Dict, cf_filename: str) -> str:
253+
def to_netcdf(config_file: str, cf_filename: str) -> str:
254254
"""Save csv files generated by Stemmus_Scope model to a netcdf file using
255255
information provided by ALMA conventions.
256256
257257
Args:
258-
config(Dict): PyStemmusScope configuration dictionary.
258+
config_file(str): Path to the config file.
259259
cf_filename(str): Path to a csv file for ALMA conventions.
260260
261261
Returns:
262262
str: path to a csv file under the output directory.
263263
"""
264264

265+
# read config file
266+
config = config_io.read_config(config_file)
267+
265268
# list of required forcing variables, Alma_short_name: forcing_io_name, # model_name
266269
var_names = {
267270
"RH": "rh", # RH

0 commit comments

Comments
 (0)