Changeset 5505
- Timestamp:
- Nov 11, 2005, 7:28:01 AM (21 years ago)
- Location:
- trunk/psastro/src
- Files:
-
- 1 added
- 3 edited
-
psastro.c (modified) (2 diffs)
-
psastroArguments.c (modified) (2 diffs)
-
psastroBuildFPA.c (added)
-
psastroUtils.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastro.c
r5360 r5505 10 10 psMetadata *config = psastroArguments (&argc, argv); 11 11 12 // define optional parameters (keep in psMetadata?)13 pmAstromOpt *options = psastroDefineOptions (config);14 15 12 // load the input data (cmp file) 16 13 psArray *rawstars = pmSourcesReadCMP (&header, argv[1]); 17 14 18 psFPA *fpa = pmBuildFPA (header, config); 15 // simple layout interpretation, basic WCS conversion 16 psFPA *fpa = psastroBuildFPA (header, config); 19 17 20 18 // limit fit to bright stars only … … 31 29 32 30 // find initial offset / rotation 33 stat = pmAstromGridMatch (subset, refstars, options);31 stat = pmAstromGridMatch (subset, refstars, config); 34 32 35 33 pmAstromModifyFPA (fpa, stat); -
trunk/psastro/src/psastroArguments.c
r5360 r5505 14 14 psTraceArguments (argc, argv); 15 15 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 (); 49 17 50 18 // load config information 51 19 psMetadata *config = psMetadataAlloc (); 52 psMetadataAdd (config, PS_LIST_HEAD, "PSF_MODEL", PS_DATA_METADATA_MULTI, "folder for psf model entries", NULL);53 20 config = psMetadataConfigParse (config, &Nfail, argv[3], FALSE); 54 55 // identify input image & optional weight & mask images56 // command-line entries override config-file entries57 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 }74 21 return (config); 75 22 } … … 77 24 static void usage (void) { 78 25 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"); 85 27 exit (2); 86 28 } -
trunk/psastro/src/psastroUtils.c
r5360 r5505 14 14 // how many lines in the header? 15 15 // XXX EAM : is this calculation robust? 16 nLines = header->list->n;16 nLines = myHeader->list->n; 17 17 nBytes = nLines * 80; 18 18 if (nBytes % 2880) { … … 39 39 sscanf (line, "%lf %lf %lf %lf", &X, &Y, &Mag, &dMag); 40 40 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; 42 46 psArrayAdd (stars, obj, 100); 43 47 }
Note:
See TracChangeset
for help on using the changeset viewer.
