 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
20 "Usage: bstar [options] input.star [input.star]",
21 "----------------------------------------------",
22 "Examines and modifies STAR format files.",
25 "-header 85 List all the header lines limited to the indicated length.",
26 "-split 3 Split the data blocks into individual files, inserting digits before the extension.",
27 "-list time_unit List all items with this STAR tag.",
28 "-delete resolution Delete all items with this STAR tag.",
29 "-blockdelete symmetry Delete all data blocks containing this STAR tag.",
30 "-integerscale select,1,3 Scale and shift all integer items with this STAR tag.",
31 "-floatscale psi,1.5,-5.1 Scale and shift all floating point items with this STAR tag.",
34 "-verbose 7 Verbosity of output.",
35 "-linelength 120 Output line length (default 100).",
38 "-output file.star Output STAR format file.",
43 int main(
int argc,
char **argv)
67 for ( curropt = option; curropt; curropt = curropt->
next ) {
68 if ( curropt->
tag ==
"header" )
70 cerr <<
"-header: A line length must be specified!" << endl;
72 if ( curropt->
tag ==
"split" ) {
75 cerr <<
"-split: An integer must be specified!" << endl;
79 if ( curropt->
tag ==
"linelength" ) {
81 cerr <<
"-linelength: A line length must be specified!" << endl;
85 if ( curropt->
tag ==
"list" ) {
87 tag_to_list = curropt->
value;
88 if ( tag_to_list.
length() < 1 )
89 cerr <<
"-list: A STAR tag must be specified!" << endl;
91 if ( curropt->
tag ==
"delete" ) {
93 tag_to_be_deleted = curropt->
value;
94 if ( tag_to_be_deleted.
length() < 1 )
95 cerr <<
"-delete: A STAR tag must be specified!" << endl;
97 if ( curropt->
tag ==
"blockdelete" ) {
99 block_to_be_deleted = curropt->
value;
100 if ( block_to_be_deleted.
length() < 1 )
101 cerr <<
"-blockdelete: A STAR tag must be specified!" << endl;
103 if ( curropt->
tag ==
"integerscale" ) {
105 tag_integer = *strarr;
106 if ( tag_integer.
length() < 1 )
107 cerr <<
"-integerscale: A STAR tag must be specified!" << endl;
113 if ( curropt->
tag ==
"floatscale" ) {
116 if ( tag_float.
length() < 1 )
117 cerr <<
"-floatscale: A STAR tag must be specified!" << endl;
123 if ( curropt->
tag ==
"output" )
132 while ( optind < argc )
138 if ( tag_to_list.
length() > 0 )
141 if ( tag_to_be_deleted.
length() > 0 )
144 if ( block_to_be_deleted.
length() > 0 )
147 if ( tag_integer.
length() > 0 )
150 if ( tag_float.
length() > 0 )
A class for a command line input option.
int string_kill(Bstring *list)
Kills a string linked list.
int star_update_comment(Bstar *star, int n, char **strings)
Puts a set of strings and time in the main comment of the STAR data base.
int bexit(int value)
Exit function for cleanup and debugging.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Header file for option handlers.
int main(int argc, char **argv)
int item_float_scale_shift(Bstar *star, Bstring &tag, float scale, float shift)
Scales and shifts all items associated with a given tag from the STAR data base.
int write_star(const char *filename, Bstar *star)
Writes a STAR data base to one or more STAR format files.
long star_list_comments(Bstar *star, long len)
Lists the command lines in the STAR header.
Utilities for timing functions.
int item_delete_all(Bstar *star, const char *tag)
Deletes all items associated with a given tag from the STAR data base.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
int show_tags(Bstar *star)
Prints the list of tags in the STAR data base.
int read_star(const char *filename, Bstar *star)
Reads paramaters and data into a STAR data base from a list of files.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
int kill_star(Bstar *star)
Destroys a STAR data base.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
int item_list(Bstar *star, Bstring &tag)
Lists all items associated with a given tag from the STAR data base.
int item_integer_scale_shift(Bstar *star, Bstring &tag, int iscale, int ishift)
Scales and shifts all items associated with a given tag from the STAR data base.
A header file for STAR format files.
int block_delete(Bstar *star, Bstring &tag)
Deletes all blocks with a given tag from the STAR data base.
bool contains(const Bstring &s)
Bstar * init_star()
Creates a STAR data base.