Changeset 38500
- Timestamp:
- Jun 19, 2015, 3:10:04 PM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150616/Ohana/src/libdvo
- Files:
-
- 8 edited
-
include/dvo.h (modified) (2 diffs)
-
src/LoadPhotcodesFITS.c (modified) (2 diffs)
-
src/SavePhotcodesFITS.c (modified) (1 diff)
-
src/dvo_convert.c (modified) (1 diff)
-
src/dvo_photcode_ops.c (modified) (1 diff)
-
src/skyregion_gsc.c (modified) (12 diffs)
-
src/skyregion_io.c (modified) (2 diffs)
-
src/skyregion_ops.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150616/Ohana/src/libdvo/include/dvo.h
r38472 r38500 259 259 typedef struct { 260 260 off_t Nregions; 261 off_t Nalloc; 261 262 char **filename; 262 263 SkyRegion *regions; … … 920 921 PhotCodeData *GetPhotcodeTable (void); 921 922 void SetPhotcodeTable (PhotCodeData *); 923 void FreePhotcodeData (PhotCodeData *myPhotcodes); 924 void FreePhotcodeTable (void); 922 925 923 926 int *GetSecFiltMap(PhotCodeData *ouput, PhotCodeData* input); -
branches/eam_branches/ipp-20150616/Ohana/src/libdvo/src/LoadPhotcodesFITS.c
r38441 r38500 51 51 } \ 52 52 photcode = PhotCode_##FORMAT##_To_Internal (photcode_input, Ncode); \ 53 free (photcode_input); \54 53 } 55 54 … … 65 64 CONVERT_FORMAT("DVO_PHOTCODE_PS1_V4", PS1_V4); 66 65 CONVERT_FORMAT("DVO_PHOTCODE_PS1_V5", PS1_V5); 66 67 gfits_db_free (&db); 67 68 68 69 table = GetPhotcodeTable (); -
branches/eam_branches/ipp-20150616/Ohana/src/libdvo/src/SavePhotcodesFITS.c
r38441 r38500 37 37 if (!gfits_db_save (&db)) return (FALSE); 38 38 if (!gfits_db_close (&db)) return (FALSE); 39 if (!gfits_db_free (&db)) return (FALSE); 39 40 40 41 free (photcode_output); -
branches/eam_branches/ipp-20150616/Ohana/src/libdvo/src/dvo_convert.c
r38441 r38500 1035 1035 Nimage = theader[0].Naxis[1]; 1036 1036 1037 # define FORMAT_CASE(FORMAT, TYPE) \1038 case DVO_FORMAT_##FORMAT: {\1039 Image_##TYPE *tmpImage;\1037 # define FORMAT_CASE(FORMAT, TYPE) \ 1038 case DVO_FORMAT_##FORMAT: { \ 1039 Image_##TYPE *tmpImage; \ 1040 1040 tmpImage = ImageInternalTo_##TYPE ((Image *) ftable[0].buffer, Nimage); \ 1041 free (ftable[0].buffer); \ 1042 gfits_table_set_Image_##TYPE (ftable, tmpImage, Nimage, TRUE); \ 1043 free (tmpImage); \ 1044 break; } 1041 free (ftable[0].buffer); \ 1042 gfits_free_header (ftable->header); \ 1043 gfits_table_set_Image_##TYPE (ftable, tmpImage, Nimage, TRUE); \ 1044 free (tmpImage); \ 1045 break; } 1045 1046 1046 1047 /* convert from the internal format */ -
branches/eam_branches/ipp-20150616/Ohana/src/libdvo/src/dvo_photcode_ops.c
r38153 r38500 43 43 } 44 44 45 // set the photcode table. This is used to switch between serveral previously 45 // free a specified photcode set 46 void FreePhotcodeData (PhotCodeData *myPhotcodes) { 47 if (!myPhotcodes) return; 48 FREE(myPhotcodes->code); 49 FREE(myPhotcodes); 50 } 51 52 // free the internal table 53 void FreePhotcodeTable (void) { 54 FreePhotcodeData (photcodes); 55 FREE(genericCodeMag); 56 FREE(genericCodeFlux); 57 } 58 59 // set the photcode table. This is used to switch between several previously 46 60 // allocated tables 47 61 void SetPhotcodeTable (PhotCodeData *new) { -
branches/eam_branches/ipp-20150616/Ohana/src/libdvo/src/skyregion_gsc.c
r37807 r38500 46 46 FTable ftable; 47 47 SkyTable *skytable; 48 SkyTable *band;49 48 SkyTable L0, L1, L2, L3, L4; 50 49 SkyRegionZone *zones; … … 79 78 /* L0 : full sky */ 80 79 L0.Nregions = 1; 81 ALLOCATE (L0.regions, SkyRegion, L0.Nregions); 80 L0.Nalloc = 1; 81 ALLOCATE (L0.regions, SkyRegion, L0.Nalloc); 82 82 L0.regions[0].Rmin = 0; 83 83 L0.regions[0].Rmax = 360; … … 99 99 /* allocate space for all levels */ 100 100 L1.Nregions = L2.Nregions = L3.Nregions = L4.Nregions = 0; 101 ALLOCATE (L1.regions, SkyRegion, 1);102 ALLOCATE (L2.regions, SkyRegion, 1);103 ALLOCATE (L3.regions, SkyRegion, 1);104 ALLOCATE (L4.regions, SkyRegion, 1);101 L1.Nalloc = NDECBANDS; ALLOCATE (L1.regions, SkyRegion, L1.Nalloc); 102 L2.Nalloc = NDECBANDS*0x10; ALLOCATE (L2.regions, SkyRegion, L2.Nalloc); 103 L3.Nalloc = NDECBANDS*0x100; ALLOCATE (L3.regions, SkyRegion, L3.Nalloc); 104 L4.Nalloc = NDECBANDS*0x1000; ALLOCATE (L4.regions, SkyRegion, L4.Nalloc); 105 105 106 106 // skipLines = 0; … … 130 130 131 131 /* load all GSC Regions in this band */ 132 band = SkyRegionForDecBand (&ftable.buffer[skipLines*48], DecLines[i], DecNames[i], L1.regions[i].Dmin, L1.regions[i].Dmax);132 SkyTable *band = SkyRegionForDecBand (&ftable.buffer[skipLines*48], DecLines[i], DecNames[i], L1.regions[i].Dmin, L1.regions[i].Dmax); 133 133 skipLines += DecLines[i]; 134 134 … … 151 151 152 152 L1.Nregions ++; 153 REALLOCATE (L1.regions, SkyRegion, L1.Nregions + 1);153 myAssert (L1.Nregions <= NDECBANDS, "too many L1 regions"); 154 154 } 155 155 … … 231 231 band[0].regions = regions; 232 232 band[0].Nregions = Nregions; 233 band[0].Nalloc = Nregions; 233 234 return (band); 234 235 } … … 277 278 Nregions = band[0].Nregions; 278 279 279 NZ = 10 ;280 NZ = 100; 280 281 ALLOCATE (zones, SkyRegionZone, NZ); 281 282 … … 312 313 /* go to the next zone */ 313 314 Nz++; 314 CHECK_REALLOCATE (zones, SkyRegionZone, NZ, Nz, 10 );315 CHECK_REALLOCATE (zones, SkyRegionZone, NZ, Nz, 100); 315 316 316 317 /* start info for the new zone */ … … 401 402 void SkyTableL2fromZone (SkyTable *L2, SkyTable *L3, SkyTable *L4, SkyTable *band, SkyRegionZone *zone, int parent) { 402 403 403 int i, N r, Ns, Ne;404 int i, Ns, Ne; 404 405 char *p, name[80]; 405 406 406 Nr = L2[0].Nregions;407 REALLOCATE (L2[0].regions, SkyRegion, Nr + 1);407 int Nr = L2[0].Nregions; 408 CHECK_REALLOCATE (L2[0].regions, SkyRegion, L2[0].Nalloc, L2[0].Nregions, 100); 408 409 409 410 /* divide this zone into L2 regions with Nset L3 regions each (fewer on ends) */ … … 444 445 445 446 Nr++; 446 REALLOCATE (L2[0].regions, SkyRegion, Nr + 1);447 CHECK_REALLOCATE (L2[0].regions, SkyRegion, L2[0].Nalloc, Nr, 100); 447 448 } 448 449 L2[0].Nregions = Nr; … … 456 457 Nr = L3[0].Nregions; 457 458 L3[0].Nregions += Ne - Ns; 458 REALLOCATE (L3[0].regions, SkyRegion, L3[0].Nregions);459 CHECK_REALLOCATE (L3[0].regions, SkyRegion, L3[0].Nalloc, L3[0].Nregions, 0.5*L3[0].Nalloc); 459 460 460 461 L2[0].child = TRUE; … … 498 499 Nr = L4[0].Nregions; 499 500 L4[0].Nregions += NDIV*NDIV; 500 REALLOCATE (L4[0].regions, SkyRegion, L4[0].Nregions);501 CHECK_REALLOCATE (L4[0].regions, SkyRegion, L4[0].Nalloc, L4[0].Nregions, 0.5*L4[0].Nalloc); 501 502 502 503 L3[0].child = TRUE; -
branches/eam_branches/ipp-20150616/Ohana/src/libdvo/src/skyregion_io.c
r38441 r38500 113 113 fclose (f); 114 114 115 gfits_free_header (&header); 116 gfits_free_matrix (&matrix); 117 gfits_free_header (&theader); 118 gfits_free_table (&ftable); 119 115 120 return (TRUE); 116 121 } … … 131 136 exit (1); 132 137 } 138 free (filename); 133 139 return (sky); 134 140 -
branches/eam_branches/ipp-20150616/Ohana/src/libdvo/src/skyregion_ops.c
r37807 r38500 550 550 } 551 551 free (list[0].regions); 552 free (list[0].filename); 552 553 } 553 554 free (list);
Note:
See TracChangeset
for help on using the changeset viewer.
