From 383d7710c06917e61a2045e5abd360977ab3c80c Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 12 Jan 2010 15:38:55 +0100 Subject: Add options to specify boost and binning on the command line --- src/hdfsee.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/hdfsee.c') diff --git a/src/hdfsee.c b/src/hdfsee.c index 269f90a0..081769d3 100644 --- a/src/hdfsee.c +++ b/src/hdfsee.c @@ -36,6 +36,8 @@ static void show_help(const char *s) " -h, --help Display this help message.\n" "\n" " -p, --peak-overlay= Draw circles in positions listed in file.\n" +" -i, --int-boost= Multiple intensity by .\n" +" -b, --binning= Set display binning to .\n" "\n"); } @@ -72,11 +74,15 @@ int main(int argc, char *argv[]) size_t i; int nfiles; char *peaks = NULL; + int boost = 1; + int binning = 2; /* Long options */ const struct option longopts[] = { {"help", 0, NULL, 'h'}, {"peak-overlay", 1, NULL, 'p'}, + {"int-boost", 1, NULL, 'i'}, + {"binning", 1, NULL, 'b'}, {0, 0, NULL, 0} }; @@ -84,7 +90,7 @@ int main(int argc, char *argv[]) gtk_init(&argc, &argv); /* Short options */ - while ((c = getopt_long(argc, argv, "hp:", longopts, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "hp:b:i:", longopts, NULL)) != -1) { switch (c) { case 'h' : { @@ -97,6 +103,23 @@ int main(int argc, char *argv[]) break; } + case 'i' : { + boost = atoi(optarg); + if ( boost < 1 ) { + ERROR("Intensity boost must be a positive" + " integer.\n"); + } + break; + } + + case 'b' : { + binning = atoi(optarg); + if ( boost < 1 ) { + ERROR("Binning must be a positive integer.\n"); + } + break; + } + case 0 : { break; } @@ -116,7 +139,8 @@ int main(int argc, char *argv[]) } for ( i=0; i