Changeset 17651
- Timestamp:
- 04/04/14 11:02:41 (11 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/makedata.cc
r17367 r17651 99 99 // ------------------ Precalc moon coord --------------------- 100 100 101 vector<pair<EquPosn, double>> fMoonCoords; 101 vector<tuple<EquPosn, double, double>> fMoonCoords; 102 vector<EquPosn> fSunCoords; 102 103 103 104 for (double h=0; h<1; h+=1./(24*12)) 104 105 { 106 const EquPosn sun = GetSolarEquCoords(jd+h); 105 107 const EquPosn moon = GetLunarEquCoords(jd+h, 0.01); 106 108 const double disk = GetLunarDisk(jd+h); 109 const double edist = GetLunarEarthDist(jd+h)/384400; 107 110 108 fMoonCoords.emplace_back(moon, disk); 111 fMoonCoords.emplace_back(moon, disk, edist); 112 fSunCoords.emplace_back(sun); 109 113 } 110 114 … … 136 140 const HrzPosn hrz = GetHrzFromEqu(pos, jd+h); 137 141 138 // Get moon properties and 139 const EquPosn moon = fMoonCoords[i].first; 140 const double disk = fMoonCoords[i].second; 141 const HrzPosn hrzm = GetHrzFromEqu(moon, jd+h); 142 // Get sun and moon properties and 143 const EquPosn sun = fSunCoords[i]; 144 const EquPosn moon = get<0>(fMoonCoords[i]); 145 const double disk = get<1>(fMoonCoords[i]); 146 const double edist = get<2>(fMoonCoords[i]); 147 const HrzPosn hrzm = GetHrzFromEqu(moon, jd+h); 148 const ZdAzPosn hrzs = GetHrzFromEqu(sun, jd+h); 142 149 143 // Angular distance between source and moon150 // Distance between source and moon 144 151 const double angle = GetAngularSeparation(moon, pos); 145 152 146 // Distance between earth and moon relative to major semi-axis 147 const double dist = GetLunarEarthDist(jd+h)/384400; 153 // Current prediction 154 const double sin_malt = hrzm.alt<0 ? 0 : sin(hrzm.alt*M_PI/180); 155 const double cos_mdist = cos(angle*M_PI/180); 156 const double sin_szd = sin(hrzs.zd*M_PI/180); 148 157 149 // Current prediction 150 const double calt = sin(hrzm.alt*M_PI/180); 151 const double cang = 1-sin(angle*M_PI/180); 158 const double k0 = pow(disk, 2.63); 159 const double k1 = pow(sin_malt, 0.60); 160 const double k2 = pow(edist, -2.00); 161 const double k3 = exp(0.67*cos_mdist*cos_mdist*cos_mdist*cos_mdist); 162 const double k4 = exp(-97.8+105.8*sin_szd*sin_szd); 152 163 153 //const double lc = cang==0 ? -1 : calt*pow(disk, 2.2)*pow(dist, -2); 154 //const double cur = lc>0 ? 4+103*lc : 4; 155 156 const double lc = sqrt(calt)*pow(disk, 2.3)*pow(cang+1, 1)*pow(dist, -2); 157 const double cur = lc>0 ? 7.2 + 69*lc : 7.2; 164 const double cur = 6.2 + 95.7*k0*k1*k2*k3 + k4; 158 165 159 166 // Relative energy threshold prediction -
trunk/FACT++/src/makeplots.cc
r17367 r17651 127 127 // ------------------ Precalc moon coord --------------------- 128 128 129 vector<pair<EquPosn, double>> fMoonCoords; 129 vector<tuple<EquPosn, double, double>> fMoonCoords; 130 vector<EquPosn> fSunCoords; 130 131 131 132 for (double h=0; h<1; h+=1./(24*12)) 132 133 { 134 const EquPosn sun = GetSolarEquCoords(jd+h); 133 135 const EquPosn moon = GetLunarEquCoords(jd+h, 0.01); 134 136 const double disk = GetLunarDisk(jd+h); 135 136 fMoonCoords.emplace_back(moon, disk); 137 const double edist = GetLunarEarthDist(jd+h)/384400; 138 139 fMoonCoords.emplace_back(moon, disk, edist); 140 fSunCoords.emplace_back(sun); 137 141 } 138 142 … … 140 144 141 145 const mysqlpp::StoreQueryResult res = 142 Database(fDatabase).query("SELECT fSourceName, fRightAscension, fDeclination FROM Source ").store();146 Database(fDatabase).query("SELECT fSourceName, fRightAscension, fDeclination FROM Source WHERE fSourceTypeKEY=1").store(); 143 147 144 148 // ------------- Create canvases and frames --------------------- … … 266 270 const HrzPosn hrz = GetHrzFromEqu(pos, jd+h); 267 271 268 // Get moon properties and 269 const EquPosn moon = fMoonCoords[i].first; 270 const double disk = fMoonCoords[i].second; 271 const HrzPosn hrzm = GetHrzFromEqu(moon, jd+h); 272 // Get sun and moon properties and 273 const EquPosn sun = fSunCoords[i]; 274 const EquPosn moon = get<0>(fMoonCoords[i]); 275 const double disk = get<1>(fMoonCoords[i]); 276 const double edist = get<2>(fMoonCoords[i]); 277 const HrzPosn hrzm = GetHrzFromEqu(moon, jd+h); 278 const ZdAzPosn hrzs = GetHrzFromEqu(sun, jd+h); 272 279 273 280 if (v==res.begin()) … … 277 284 const double angle = GetAngularSeparation(moon, pos); 278 285 279 // Distance between earth and moon relative to major semi-axis280 const double dist = GetLunarEarthDist(jd+h)/384400;281 282 286 // Current prediction 283 const double calt = sin(hrzm.alt*M_PI/180); 284 const double cang = 1-sin(angle*M_PI/180); 285 286 //const double lc = cang==0 ? -1 : calt*pow(disk, 2.2)*pow(dist, -2); 287 //const double cur = lc>0 ? 4+103*lc : 4; 288 289 const double lc = sqrt(calt)*pow(disk, 2.3)*pow(cang+1, 1)*pow(dist, -2); 290 const double cur = lc>0 ? 7.2 + 69*lc : 7.2; 287 const double sin_malt = hrzm.alt<0 ? 0 : sin(hrzm.alt*M_PI/180); 288 const double cos_mdist = cos(angle*M_PI/180); 289 const double sin_szd = sin(hrzs.zd*M_PI/180); 290 291 const double k0 = pow(disk, 2.63); 292 const double k1 = pow(sin_malt, 0.60); 293 const double k2 = pow(edist, -2.00); 294 const double k3 = exp(0.67*cos_mdist*cos_mdist*cos_mdist*cos_mdist); 295 const double k4 = exp(-97.8+105.8*sin_szd*sin_szd); 296 297 const double cur = 6.2 + 95.7*k0*k1*k2*k3 + k4; 291 298 292 299 // Relative energy threshold prediction
Note:
See TracChangeset
for help on using the changeset viewer.