IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 9, 2013, 1:19:08 PM (14 years ago)
Author:
eugene
Message:

add rename command to splines; allow relastro to use the fixed pixel coordinates, Xfix,Yfix

Location:
branches/eam_branches/ipp-20121219/Ohana/src/opihi/cmd.data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20121219/Ohana/src/opihi/cmd.data/spline.c

    r34895 r34898  
    22
    33int spline_list (int argc, char **argv);
     4int spline_help (int argc, char **argv);
    45int spline_create (int argc, char **argv);
    56int spline_apply (int argc, char **argv);
     
    78int spline_save (int argc, char **argv);
    89int spline_delete (int argc, char **argv);
     10int spline_rename (int argc, char **argv);
    911int spline_getspline (int argc, char **argv);
    1012
    1113static Command spline_commands[] = {
     14  {1, "help",       spline_help,       "list spline help info"},
    1215  {1, "list",       spline_list,       "list splines"},
    1316  {1, "create",     spline_create,     "create a spline"},
     
    1619  {1, "save",       spline_save,       "read a spline from a FITS file"},
    1720  {1, "delete",     spline_delete,     "delete a spline"},
     21  {1, "rename",     spline_rename,     "rename a spline"},
    1822};
     23
     24int spline_help (int argc, char **argv) {
     25
     26  gprint (GP_ERR, "USAGE: spline (command)\n");
     27  gprint (GP_ERR, "    spline help                                  : this listing\n");
     28  gprint (GP_ERR, "    spline list                                  : list splines\n");
     29  gprint (GP_ERR, "    spline create (spline) (Xknots) (Yknots)     : create a spline\n");
     30  gprint (GP_ERR, "    spline apply  (spline) (Xpts) (Ypts)         : apply a spline to Xpts to get Ypts\n");
     31  gprint (GP_ERR, "    spline delete (spline)                       : delete named spline\n");
     32  gprint (GP_ERR, "    spline rename (spline) (new)                 : change spline name to new name\n");
     33  gprint (GP_ERR, "    spline load   (spline) (filename)            : load a spline from a FITS file\n");
     34  gprint (GP_ERR, "    spline save   (spline) (filename) [-append]  : save a spline in FITS format\n");
     35
     36  return FALSE;
     37}
    1938
    2039int spline_command (int argc, char **argv) {
     
    2342
    2443  if (argc < 2) {
    25     gprint (GP_ERR, "USAGE: spline (command)\n");
    26     gprint (GP_ERR, "    spline list                                  : list splines\n");
    27     gprint (GP_ERR, "    spline create (spline) (Xknots) (Yknots)     : create a spline\n");
    28     gprint (GP_ERR, "    spline apply  (spline) (Xpts) (Ypts)         : apply a spline to Xpts to get Ypts\n");
    29     gprint (GP_ERR, "    spline delete (spline)                       : delete named spline\n");
    30     gprint (GP_ERR, "    spline load   (spline) (filename)            : load a spline from a FITS file\n");
    31     gprint (GP_ERR, "    spline save   (spline) (filename) [-append]  : save a spline in FITS format\n");
     44    spline_help(0,NULL);
    3245    return (FALSE);
    3346  }
  • branches/eam_branches/ipp-20121219/Ohana/src/opihi/cmd.data/spline_commands.c

    r34584 r34898  
    126126}
    127127
     128int spline_rename (int argc, char **argv) {
     129
     130  Spline *spline;
     131
     132  if (argc != 3) {
     133    gprint (GP_ERR, "USAGE: spline rename (spline) (newname)\n");
     134    return FALSE;
     135  }
     136
     137  spline = FindSpline (argv[1]);
     138  if (spline == NULL) {
     139    gprint (GP_ERR, "spline %s not found\n", argv[1]);
     140    return FALSE;
     141  }
     142
     143  free (spline->name);
     144  spline->name = strcreate (argv[2]);
     145  return TRUE;
     146}
     147
    128148/*
    129149int spline_listspline (int argc, char **argv) {
Note: See TracChangeset for help on using the changeset viewer.