aboutsummaryrefslogtreecommitdiff
path: root/src/mapping.c
diff options
context:
space:
mode:
authorTom White <weiss@jade.(none)>2008-09-29 18:23:46 +0100
committerThomas White <taw27@cam.ac.uk>2008-10-02 17:56:45 +0100
commitf6a8e7ef02e6f449c2c3aa6186bf10d81c127dd3 (patch)
tree80bce3620f8823e15a00db4b1165101a2a933c86 /src/mapping.c
parentd200349cad19fa80947b441711cc36685a974aa2 (diff)
Add a scale bar to the diffraction patterns
Diffstat (limited to 'src/mapping.c')
-rw-r--r--src/mapping.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mapping.c b/src/mapping.c
index 54a7235..4897450 100644
--- a/src/mapping.c
+++ b/src/mapping.c
@@ -128,6 +128,20 @@ int mapping_scale(ImageFeature *refl, double *ddx, double *ddy) {
}
+/* Return the length of a 1 nm^-1 scale bar in the given image (in pixels)
+ * Result only strictly valid at the centre of the image */
+double mapping_scale_bar_length(ImageRecord *image) {
+
+ switch ( image->fmode ) {
+ case FORMULATION_PIXELSIZE : return 1.0e9/image->pixel_size;
+ case FORMULATION_CLEN : return image->camera_len*image->lambda;
+ default : fprintf(stderr, "Unrecognised formulation mode in mapping_scale_bar_length.\n");
+ }
+
+ return 0.0;
+
+}
+
void mapping_map_features(ControlContext *ctx) {
int i;