Skip to content

Commit 54de78d

Browse files
authored
Merge pull request #143 from AusClimateService/142-allow-user-to-adjust-output-format
Added user-configurable output format. Fixes #142.
2 parents 4bbd271 + 9349a69 commit 54de78d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

axiom/data/drs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"6H": "6hr",
7171
"fx": "fx"
7272
},
73+
"output_format": "NETCDF4",
7374
"encoding": {
7475
"variables": {
7576
"dtype": "float32",

axiom/drs/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,13 @@ def postprocess(_ds, *args, **kwargs):
464464
logger.info('Waiting for computations to finish.')
465465
progress(_ds)
466466

467+
# Get the output format from config
468+
output_format = config.get('output_format', 'NETCDF4')
469+
467470
logger.debug(f'Writing {output_filepath}')
468471
write = _ds.to_netcdf(
469472
output_filepath,
470-
format='NETCDF4',
473+
format=output_format,
471474
encoding=encoding,
472475
unlimited_dims=['time']
473476
)

0 commit comments

Comments
 (0)