Changeset 37967
- Timestamp:
- Mar 12, 2015, 6:24:17 AM (11 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 1 added
- 3 edited
-
addstar/src/MatchHeaders.c (modified) (1 diff)
-
addstar/src/ReadStarsFITS.c (modified) (3 diffs)
-
libautocode/Makefile.Targets (modified) (2 diffs)
-
libautocode/def/cmf-ps1-dv5.d (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/MatchHeaders.c
r37729 r37967 70 70 if (!strcmp (exttype, "PS1_DV3")) goto keep; 71 71 if (!strcmp (exttype, "PS1_DV4")) goto keep; 72 if (!strcmp (exttype, "PS1_DV5")) goto keep; 72 73 continue; 73 74 -
trunk/Ohana/src/addstar/src/ReadStarsFITS.c
r37729 r37967 22 22 Stars *Convert_PS1_DV3 PROTO((FTable *table, unsigned int *nstars)); 23 23 Stars *Convert_PS1_DV4 PROTO((FTable *table, unsigned int *nstars)); 24 Stars *Convert_PS1_DV5 PROTO((FTable *table, unsigned int *nstars)); 24 25 25 26 // given a file with the pointer at the start of the table block and the … … 113 114 stars = Convert_PS1_DV4 (&table, &Nstars); 114 115 } 116 if (!strcmp (type, "PS1_DV5")) { 117 stars = Convert_PS1_DV5 (&table, &Nstars); 118 } 115 119 if (stars == NULL) { 116 120 fprintf (stderr, "invalid table type %s\n", type); … … 1695 1699 } 1696 1700 1697 1698 1701 Stars *Convert_PS1_DV5 (FTable *table, unsigned int *nstars) { 1702 1703 off_t Nstars; 1704 unsigned int i; 1705 double ZeroPt; 1706 Stars *stars; 1707 CMF_PS1_DV5 *ps1data; 1708 1709 ps1data = gfits_table_get_CMF_PS1_DV5 (table, &Nstars, NULL); 1710 if (!ps1data) { 1711 fprintf (stderr, "skipping inconsistent entry\n"); 1712 return (NULL); 1713 } 1714 ZeroPt = GetZeroPoint(); 1715 1716 ALLOCATE (stars, Stars, Nstars); 1717 for (i = 0; i < Nstars; i++) { 1718 InitStar (&stars[i]); 1719 stars[i].measure.Xccd = ps1data[i].X; 1720 stars[i].measure.Yccd = ps1data[i].Y; 1721 stars[i].measure.dXccd = ToShortPixels(ps1data[i].dX); 1722 stars[i].measure.dYccd = ToShortPixels(ps1data[i].dY); 1723 1724 stars[i].measure.posangle = ToShortDegrees(ps1data[i].posangle); 1725 stars[i].measure.pltscale = ps1data[i].pltscale; 1726 1727 if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) { 1728 stars[i].measure.M = NAN; 1729 } else { 1730 stars[i].measure.M = ps1data[i].M + ZeroPt; 1731 } 1732 stars[i].measure.dM = ps1data[i].dM; 1733 stars[i].measure.dMcal = ps1data[i].dMcal; 1734 stars[i].measure.Map = ps1data[i].Map + ZeroPt; 1735 stars[i].measure.dMap = (ps1data[i].apFlux > 0.0) ? fabs(ps1data[i].apFluxErr / ps1data[i].apFlux) : NAN; 1736 1737 stars[i].measure.Mkron = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN; 1738 stars[i].measure.dMkron = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN; 1739 1740 // these fluxes are converted from counts to counts/sec in FilterStars.c 1741 stars[i].measure.FluxPSF = GetFluxFromFluxOrMag (ps1data[i].Flux, ps1data[i].M); 1742 stars[i].measure.dFluxPSF = GetFluxErrFromFluxOrMag (ps1data[i].dFlux, stars[i].measure.FluxPSF, ps1data[i].dM); 1743 stars[i].measure.FluxKron = ps1data[i].kronFlux; 1744 stars[i].measure.dFluxKron = ps1data[i].kronFluxErr; 1745 stars[i].measure.FluxAp = GetFluxFromFluxOrMag (ps1data[i].apFlux, ps1data[i].Map); 1746 stars[i].measure.dFluxAp = GetFluxErrFromFluxOrMag (ps1data[i].apFluxErr, stars[i].measure.FluxAp, stars[i].measure.dMap); 1747 1748 stars[i].measure.Sky = ps1data[i].sky; 1749 stars[i].measure.dSky = ps1data[i].dSky; 1750 1751 stars[i].measure.psfChisq = ps1data[i].psfChisq; 1752 stars[i].measure.psfQF = ps1data[i].psfQF; 1753 stars[i].measure.psfQFperf = ps1data[i].psfQFperf; 1754 stars[i].measure.psfNdof = ps1data[i].psfNdof; 1755 stars[i].measure.psfNpix = ps1data[i].psfNpix; 1756 stars[i].measure.extNsigma = ps1data[i].extNsigma; 1757 1758 stars[i].measure.FWx = ToShortPixels(ps1data[i].fx); 1759 stars[i].measure.FWy = ToShortPixels(ps1data[i].fy); 1760 stars[i].measure.theta = ToShortDegrees(ps1data[i].df); 1761 1762 stars[i].measure.Mxx = ToShortPixels(ps1data[i].Mxx); 1763 stars[i].measure.Mxy = ToShortPixels(ps1data[i].Mxy); 1764 stars[i].measure.Myy = ToShortPixels(ps1data[i].Myy); 1765 1766 stars[i].measure.photFlags = ps1data[i].flags; 1767 stars[i].measure.photFlags2 = ps1data[i].flags2; 1768 1769 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 1770 stars[i].measure.detID = ps1data[i].detID; 1771 1772 // the Average fields and the following Measure fields are set in FilterStars after 1773 // the image metadata is in hand: dR, dD, Mcal, dt, airmass, az, t, imageID, extID. 1774 1775 // averef is set in find_matches 1776 1777 // dbFlags is zero on ingest. 1778 1779 // the following fields are currently not being set anywhere: t_msec 1780 } 1781 *nstars = Nstars; 1782 return (stars); 1783 } 1784 1785 1786 -
trunk/Ohana/src/libautocode/Makefile.Targets
r37807 r37967 91 91 $(ASRC)/cmf-ps1-sv2.$(ARCH).o \ 92 92 $(ASRC)/cmf-ps1-dv4.$(ARCH).o \ 93 $(ASRC)/cmf-ps1-dv5.$(ARCH).o \ 93 94 $(ASRC)/cmf-smpdata.$(ARCH).o \ 94 95 $(ASRC)/getstar-ps1-dev-0.$(ARCH).o \ … … 197 198 $(AINC)/cmf-ps1-sv2.h \ 198 199 $(AINC)/cmf-ps1-dv4.h \ 200 $(AINC)/cmf-ps1-dv5.h \ 199 201 $(AINC)/cmf-smpdata.h \ 200 202 $(AINC)/getstar-ps1-dev-0.h \
Note:
See TracChangeset
for help on using the changeset viewer.
