IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5505


Ignore:
Timestamp:
Nov 11, 2005, 7:28:01 AM (21 years ago)
Author:
eugene
Message:

update

Location:
trunk/psastro/src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastro.c

    r5360 r5505  
    1010    psMetadata *config = psastroArguments (&argc, argv);
    1111
    12     // define optional parameters (keep in psMetadata?)
    13     pmAstromOpt *options = psastroDefineOptions (config);
    14 
    1512    // load the input data (cmp file)
    1613    psArray *rawstars = pmSourcesReadCMP (&header, argv[1]);
    1714
    18     psFPA *fpa = pmBuildFPA (header, config);
     15    // simple layout interpretation, basic WCS conversion
     16    psFPA *fpa = psastroBuildFPA (header, config);
    1917
    2018    // limit fit to bright stars only
     
    3129
    3230    // find initial offset / rotation
    33     stat = pmAstromGridMatch (subset, refstars, options);
     31    stat = pmAstromGridMatch (subset, refstars, config);
    3432
    3533    pmAstromModifyFPA (fpa, stat);
  • trunk/psastro/src/psastroArguments.c

    r5360 r5505  
    1414  psTraceArguments (argc, argv);
    1515
    16   // optional mask image - add to config
    17   char *mask = NULL;
    18   if ((N = psArgumentGet (*argc, argv, "-mask"))) {
    19     psArgumentRemove (N, argc, argv);
    20     mask = psStringCopy (argv[N]);
    21     psArgumentRemove (N, argc, argv);
    22   }
    23 
    24   // optional weight image - add to config
    25   char *weight = NULL;
    26   if ((N = psArgumentGet (*argc, argv, "-weight"))) {
    27     psArgumentRemove (N, argc, argv);
    28     weight = psStringCopy (argv[N]);
    29     psArgumentRemove (N, argc, argv);
    30   }
    31 
    32   // optional output residual image - add to config
    33   char *resid = NULL;
    34   if ((N = psArgumentGet (*argc, argv, "-resid"))) {
    35     psArgumentRemove (N, argc, argv);
    36     resid = psStringCopy (argv[N]);
    37     psArgumentRemove (N, argc, argv);
    38   }
    39 
    40   // optional output residual image - add to config
    41   char *photcode = NULL;
    42   if ((N = psArgumentGet (*argc, argv, "-photcode"))) {
    43     psArgumentRemove (N, argc, argv);
    44     photcode = psStringCopy (argv[N]);
    45     psArgumentRemove (N, argc, argv);
    46   }
    47 
    48   if (*argc != 4) usage ();
     16  if (*argc != 2) usage ();
    4917
    5018  // load config information
    5119  psMetadata *config = psMetadataAlloc ();
    52   psMetadataAdd (config, PS_LIST_HEAD, "PSF_MODEL", PS_DATA_METADATA_MULTI, "folder for psf model entries", NULL);
    5320  config = psMetadataConfigParse (config, &Nfail, argv[3], FALSE);
    54 
    55   // identify input image & optional weight & mask images
    56   // command-line entries override config-file entries
    57   psMetadataAdd (config, PS_LIST_HEAD, "IMAGE",       mode, "", argv[1]);
    58   psMetadataAdd (config, PS_LIST_HEAD, "OUTPUT_FILE", mode, "", argv[2]);
    59 
    60   if (mask != NULL) {
    61     psMetadataAdd (config, PS_LIST_HEAD, "MASK_IMAGE", mode, "", mask);
    62   }
    63   if (weight != NULL) {
    64     psMetadataAdd (config, PS_LIST_HEAD, "WEIGHT_IMAGE", mode, "", weight);
    65   }
    66   if (resid != NULL) {
    67     psMetadataAdd (config, PS_LIST_HEAD, "RESID_IMAGE", mode, "", resid);
    68   }
    69   if (photcode != NULL) {
    70     psMetadataAdd (config, PS_LIST_HEAD, "PHOTCODE", mode, "", photcode);
    71   } else {
    72     psMetadataAdd (config, PS_LIST_HEAD, "PHOTCODE", mode, "", "NONE");
    73   }   
    7421  return (config);
    7522}
     
    7724static void usage (void) {
    7825
    79     fprintf (stderr, "USAGE: psphot (image) (output) (config)\n");
    80     fprintf (stderr, "options: \n");
    81     fprintf (stderr, "  -mask  (filename)\n");
    82     fprintf (stderr, "  -weight (filename)\n");
    83     fprintf (stderr, "  -resid (filename)\n");
    84     fprintf (stderr, "  -photcode (photcode)\n");
     26    fprintf (stderr, "USAGE: psastro (cmpfile)\n");
    8527    exit (2);
    8628}
  • trunk/psastro/src/psastroUtils.c

    r5360 r5505  
    1414    // how many lines in the header?
    1515    // XXX EAM : is this calculation robust?
    16     nLines = header->list->n;
     16    nLines = myHeader->list->n;
    1717    nBytes = nLines * 80;
    1818    if (nBytes % 2880) {
     
    3939        sscanf (line, "%lf %lf %lf %lf", &X, &Y, &Mag, &dMag);
    4040       
    41         pmAstromObj *obj = pmAstromObjAlloc (X, Y, Mag, dMag);
     41        pmAstromObj *obj = pmAstromObjAlloc ();
     42        obj->pix.X    = X;
     43        obj->pix.Y    = Y;
     44        obj->pix.Mag  = Mag;
     45        obj->pix.dMag = dMag;
    4246        psArrayAdd (stars, obj, 100);
    4347    }
Note: See TracChangeset for help on using the changeset viewer.