Bsoft 2.1.4
Bernard's software package
bstar.cpp File Reference

Examines STAR format files. More...

#include "star.h"
#include "utilities.h"
#include "options.h"
#include "timer.h"

Functions

int show_tags (Bstar &star)
 Prints the list of tags in the STAR data base. More...
 
int item_delete_all (Bstar &star, string &tag)
 Deletes all items associated with a given tag from the STAR data base. More...
 
int item_scale_shift (Bstar &star, string &tag, double scale, double shift, int flag)
 Scales and shifts all items associated with a given tag from the STAR data base. More...
 
int item_list (Bstar &star, string &tag)
 Lists all items associated with a given tag from the STAR data base. More...
 
int main (int argc, char **argv)
 
int string_get_format (string &s, char *format)
 Gets the format from the item. More...
 

Variables

int verbose
 
const char * use []
 

Detailed Description

Examines STAR format files.

Author
Bernard Heymann
Date
Created: 20010409
Modified: 20210214

Function Documentation

◆ item_delete_all()

int item_delete_all ( Bstar star,
string &  tag 
)

Deletes all items associated with a given tag from the STAR data base.

Parameters
*starthe STAR database.
*tagtag for items to be deleted.
Returns
int 0.
The item with a given tag is deleted in all blocks it is found
and the item pointers are rearranged to fill in the gap.

◆ item_list()

int item_list ( Bstar star,
string &  tag 
)

Lists all items associated with a given tag from the STAR data base.

Parameters
&starthe STAR database.
&tagtag for items to be listed.
Returns
int 0.
The item with a given tag is listed to standard output as an end-of-line
delimited array.

◆ item_scale_shift()

int item_scale_shift ( Bstar star,
string &  tag,
double  scale,
double  shift,
int  flag 
)

Scales and shifts all items associated with a given tag from the STAR data base.

Parameters
&starthe STAR database.
&tagtag for items to be modified.
scalemultiplier.
shiftvalue added.
flag0=integer, 1=real.
Returns
int total number of values changed.
The item must be integer and is modified as:
    new_value = old_value*scale + shift.

◆ main()

int main ( int  argc,
char **  argv 
)

◆ show_tags()

int show_tags ( Bstar star)

Prints the list of tags in the STAR data base.

Parameters
&starthe STAR database
Returns
int number of tags.

◆ string_get_format()

int string_get_format ( string &  s,
char *  format 
)

Gets the format from the item.

Parameters
&sstring.
*formatpointer to pre-allocated format string (modified).
Returns
int data type: 0=string, 1=integer, 2=float.
Returns the format in the given format string.

Variable Documentation

◆ use

const char* use[]
Initial value:
= {
" ",
"Usage: bstar [options] input.star [input.star]",
"----------------------------------------------",
"Examines and modifies STAR format files.",
" ",
"Actions:",
"-header 85 List all the header lines limited to the indicated length.",
"-split 3 Split the data blocks into individual files, inserting digits before the extension.",
"-list time_unit List all items with this STAR tag.",
"-delete resolution Delete all items with this STAR tag.",
"-blockdelete symmetry Delete all data blocks containing this STAR tag.",
"-integerscale select,1,3 Scale and shift all integer items with this STAR tag.",
"-floatscale psi,1.5,-5.1 Scale and shift all floating point items with this STAR tag.",
" ",
"Parameters:",
"-verbose 7 Verbosity of output.",
"-linelength 120 Output line length (default 100).",
" ",
"Output:",
"-output file.star Output STAR format file.",
" ",
NULL
}

◆ verbose

int verbose
extern