Changeset 29412
- Timestamp:
- Oct 14, 2010, 2:09:00 PM (16 years ago)
- Location:
- branches/eam_branches/ipp-20100823/Ohana/src
- Files:
-
- 11 edited
-
addstar/include/addstar.h (modified) (1 diff)
-
addstar/src/MatchHeaders.c (modified) (1 diff)
-
addstar/src/ReadStarsFITS.c (modified) (2 diffs)
-
libautocode/Makefile.Targets (modified) (2 diffs)
-
libautocode/def/autocode.c (modified) (3 diffs)
-
libdvo/src/cmf-ps1-v1-alt.c (modified) (1 diff)
-
libfits/include/gfitsio.h (modified) (1 diff)
-
libkapa/include/kapa.h (modified) (1 diff)
-
libohana/include/ohana.h (modified) (2 diffs)
-
libohana/src/Fread.c (modified) (1 diff)
-
mosastro/src/ConvertMatch.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100823/Ohana/src/addstar/include/addstar.h
r28965 r29412 253 253 Stars *Convert_PS1_V1_Alt PROTO((FTable *table, unsigned int *nstars)); 254 254 Stars *Convert_PS1_V2 PROTO((FTable *table, unsigned int *nstars)); 255 Stars *Convert_PS1_V3 PROTO((FTable *table, unsigned int *nstars)); 255 256 256 257 int InitStar PROTO((Stars *star)); -
branches/eam_branches/ipp-20100823/Ohana/src/addstar/src/MatchHeaders.c
r27435 r29412 57 57 if (!strcmp (exttype, "PS1_V1")) goto keep; 58 58 if (!strcmp (exttype, "PS1_V2")) goto keep; 59 if (!strcmp (exttype, "PS1_V3")) goto keep; 59 60 continue; 60 61 -
branches/eam_branches/ipp-20100823/Ohana/src/addstar/src/ReadStarsFITS.c
r29001 r29412 47 47 stars = Convert_PS1_V2 (&table, &Nstars); 48 48 } 49 if (!strcmp (type, "PS1_V3")) { 50 stars = Convert_PS1_V3 (&table, &Nstars); 51 } 49 52 if (stars == NULL) { 50 53 fprintf (stderr, "ERROR: invalid table type %s\n", type); … … 426 429 return (stars); 427 430 } 431 432 Stars *Convert_PS1_V3 (FTable *table, unsigned int *nstars) { 433 434 off_t Nstars; 435 unsigned int i; 436 double ZeroPt; 437 Stars *stars; 438 CMF_PS1_V3 *ps1data; 439 440 ps1data = gfits_table_get_CMF_PS1_V3 (table, &Nstars, NULL); 441 if (!ps1data) { 442 fprintf (stderr, "skipping inconsistent entry\n"); 443 return (NULL); 444 } 445 ZeroPt = GetZeroPoint(); 446 447 ALLOCATE (stars, Stars, Nstars); 448 for (i = 0; i < Nstars; i++) { 449 InitStar (&stars[i]); 450 stars[i].measure.Xccd = ps1data[i].X; 451 stars[i].measure.Yccd = ps1data[i].Y; 452 stars[i].measure.dXccd = ShortPixels(ps1data[i].dX); 453 stars[i].measure.dYccd = ShortPixels(ps1data[i].dY); 454 455 stars[i].measure.posangle = ShortDegree(ps1data[i].posangle); 456 stars[i].measure.pltscale = ps1data[i].pltscale; 457 458 if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) { 459 stars[i].measure.M = NAN; 460 } else { 461 stars[i].measure.M = ps1data[i].M + ZeroPt; 462 } 463 stars[i].measure.dM = ps1data[i].dM; 464 stars[i].measure.dMcal = ps1data[i].dMcal; 465 stars[i].measure.Map = ps1data[i].Map + ZeroPt; 466 467 stars[i].measure.Sky = ps1data[i].sky; 468 stars[i].measure.dSky = ps1data[i].dSky; 469 470 stars[i].measure.psfChisq = ps1data[i].psfChisq; 471 stars[i].measure.psfQual = ps1data[i].psfQual; 472 stars[i].measure.psfNdof = ps1data[i].psfNdof; 473 stars[i].measure.psfNpix = ps1data[i].psfNpix; 474 stars[i].measure.crNsigma = ps1data[i].crNsigma; 475 stars[i].measure.extNsigma = ps1data[i].extNsigma; 476 477 stars[i].measure.FWx = ShortPixels(ps1data[i].fx); 478 stars[i].measure.FWy = ShortPixels(ps1data[i].fy); 479 stars[i].measure.theta = ShortDegree(ps1data[i].df); 480 481 stars[i].measure.Mxx = ShortPixels(ps1data[i].Mxx); 482 stars[i].measure.Mxy = ShortPixels(ps1data[i].Mxy); 483 stars[i].measure.Myy = ShortPixels(ps1data[i].Myy); 484 485 stars[i].measure.photFlags = ps1data[i].flags; 486 487 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 488 stars[i].measure.detID = ps1data[i].detID; 489 490 // the Average fields and the following Measure fields are set in FilterStars after 491 // the image metadata is in hand: dR, dD, Mcal, dt, airmass, az, t, imageID, extID, 492 // averef is set in find_matches, dbFlags is zero on ingest. 493 494 // the following fields are currently not being set anywhere: t_msec 495 } 496 *nstars = Nstars; 497 return (stars); 498 } -
branches/eam_branches/ipp-20100823/Ohana/src/libautocode/Makefile.Targets
r27579 r29412 59 59 $(ASRC)/cmf-ps1-v1.$(ARCH).o \ 60 60 $(ASRC)/cmf-ps1-v2.$(ARCH).o \ 61 $(ASRC)/cmf-ps1-v3.$(ARCH).o \ 61 62 $(ASRC)/cmf-smpdata.$(ARCH).o \ 62 63 $(ASRC)/getstar-ps1-dev-0.$(ARCH).o \ … … 129 130 $(AINC)/cmf-ps1-v1.h \ 130 131 $(AINC)/cmf-ps1-v2.h \ 132 $(AINC)/cmf-ps1-v3.h \ 131 133 $(AINC)/cmf-smpdata.h \ 132 134 $(AINC)/getstar-ps1-dev-0.h \ -
branches/eam_branches/ipp-20100823/Ohana/src/libautocode/def/autocode.c
r29001 r29412 25 25 } 26 26 27 $STRUCT *gfits_downsize_and_convert_$STRUCT ($STRUCT *data, off_t size, off_t nitems) {28 29 off_t i;30 unsigned char *byte, tmp;31 $STRUCT *output;32 33 if ($SIZE > size) {34 fprintf (stderr, "ERROR: uncorrectable mismatch in data types $STRUCT: "OFF_T_FMT" vs %d\n", size, $SIZE);35 exit (1);36 }37 38 // allocate a new array39 ALLOCATE (output, $STRUCT, nitems);40 for (i = 0; i < nitems; i++) {41 memcpy (&output[i], &data[i], $SIZE);42 }43 44 /* provide initial values to avoid compiler warnings for non-BYTE_SWAP arch */45 i = tmp = 0;46 byte = NULL;47 48 # ifdef BYTE_SWAP49 byte = (unsigned char *) output;50 for (i = 0; i < nitems; i++, byte += size) {51 /** BYTE SWAP **/52 }53 # endif54 55 return (output);56 }57 58 27 /*** add test of EXTNAME and header-defined columns? ***/ 59 28 /* return internal structure representation */ … … 61 30 62 31 int Ncols; 63 $STRUCT *data , *output;32 $STRUCT *data; 64 33 65 34 Ncols = ftable[0].header[0].Naxis[0]; … … 73 42 if ((swapped == NULL) || (*swapped == FALSE)) { 74 43 if (!gfits_convert_$STRUCT (data, sizeof ($STRUCT), *Ndata)) { 75 output = gfits_downsize_and_convert_$STRUCT (data, sizeof ($STRUCT), *Ndata); 76 free (ftable[0].buffer); 77 ftable[0].buffer = (char *) output; 78 // XXX do I need to change NX? 44 return NULL; 79 45 } 80 46 gfits_table_scale_data (ftable); -
branches/eam_branches/ipp-20100823/Ohana/src/libdvo/src/cmf-ps1-v1-alt.c
r29001 r29412 1 1 # include "dvo.h" 2 3 /* if we are not correctly including the ohana headers, this will fail */ 4 # ifndef BYTE_SWAP 5 # ifndef NOT_BYTE_SWAP 6 # error "neither BYTE_SWAP not NOT_BYTE_SWAP is set" 7 # endif 8 # endif 2 9 3 10 CMF_PS1_V2 *gfits_table_get_CMF_PS1_V1_Alt (FTable *ftable, off_t *Ndata, char *swapped) { -
branches/eam_branches/ipp-20100823/Ohana/src/libfits/include/gfitsio.h
r28241 r29412 13 13 # endif 14 14 15 /* if we are not correctly including the ohana headers, this will fail */ 15 16 # ifndef NEWLINE 16 17 # define NEWLINE 10 /* UNIX RETURN character */ -
branches/eam_branches/ipp-20100823/Ohana/src/libkapa/include/kapa.h
r27790 r29412 12 12 # include <png.h> 13 13 # include <dvo.h> 14 15 /* if we are not correctly including the ohana headers, this will fail */ 16 # ifndef BYTE_SWAP 17 # ifndef NOT_BYTE_SWAP 18 # error "neither BYTE_SWAP not NOT_BYTE_SWAP is set" 19 # endif 20 # endif 14 21 15 22 typedef struct sockaddr_in KapaSockAddress; -
branches/eam_branches/ipp-20100823/Ohana/src/libohana/include/ohana.h
r28645 r29412 94 94 }; 95 95 96 /* note: in the Ohana tree, the byte order is determined by the ARCH variable 97 if you have a small endian machine that is not listed here, the test 98 program 'typestest' should fail */ 96 /* Some notes on the Ohana BYTE_SWAP macros: 97 98 1) BYTE_SWAP is set in this file based on the environment variable 'ARCH', which is in turn 99 set by the psconfig system (or is set manually by the builder). 100 101 2) BYTE_SWAP is only used when building the Ohana tree: code which links against Ohana 102 (eg, libkapa or others) does not need to have this value correctly set. 103 104 3) the libohana build tests for the validity of the BYTE_SWAP choice by running the test 105 program 'typestest' and raising an error if the tests fail. 106 107 4) if your build fails due to the typestest program, check your value of 'ARCH' and if 108 necessary add it to the list below. 109 110 */ 111 99 112 # ifndef BYTE_SWAP 100 113 # ifdef linux … … 117 130 # define BYTE_SWAP 118 131 # endif 119 # else 132 # endif /* BYTE_SWAP */ 133 134 /* other Ohana components use these two values to check that ohana.h was correctly included */ 135 # ifndef BYTE_SWAP 120 136 # define NOT_BYTE_SWAP 121 # endif /* BYTE_SWAP */137 # endif 122 138 123 139 # ifndef NAN -
branches/eam_branches/ipp-20100823/Ohana/src/libohana/src/Fread.c
r27435 r29412 14 14 tmp = byte[X+2]; byte[X+2] = byte[X+5]; byte[X+5] = tmp; \ 15 15 tmp = byte[X+3]; byte[X+3] = byte[X+4]; byte[X+4] = tmp; 16 17 /** this is also used in libautocode/def/common.h -- consolidate **/18 # ifdef linux19 # define BYTE_SWAP20 # endif21 22 # ifdef sid23 # define BYTE_SWAP24 # endif25 26 # ifdef dec27 # define BYTE_SWAP28 # endif29 16 30 17 /* add other architectures here, ie dec, alpha, etc */ -
branches/eam_branches/ipp-20100823/Ohana/src/mosastro/src/ConvertMatch.c
r12332 r29412 11 11 tmp = byte[X+2]; byte[X+2] = byte[X+5]; byte[X+5] = tmp; \ 12 12 tmp = byte[X+3]; byte[X+3] = byte[X+4]; byte[X+4] = tmp; 13 14 # ifdef linux15 # define BYTE_SWAP16 # endif17 18 # ifdef sid19 # define BYTE_SWAP20 # endif21 22 # ifdef dec23 # define BYTE_SWAP24 # endif25 13 26 14 # define MATCH_SIZE 104
Note:
See TracChangeset
for help on using the changeset viewer.
