IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 22, 2020, 11:00:22 AM (6 years ago)
Author:
eugene
Message:

add -copy option to coords; add mjdtolst; add option to control major tick spacing; add -copy option to header; add usage info to avperiodomatch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/coords.c

    r37807 r41379  
    1212  Vector *xvec = NULL;
    1313  Vector *yvec = NULL;
     14
     15  if ((N = get_argument (argc, argv, "-copy"))) {
     16    Buffer *src = NULL;
     17
     18    remove_argument (N, &argc, argv);
     19    if ((src = SelectBuffer (argv[N], OLDBUFFER, TRUE)) == NULL) goto escape;
     20
     21    if (!GetCoords (&coords, &src[0].header)) {
     22      gprint (GP_ERR, "error getting WCS elements from src buffer %s\n", argv[N]);
     23      return (FALSE);
     24    }
     25
     26    remove_argument (N, &argc, argv);
     27
     28    if (argc != 2) goto syntax;
     29
     30    if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) goto escape;
     31    if (!PutCoords (&coords, &buf[0].header)) {
     32      gprint (GP_ERR, "error getting WCS elements from src buffer %s\n", argv[1]);
     33      return (FALSE);
     34    }
     35    return TRUE;
     36  }
    1437
    1538  MOSAIC = NULL;
     
    116139 syntax:
    117140  gprint (GP_ERR, "USAGE: coords [buffer] (-c R D) | (-p X Y)\n");
    118   gprint (GP_ERR, "only one of -p or -c can be used\n");
     141  gprint (GP_ERR, "USAGE: coords [tgtbuffer] (-copy srcbuffer)\n");
     142  gprint (GP_ERR, "only one of -p or -c or -copy can be used\n");
    119143  gprint (GP_ERR, " -p : from pixels to ra/dec\n");
    120144  gprint (GP_ERR, " -c : from ra/dec to pixels\n");
    121145  gprint (GP_ERR, " coordinates are in degrees\n");
     146  gprint (GP_ERR, " -copy : copy coordinate WCS keywords from srcbuffer to tgtbuffer\n");
    122147 escape:
    123148  if (MOSAIC != NULL) free (MOSAIC);
Note: See TracChangeset for help on using the changeset viewer.