I/O Commands¶
These commands access disk files either for reading or writing.
Note
< > = Required user input.
[< >] = Optional user input.
[PyDV] = Python Data Visualizer command-line prompt.
read¶
- pydv.pdv.Command.do_read(self, line)
Read curves from the specified ASCII file and optionally filter by regex. The next available prefix (see the prefix command) is automatically assigned the menu index of the first curve in each data file read. For column oriented (.gnu) files optionally specify the x-column number before the file name.
[PyDV]: <read | rd> [(regex) matches] [x-col] <filename> Ex: [PyDV]: read my_file.ult [PyDV]: read my.*curves my_file.ult [PyDV]: read my.*curves 1 my_file.ult
readcsv¶
- pydv.pdv.Command.do_readcsv(self, line)
Read CSV data file. The next available prefix (see the prefix command) is automatically assigned the menu index of the first curve in each data file read. For column oriented (.gnu) files optionally specify the x-column number before the file name. If the columns are in x and y pairs with savecsv command, the [x-col] must be specified as paired.
[PyDV]: <readcsv | rdcsv> <filename.csv> [x-col] [paired] Ex: [PyDV]: readcsv my_file.csv [PyDV]: readcsv my_file.csv 2 [PyDV]: readcsv my_file.csv paired
readsina¶
- pydv.pdv.Command.do_readsina(self, line)
Read all curves from Sina data file. PyDV assumes there is only one record in the Sina file, and if there are more than one then PyDV only reads the first. PyDV also assumes there is only one independent variable per curve_set; if there are more than one then PyDV may exhibit undefined behavior. The next available prefix (see the prefix command) is automatically assigned the menu index of the first curve in each data file read.
[PyDV]: <readsina | rdsina> <filename.json> Ex: [PyDV]: readsina my_file.json
run¶
- pydv.pdv.Command.do_run(self, line)
Execute a list of commands from a file.
[PyDV]: run <filename> Ex: [PyDV]: run my_file
save¶
- pydv.pdv.Command.do_save(self, line)
Saves plotted curves to a file in ULTRA format. Can also save x and y labels which can be read back in.
[PyDV]: save <filename> <curve-list> [savelabels] Ex: [PyDV]: save my_saved_file.ult a [PyDV]: save my_saved_file.ult b d [PyDV]: save my_saved_file.ult b:d [PyDV]: save my_saved_file.ult b:d savelabels
savecsv¶
- pydv.pdv.Command.do_savecsv(self, line)
Saves plotted curves to file in comma separated values (CSV) format. Assumes all curves have the same x basis.
[PyDV]: savecsv <filename> <curve-list> Ex: [PyDV]: savecsv my_saved_file.csv b [PyDV]: savecsv my_saved_file.csv b d [PyDV]: savecsv my_saved_file.csv b:d
setxcolumn¶
- pydv.pdv.Command.do_setxcolumn(self, line)
Set x column for reading column formatted data files (.gnu or .csv).
[PyDV]: setxcolumn <x column> Ex: [PyDV]: setxcolumn 1
merge¶
- pydv.pdv.Command.do_merge(self, line)
Merge ultra files together.
[PyDV]: merge <newfile> <myfile1> <myfile2> etc... Ex: [PyDV]: merge newfile.ult myfile1.ult myfile2.ult