I have a time series dataset, I want to save slice data using SaveData method. I was able to do that using below code in pvbatch:
SaveData(File_to_Save,
proxy=slice1,
WriteTimeSteps=1,
Filenamesuffix=‘_%d’,
CellDataArrays=[‘IDREG’, ‘AREA_X-’, ‘AREA_X+’, ‘AREA_Y-’, ‘AREA_Y+’, ‘AREA_Z-’, ‘AREA_Z+’, ‘DENSITY’, ‘PRESSURE’, ‘TEMPERATURE’, ‘TOTAL_PRESSURE’, ‘VOLUME’, ‘TKE’, ‘YPLUS’, ‘XCEN’, ‘VELOCITY’],
Precision=8,
UseScientificNotation=1,
FieldAssociation=‘Cell Data’, # for cell data
AddMetaData=0)
This works fine, However data file is saved as slice1_0.txt , slice1_1.txt … . I want to add time series name as suffix (like slice1_<time_step>.txt , slice1_<time_step>.txt …) , to do so I have created a a list using bleow code:
time_step = sCR_Data.TimestepValues
time_step = list(time_step)
Now I have a list of time series which i want to use as suffix of my filename. What is the best way ?
So far I have tried using typical python tricks %s and {}.format(time_step). None of them are working.