@@ -635,7 +635,7 @@ def _check_grid_placement_single(self, sampling_xyzgrid_lhr, amr_xyzgrid_at_lhr_
635
635
636
636
637
637
638
- def write_sampling_params (self , out = None , overwrite = False ):
638
+ def write_sampling_params (self , out = None , format = 'netcdf' , overwrite = False ):
639
639
'''
640
640
Write out text that can be used for the sampling planes in an
641
641
AMR-Wind input file
@@ -647,6 +647,8 @@ def write_sampling_params(self, out=None, overwrite=False):
647
647
If saving to a file, whether or not to overwrite potentially
648
648
existing file
649
649
'''
650
+ if format not in ['netcdf' ,'native' ]:
651
+ raise ValueError (f'format should be either native or netcdf' )
650
652
651
653
# Write time step information for consistenty with sampling frequency
652
654
s = f"time.fixed_dt = { self .dt } \n \n "
@@ -663,7 +665,7 @@ def write_sampling_params(self, out=None, overwrite=False):
663
665
s += f"incflo.post_processing = { self .postproc_name_lr } { self .postproc_name_hr } # averaging\n \n \n "
664
666
665
667
s += f"# ---- Low-res sampling parameters ----\n "
666
- s += f"{ self .postproc_name_lr } .output_format = netcdf \n "
668
+ s += f"{ self .postproc_name_lr } .output_format = { format } \n "
667
669
s += f"{ self .postproc_name_lr } .output_frequency = { self .output_frequency_lr } \n "
668
670
s += f"{ self .postproc_name_lr } .fields = velocity # temperature tke\n "
669
671
s += f"{ self .postproc_name_lr } .labels = { sampling_labels_lr_str } \n \n "
@@ -681,7 +683,7 @@ def write_sampling_params(self, out=None, overwrite=False):
681
683
s += f"{ self .postproc_name_lr } .Low.offsets = { zoffsets_lr_str } \n \n \n "
682
684
683
685
s += f"# ---- High-res sampling parameters ----\n "
684
- s += f"{ self .postproc_name_hr } .output_format = netcdf \n "
686
+ s += f"{ self .postproc_name_hr } .output_format = { format } \n "
685
687
s += f"{ self .postproc_name_hr } .output_frequency = { self .output_frequency_hr } \n "
686
688
s += f"{ self .postproc_name_hr } .fields = velocity # temperature tke\n "
687
689
s += f"{ self .postproc_name_hr } .labels = { sampling_labels_hr_str } \n "
0 commit comments