Changeset 17060 for trunk/FACT++/src
- Timestamp:
- 08/30/13 14:21:43 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r17029 r17060 1711 1711 out << d.GetJavaDate() << '\n'; 1712 1712 out << HTML::kWhite << '\t' << fFscControlHumidityAvg << '\n'; 1713 out << HTML::kWhite << '\t' << min << '\n';1714 out << HTML::kWhite << '\t' << avg << '\n';1715 out << HTML::kWhite << '\t' << max << '\n';1716 1713 out << HTML::kWhite << '\t' << stat.min << '\n'; 1717 1714 out << HTML::kWhite << '\t' << stat.avg << '\n'; … … 1722 1719 WriteHist(d, "hist-fsccontrol-temperature", 1723 1720 fFscControlTemperatureHist, 10); 1721 1722 out.str(""); 1723 out << setprecision(3); 1724 out << d.GetJavaDate() << '\n'; 1725 out << HTML::kWhite << '\t' << max << '\n'; 1726 out << HTML::kWhite << '\t' << avg << '\n'; 1727 out << HTML::kWhite << '\t' << min << '\n'; 1728 1729 ofstream(fPath+"/camtemp.data") << out.str(); 1730 1731 // ======================================================= 1732 1733 struct weight 1734 { 1735 int idx; 1736 int i[3]; 1737 double w[3]; 1738 }; 1739 1740 static vector<weight> fWeights; 1741 if (fWeights.empty()) 1742 { 1743 ifstream fin("temp-interpolator.txt"); 1744 int cnt = 0; 1745 while (1) 1746 { 1747 weight w; 1748 fin >> w.idx; 1749 fin >> w.i[0]; 1750 fin >> w.i[1]; 1751 fin >> w.i[2]; 1752 fin >> w.w[0]; 1753 fin >> w.w[1]; 1754 fin >> w.w[2]; 1755 if (!fin) 1756 break; 1757 1758 if (w.idx != cnt++) 1759 { 1760 Fatal("Reading interpolator failed ("+to_string(w.idx)+"|"+to_string(cnt)+")"); 1761 fWeights.clear(); 1762 break; 1763 } 1764 1765 fWeights.emplace_back(w); 1766 } 1767 1768 if (fWeights.size() && fWeights.size() != 160) 1769 { 1770 Fatal("Reading interpolator failed ("+to_string(fWeights.size())+")"); 1771 fWeights.clear(); 1772 } 1773 } 1774 1775 if (fWeights.size()==160) 1776 { 1777 vector<float> temp(160); 1778 vector<float> cpy(ptr, ptr+31); 1779 1780 cpy[8] = (cpy[4] +cpy[6] +cpy[7] +cpy[10]+cpy[11])/5; 1781 cpy[19] = (cpy[7] +cpy[11]+cpy[16]+cpy[17]+cpy[21])/5; 1782 cpy[15] = (cpy[14]+cpy[16]+cpy[18])/3; 1783 1784 double pavg = 0; 1785 for (int i=0; i<160; i++) 1786 { 1787 const double T = 1788 fWeights[i].w[0]*cpy[fWeights[i].i[0]]+ 1789 fWeights[i].w[1]*cpy[fWeights[i].i[1]]+ 1790 fWeights[i].w[2]*cpy[fWeights[i].i[2]]; 1791 1792 temp[i] = T; 1793 pavg += T; 1794 } 1795 1796 WriteCam(d, "cam-fsccontrol-temperature", temp, 3, pavg/160-1.5); 1797 } 1724 1798 1725 1799 return GetCurrentState();
Note:
See TracChangeset
for help on using the changeset viewer.