IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 6, 2013, 4:00:16 PM (13 years ago)
Author:
eugene
Message:

trying to set up remote image metadata

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mextract.c

    r35246 r35249  
    11# include "dvoshell.h"
    2 
    3 int SaveImageMetadata () {
    4 
    5 }
    62
    73int field_needs_images (dbField *field) {
     
    2016    if (field->ID == MEAS_CENTER_OFFSET)  return TRUE; // 0.5*NX, 0.5*NY
    2117    if (field->ID == MEAS_EXPNAME_AS_INT) return TRUE; // expname (or as int)
    22     mean airmass;
     18    if (field->ID == MEAS_AIRMASS)        return TRUE; // airmass
    2319    return FALSE;
    2420}
     
    5652    remove_argument (N, &argc, argv);
    5753    VERBOSE = TRUE;
     54  }
     55
     56  char *imageMetadataFile = FALSE;
     57  if ((N = get_argument (argc, argv, "-image-metadata"))) {
     58    remove_argument (N, &argc, argv);
     59    imageMetadataFile = strcreate (argv[N]);
     60    remove_argument (N, &argc, argv);
    5861  }
    5962
     
    8992
    9093  // init locally static variables (time refs)
    91   dbExtractMeasuresInit();
     94  // HOST_ID tells library if operation is on remote client or not
     95  dbExtractMeasuresInit(HOST_ID);
    9296
    9397  // command-line is of the form: mextract field,field, field [where (field op value)...]
     
    149153
    150154      char *filename = abspath("image.metadata.fits", DVO_MAX_PATH);
    151       SaveImageMetadata (filename, image, Nimage);
     155      ImageMetadataSave (filename, image, Nimage);
    152156      argc += 2;
    153157      argv[argc-2] = strcreate ("-image-metadata");
     
    171175  }
    172176
    173   if (REMOTE_CLIENT) {
    174     if (loadImages) {
    175       ImageMetadata = *imageMetadata = LoadImageMetadata (filename, &Nimages);
    176       if (!imageMetadata) goto escape;
    177       SetImageMetadata (imageMetadata, Nimages);
    178   } else {
    179     if (loadImages && !SetImageSelection (TRUE, selection)) goto escape;
     177  if (loadImages) {
     178    if (HOST_ID) {
     179      if (!SetImageMetadataSelection (imageMetadataFile)) goto escape;
     180    } else {
     181      if (!SetImageSelection (TRUE, selection)) goto escape;
     182    }
    180183  }
    181184
     
    294297  free (stack);
    295298  FreeImageSelection ();
     299  FreeImageMetadataSelection ();
    296300  SkyListFree (skylist);
    297301  FreeSkyRegionSelection (selection);
     
    307311  free (stack);
    308312  FreeImageSelection ();
     313  FreeImageMetadataSelection ();
    309314  SkyListFree (skylist);
    310315  FreeSkyRegionSelection (selection);
Note: See TracChangeset for help on using the changeset viewer.