- Timestamp:
- Apr 27, 2022, 4:30:04 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20220316/fpcamera/src/fpcameraLoadRefstars.c
r42178 r42182 13 13 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, FPCAMERA_RECIPE); 14 14 15 // DVO APIs expect decimal degrees16 float RAmin = DEG_RAD*psMetadataLookupF32(NULL, recipe, "RA_MIN");17 float RAmax = DEG_RAD*psMetadataLookupF32(NULL, recipe, "RA_MAX");18 float DECmin = DEG_RAD*psMetadataLookupF32(NULL, recipe, "DEC_MIN");19 float DECmax = DEG_RAD*psMetadataLookupF32(NULL, recipe, "DEC_MAX");15 // FPA FOV is determined by fpcameraReadAstrometry & save on fpa->analysis 16 float RAmin = psMetadataLookupF32(NULL, input->fpa->analysis, "RA_MIN"); 17 float RAmax = psMetadataLookupF32(NULL, input->fpa->analysis, "RA_MAX"); 18 float DECmin = psMetadataLookupF32(NULL, input->fpa->analysis, "DEC_MIN"); 19 float DECmax = psMetadataLookupF32(NULL, input->fpa->analysis, "DEC_MAX"); 20 20 21 21 // extra field fraction to add … … 37 37 DECmax += dDEC * fieldPadding; 38 38 39 // XXX: fpcameraArguments.c looks for this explicitly on the command line, but stores it in arguments. 40 // this could be a recipe value which can also be defined as a command-line option 41 39 42 // grab the FPCAMERA.CATDIR name from the FPCAMERA recipe 40 43 char *catdir_recipe = psMetadataLookupStr(&status, recipe, "FPCAMERA.CATDIR"); … … 43 46 // substitute abstract name with concrete name, if present in FPCAMERA.CATDIRS 44 47 psMetadata *catdirs = psMetadataLookupMetadata(&status, config->site, "FPCAMERA.CATDIRS"); // List of cameras 45 if (!catdirs) ESCAPE(FPCAMERA_ERR_CONFIG, "Unable to find FPCAMERA.CATDIRS in the system configuration.\n"); 48 49 // XXX it is allowed that FPCAMERA.CATDIRS is not defined in site.config: the value must be a real path 50 // if (!catdirs) ESCAPE(FPCAMERA_ERR_CONFIG, "Unable to find FPCAMERA.CATDIRS in the system configuration.\n"); 46 51 47 52 // the name in the recipe may be one of: … … 49 54 // (B) a reference to the name in the FPCAMERA.CATDIRS folder in site.config 50 55 // (C) a reference to a folder in the FPCAMERA.CATDIRS folder in site.config, containing multiple copy locations 51 char *catdir_virtual = psMetadataLookupStr(&status, catdirs, catdir_recipe); 52 53 psMetadata *catdir_folder = psMetadataLookupMetadata(&status, catdirs, catdir_recipe); 56 57 // can we find a plain string matching catdir_recipe in the catdirs folder? 58 char *catdir_virtual = catdirs ? psMetadataLookupStr(&status, catdirs, catdir_recipe) : NULL; 59 60 // OR, can we find a subfolder in the catdirs folder? 61 psMetadata *catdir_folder = catdirs ? psMetadataLookupMetadata(&status, catdirs, catdir_recipe) : NULL; 54 62 if (catdir_folder) { 55 63 // randomly choose one of the entries … … 69 77 } 70 78 79 // if catdir_virtual is NULL, catdir_recipe must be a file name 71 80 char *catdir = (catdir_virtual == NULL) ? catdir_recipe : catdir_virtual; 72 81 73 82 // convert the uri to a real filename (ie, path://foobar) 74 83 psString CATDIR = pmConfigConvertFilename(catdir, config, false, false); // Resolved filename 75 ESCAPE(FPCAMERA_ERR_CONFIG, "unable to determine filename for CATDIR %s", catdir);84 if (!CATDIR) ESCAPE(FPCAMERA_ERR_CONFIG, "unable to determine filename for CATDIR %s", catdir); 76 85 77 86 psLogMsg ("fpcamera", 3, "looking up reference objects in %s\n", CATDIR); 78 87 79 88 char *getstarCommand = psStringCopy(psMetadataLookupStr(NULL, recipe, "DVO.GETSTAR")); 80 ESCAPE(FPCAMERA_ERR_CONFIG, "unable to find DVO.GETSTAR in recipe");89 if (!getstarCommand) ESCAPE(FPCAMERA_ERR_CONFIG, "unable to find DVO.GETSTAR in recipe"); 81 90 82 91 char *outformat = psMetadataLookupStr(NULL, recipe, "DVO.GETSTAR.OUTFORMAT"); 83 ESCAPE(FPCAMERA_ERR_CONFIG, "unable to find DVO.GETSTAR.OUTFORMAT in recipe");92 if (!outformat) ESCAPE(FPCAMERA_ERR_CONFIG, "unable to find DVO.GETSTAR.OUTFORMAT in recipe"); 84 93 85 94 // issue the following command: … … 166 175 167 176 psMetadataAdd (input->fpa->analysis, PS_LIST_TAIL, "FPCAMERA.REFSTARS", PS_DATA_ARRAY, "reference sources", refstars); 177 psFree (refstars); 178 168 179 return true; 169 180 }
Note:
See TracChangeset
for help on using the changeset viewer.
