aboutsummaryrefslogtreecommitdiff
path: root/src/mapping.c
diff options
context:
space:
mode:
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;