aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-09-19 11:29:28 +0200
committerThomas White <taw@physics.org>2013-09-19 11:29:28 +0200
commit72b949c4ec28e76dea966d88eae549fad6548143 (patch)
tree58e4c6838811cdab862564f10543b64add88137f
parentc922fc1bc1fdad83bfd00e17f134b8d9a05884db (diff)
hdfsee: Use beam parameters file (--beam option)
-rw-r--r--src/dw-hdfsee.c11
-rw-r--r--src/dw-hdfsee.h3
-rw-r--r--src/hdfsee.c11
3 files changed, 21 insertions, 4 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index ddfa831a..3b361207 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -1813,6 +1813,7 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
double boost, int binning,
int noisefilter, int colscale,
const char *element, const char *geometry,
+ const char *beam,
int show_rings, double *ring_radii,
int n_rings, double ring_size,
int median_filter)
@@ -1846,6 +1847,15 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
dw->ring_radii = ring_radii;
dw->n_rings = n_rings;
dw->median_filter = median_filter;
+ dw->image = calloc(1, sizeof(struct image));
+
+ if ( beam != NULL ) {
+ dw->image->beam = get_beam_parameters(beam);
+ }
+
+ if ( (dw->image->beam != NULL) && (dw->hdfile != NULL) ) {
+ fill_in_beam_parameters(dw->image->beam, dw->hdfile);
+ }
/* Open the file, if any */
if ( filename != NULL ) {
@@ -1864,7 +1874,6 @@ DisplayWindow *displaywindow_open(const char *filename, const char *peaks,
}
if ( !fail ) {
- dw->image = calloc(1, sizeof(struct image));
dw->image->filename = strdup(filename);
hdf5_read(dw->hdfile, dw->image, 0);
} else {
diff --git a/src/dw-hdfsee.h b/src/dw-hdfsee.h
index 3e908947..92ca9d42 100644
--- a/src/dw-hdfsee.h
+++ b/src/dw-hdfsee.h
@@ -121,7 +121,8 @@ extern DisplayWindow *displaywindow_open(const char *filename,
int binning,
int noisefilter, int colscale,
const char *element,
- const char *geometry, int show_rings,
+ const char *geometry, const char *beam,
+ int show_rings,
double *ring_radii, int n_rings,
double ring_size, int median_filter);
diff --git a/src/hdfsee.c b/src/hdfsee.c
index 24d6d9cc..6b4d0bf0 100644
--- a/src/hdfsee.c
+++ b/src/hdfsee.c
@@ -74,6 +74,7 @@ static void show_help(const char *s)
" -e, --image=<element> Start up displaying this image from the\n"
" HDF5 file. Example: /data/data0.\n"
" -g, --geometry=<filename> Use geometry from file for display.\n"
+" -m, --beam=<filename> Get beam parameters from <filename>.\n"
"\n");
}
@@ -118,6 +119,7 @@ int main(int argc, char *argv[])
char *cscale = NULL;
char *element = NULL;
char *geometry = NULL;
+ char *beam = NULL;
double ring_size = 5.0;
char *reslist = NULL;
double ring_radii[128];
@@ -134,6 +136,7 @@ int main(int argc, char *argv[])
{"colscale", 1, NULL, 'c'},
{"image", 1, NULL, 'e'},
{"geometry", 1, NULL, 'g'},
+ {"beam", 1, NULL, 'm'},
{"show-rings", 0, &config_showrings, 1},
{"ring-size", 1, NULL, 2},
{"simple-rings", 1, NULL, 'r'},
@@ -144,7 +147,7 @@ int main(int argc, char *argv[])
gtk_init(&argc, &argv);
/* Short options */
- while ((c = getopt_long(argc, argv, "hp:b:i:c:e:g:2:r:",
+ while ((c = getopt_long(argc, argv, "hp:b:i:c:e:g:2:r:m:",
longopts, NULL)) != -1) {
char *test;
@@ -188,6 +191,10 @@ int main(int argc, char *argv[])
geometry = strdup(optarg);
break;
+ case 'm' :
+ beam = strdup(optarg);
+ break;
+
case 2 :
ring_size = strtod(optarg, &test);
if ( test == optarg ) {
@@ -263,7 +270,7 @@ int main(int argc, char *argv[])
boost, binning,
config_noisefilter,
colscale, element,
- geometry,
+ geometry, beam,
config_showrings,
ring_radii,
n_rings,