Advertisement
Zarty

temp

May 29th, 2023
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.40 KB | None | 0 0
  1.  
  2. Here is the json-like list: \n 29. 'Solar Elevation corrected for atm refraction (deg)'
  3. Depends on: {
  4. 27. 'Solar Elevation Angle (deg)'
  5. Depends on: {
  6. 26. 'Solar Zenith Angle (deg)'
  7. Depends on: {
  8. $B$3
  9. 16. 'Sun Declin (deg)'
  10. Depends on: {
  11. 14. 'Obliq Corr (deg)'
  12. Depends on: {
  13. 13. 'Mean Obliq Ecliptic (deg)'
  14. Depends on: {
  15. 4.'Julian Century'
  16. Depends on:
  17. 3. 'Julian Day'
  18. Depends on: {
  19. 1. Date
  20. 2. Time (past local midnight)
  21. $B$5 = Time Zone
  22. }
  23. }
  24. 4.'Julian Century'
  25. Depends on: {
  26. 3. 'Julian Day'
  27. Depends on: {
  28. 1. Date
  29. 2. Time (past local midnight)
  30. $B$5 = Time Zone
  31. }
  32. }
  33. }
  34. }
  35. 25. 'Hour Angle (deg)'
  36. Depends on: {
  37. 24. 'True Solar Time (min)'
  38. Depends on: {
  39. 2. Time (past local midnight)
  40. $B$4
  41. $B$5
  42. 18. 'Eq of Time (minutes)'
  43. Depends on: {
  44. 17. 'var y'
  45. Depends on: {
  46. 14. 'Obliq Corr (deg)'
  47. Depends on: {
  48. 13. 'Mean Obliq Ecliptic (deg)'
  49. Depends on: {
  50. 4.'Julian Century'
  51. Depends on: {
  52. 3. 'Julian Day'
  53. Depends on: {
  54. 1. Date
  55. 2. Time (past local midnight)
  56. $B$5 = Time Zone
  57. }
  58. }
  59. }
  60. 4.'Julian Century'
  61. Depends on: {
  62. 3. 'Julian Day'
  63. Depends on: {
  64. 1. Date
  65. 2. Time (past local midnight)
  66. $B$5 = Time Zone
  67. }
  68. }
  69. }
  70. }
  71. 5.'Geom Mean Long Sun (deg)'
  72. Depends on: {
  73. 4.'Julian Century'
  74. Depends on: {
  75. 3. 'Julian Day'
  76. Depends on: {
  77. 1. Date
  78. 2. Time (past local midnight)
  79. $B$5 = Time Zone
  80. }
  81. }
  82. 7.'Eccent Earth Orbit'
  83. Depends on: {
  84. 4.'Julian Century'
  85. Depends on: {
  86. 3. 'Julian Day'
  87. Depends on: {
  88. 1. Date
  89. 2. Time (past local midnight)
  90. $B$5 = Time Zone
  91. }
  92. }
  93. }
  94. }
  95. 6.'Geom Mean Anom Sun (deg)'
  96. Depends on: {
  97. 4.'Julian Century'
  98. Depends on: {
  99. 3. 'Julian Day'
  100. Depends on: {
  101. 1. Date
  102. 2. Time (past local midnight)
  103. $B$5 = Time Zone
  104. }
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111. }
  112. 28. 'Approx Atmospheric Refraction (deg)'
  113. Depends on: {
  114. 27. 'Solar Elevation Angle (deg)'
  115. Depends on: {
  116. 26. 'Solar Zenith Angle (deg)'
  117. Depends on: {
  118. $B$3
  119. 16. 'Sun Declin (deg)'
  120. Depends on: {
  121. 14. 'Obliq Corr (deg)'
  122. Depends on: {
  123. 13. 'Mean Obliq Ecliptic (deg)'
  124. Depends on: {
  125. 4.'Julian Century'
  126. Depends on:
  127. 3. 'Julian Day'
  128. Depends on: {
  129. 1. Date
  130. 2. Time (past local midnight)
  131. $B$5 = Time Zone
  132. }
  133. }
  134. 4.'Julian Century'
  135. Depends on: {
  136. 3. 'Julian Day'
  137. Depends on: {
  138. 1. Date
  139. 2. Time (past local midnight)
  140. $B$5 = Time Zone
  141. }
  142. }
  143. }
  144. }
  145. 25. 'Hour Angle (deg)'
  146. Depends on: {
  147. 24. 'True Solar Time (min)'
  148. Depends on: {
  149. 2. Time (past local midnight)
  150. $B$4
  151. $B$5
  152. 18. 'Eq of Time (minutes)'
  153. Depends on: {
  154. 17. 'var y'
  155. Depends on: {
  156. 14. 'Obliq Corr (deg)'
  157. Depends on: {
  158. 13. 'Mean Obliq Ecliptic (deg)'
  159. Depends on: {
  160. 4.'Julian Century'
  161. Depends on: {
  162. 3. 'Julian Day'
  163. Depends on: {
  164. 1. Date
  165. 2. Time (past local midnight)
  166. $B$5 = Time Zone
  167. }
  168. }
  169. }
  170. 4.'Julian Century'
  171. Depends on: {
  172. 3. 'Julian Day'
  173. Depends on: {
  174. 1. Date
  175. 2. Time (past local midnight)
  176. $B$5 = Time Zone
  177. }
  178. }
  179. }
  180. }
  181. 5.'Geom Mean Long Sun (deg)'
  182. Depends on: {
  183. 4.'Julian Century'
  184. Depends on: {
  185. 3. 'Julian Day'
  186. Depends on: {
  187. 1. Date
  188. 2. Time (past local midnight)
  189. $B$5 = Time Zone
  190. }
  191. }
  192. }
  193. 7.'Eccent Earth Orbit'
  194. Depends on: {
  195. 4.'Julian Century'
  196. Depends on: {
  197. 3. 'Julian Day'
  198. Depends on: {
  199. 1. Date
  200. 2. Time (past local midnight)
  201. $B$5 = Time Zone
  202. }
  203. }
  204. }
  205. 6.'Geom Mean Anom Sun (deg)'
  206. Depends on: {
  207. 4.'Julian Century'
  208. Depends on: {
  209. 3. 'Julian Day'
  210. Depends on: {
  211. 1. Date
  212. 2. Time (past local midnight)
  213. $B$5 = Time Zone
  214. }
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. }
  222. }
  223. } \n here is the semi-structured source from which the above JSON-like list was created. Please verify the JSON-like list is correct in terms of dependencies with the source. \n
  224. The Spreadsheet's Inputs
  225. The following are the original input cells on the NOAA spreadsheet
  226. $B$3 = Latitude (+ to N) eg. 52.4
  227. $B$4 = Longitude (+ to E) eg. -0.72
  228. $B$5 = Time Zone (+ to E) eg. 0 for GMT
  229. Note: This is the number of hours offset for the time zone in question. eg. 2 hours offset or -3 hours offset, etc.
  230. $B$7 = Date. eg. '23/05/2023'
  231.  
  232. The following are the original calculation column cells on the NOAA spreadsheet. For the purposes of creating a mobile App that only works from one location, date and time, the strategy is to take the formula from one row (row 2) and convert these to more generalised programmatic form as part of an App development specification.
  233.  
  234. 1. Date
  235. Description: This is just repeated on every row in the original spreadsheet so is not required for the Mobile App because we will just reference the Data input field.
  236. Cell: D2
  237. References $B$7
  238.  
  239. 2. Time (past local midnight)
  240. Description: This is time past midnight. In the original NOAA spreadsheet, 6 minute intervals. eg. the First time after midnight is 0:06:00, second time is 0:12:00. It seems that we can use any time offset after midnight and it doesn't have to be in 6 minute intervals. In the context of the Mobile App, we will take a time provide in the Time input field, such as 00:30:00 and adjust the format to be inline with the spreadsheet to only have one leading zero. ie. 0:30:00. Other times such as 12:00:00 will not need adjustment.
  241. Cell: E2
  242. Time = [user input with an adjustment if the leading digit = 0]
  243.  
  244. 3. 'Julian Day'
  245. Description: Provides the Julian Day, a continuous count of days from the beginning of the Julian Period.
  246. Cell: F2
  247. Original Formula: '=D2+2415018.5+E2-$B$5/24'
  248. Generalised calculation format: Julian_Day = Date + 2415018.5 + Time - (Time_Zone_Hour_Offset/24)
  249.  
  250. 4.'Julian Century'
  251. Description: Represents the time passed since J2000.0 epoch, expressed in Julian centuries (periods of 36525 days).
  252. Cell: G2
  253. Original Formula: '=(F2-2451545)/36525'
  254. Generalised calculation format: Julian_Century = (Julian_Day - 2451545)/36525
  255.  
  256. 5.'Geom Mean Long Sun (deg)'
  257. Description: Represents the geometric mean longitude of the Sun, in degrees.
  258. Cell: I2
  259. Original Formula: '=MOD(280.46646+G2*(36000.76983 + G2*0.0003032),360)'
  260. Generalised calculation format: Geom_Mean_Long_Sun_deg = MOD(280.46646 + Julian_Century * ( 36000.76983 + Julian_Century * 0.0003032),360)
  261.  
  262. 6.'Geom Mean Anom Sun (deg)'
  263. Description: Provides the geometric mean anomaly of the Sun, expressed in degrees.
  264. Cell: J2
  265. Original Formula: '=357.52911+G2*(35999.05029 - 0.0001537*G2)'
  266. Generalised calculation format: Geom_Mean_Anom_Sun_deg = 357.52911 + Julian_Century * (35999.05029 - 0.0001537 * Julian_Century)
  267.  
  268. 7.'Eccent Earth Orbit'
  269. Description: Represents the eccentricity of Earth's orbit.
  270. Cell: K2
  271. Original Formula: '=0.016708634-G2*(0.000042037+0.0000001267*G2)'
  272. Generalised calculation format: Eccent_Earth_Orbit = 0.016708634 - Julian_Century * (0.000042037 + 0.0000001267 * Julian_Century)
  273.  
  274. 8. 'Sun Eq of Ctr'
  275. Description: Represents the equation of the center for the Sun, which is the difference between the actual position of the Sun and the position if the Sun moved at a uniform rate, in degrees.
  276. Cell: L2
  277. Original Formula: '=SIN(RADIANS(J2))*(1.914602-G2*(0.004817+0.000014*G2))+SIN(RADIANS(2*J2))*(0.019993-0.000101*G2)+SIN(RADIANS(3*J2))*0.000289'
  278. Generalised calculation format: Sun_Eq_of_Ctr = SIN(RADIANS(Geom_Mean_Anom_Sun_deg)) * (1.914602 - Julian_Century * (0.004817 + 0.000014 * Julian_Century)) + SIN(RADIANS(2 * Geom_Mean_Anom_Sun_deg)) * (0.019993 - 0.000101 * Julian_Century) + SIN(RADIANS(3 * Geom_Mean_Anom_Sun_deg)) * 0.000289
  279.  
  280. 9. 'Sun True Long (deg)'
  281. Description: Provides the Sun's true longitude in degrees, which is the Sun's apparent geocentric ecliptic longitude corrected for aberration and nutation.
  282. Cell: M2
  283. Original Formula: '=I2+L2'
  284. Generalised calculation format: Sun_True_Long_deg = Geom_Mean_Long_Sun_deg + Sun_Eq_of_Ctr
  285.  
  286. 10. 'Sun True Anom (deg)'
  287. Description: Represents the Sun's true anomaly, the angle between the direction of perihelion and the current position of the Sun, as seen from Earth, in degrees.
  288. Cell: N2
  289. Original Formula: '=J2+L2'
  290. Generalised calculation format: Sun_True_Anom_deg = Geom_Mean_Anom_Sun_deg + Sun_Eq_of_Ctr
  291.  
  292. 11. 'Sun Rad Vector (AUs)'
  293. Description: Gives the distance from the Earth to the Sun in astronomical units (AU).
  294. Cell: O2
  295. Original Formula: '=(1.000001018*(1-K2*K2))/(1+K2*COS(RADIANS(N2)))'
  296. Generalised calculation format: Sun_Rad_Vector_AUs = (1.000001018 * (1 - Eccent_Earth_Orbit * Eccent_Earth_Orbit)) / (1 + Eccent_Earth_Orbit * COS(RADIANS(Sun_True_Anom_deg)))
  297.  
  298. 12. 'Sun App Long (deg)'
  299. Description: Provides the apparent geocentric longitude of the Sun, corrected for aberration and nutation, in degrees.
  300. Cell: P2
  301. Original Formula: '=M2-0.00569-0.00478*SIN(RADIANS(125.04-1934.136*G2))'
  302. Generalised calculation format: Sun_App_Long_deg = Sun_True_Long_deg - 0.00569 - 0.00478 * SIN(RADIANS(125.04 - 1934.136 * Julian_Century))
  303.  
  304. 13. 'Mean Obliq Ecliptic (deg)'
  305. Description: Represents the mean obliquity (tilt) of Earth's axis, in degrees.
  306. Cell: Q2
  307. Original Formula: '=23+(26+((21.448-G2*(46.815+G2*(0.00059-G2*0.001813))))/60)/60'
  308. Generalised calculation format: Mean_Obliq_Ecliptic_deg = 23 + (26 + ((21.448 - Julian_Century *(46.815 + Julian_Century * (0.00059 - Julian_Century * 0.001813))))/60)/60
  309.  
  310. 14. 'Obliq Corr (deg)'
  311. Description: The corrected obliquity, which is the obliquity adjusted for nutation, in degrees.
  312. Cell: R2
  313. Original Formula: '=Q2+0.00256*COS(RADIANS(125.04-1934.136*G2))'
  314. Generalised calculation format: Obliq_Corr_deg = Mean_Obliq_Ecliptic_deg + 0.00256 * COS(RADIANS(125.04 - 1934.136 * Julian_Century))
  315.  
  316. 15. 'Sun Rt Ascen (deg)'
  317. Description: The right ascension of the Sun, which is the Sun's position along the celestial equator, in degrees.
  318. Cell: S2
  319. Original Formula: '=DEGREES(ATAN2(COS(RADIANS(P2)),COS(RADIANS(R2))*SIN(RADIANS(P2))))'
  320. Generalised calculation format: Sun_Rt_Ascen_deg = DEGREES(ATAN2(COS(RADIANS(Sun_App_Long_deg)),COS(RADIANS(Obliq_Corr_deg)) * SIN(RADIANS(Sun_App_Long_deg))))
  321.  
  322. 16. 'Sun Declin (deg)'
  323. Description: The Sun's declination, which is its position in the sky relative to the celestial equator, in degrees.
  324. Cell: T2
  325. Original Formula: '=DEGREES(ASIN(SIN(RADIANS(R2))*SIN(RADIANS(P2))))'
  326. Generalised calculation format: Sun_Declin_deg = DEGREES(ASIN(SIN(RADIANS(Obliq_Corr_deg)) * SIN(RADIANS(Sun_App_Long_deg))))
  327.  
  328. 17. 'var y'
  329. Description: Auxiliary variable used in calculation of the equation of time.
  330. Cell: U2
  331. Original Formula: '=TAN(RADIANS(R2]/2))*TAN(RADIANS(R2/2)'
  332. Generalised calculation format: var_y = TAN(RADIANS(Obliq_Corr_deg/2)) * TAN(RADIANS(Obliq_Corr_deg/2))
  333.  
  334. 18. 'Eq of Time (minutes)'
  335. Description: The equation of time, which is the difference between apparent solar time and mean solar time.
  336. Cell V2
  337. Original Formula: '=4 * DEGREES(U2 * SIN(2*RADIANS(I2))-2 * K2 * SIN(RADIANS(J2))+4 * K2 * U2 * SIN(RADIANS(J2)) * COS(2 * RADIANS(I2))-0.5 * U2 * U2 * SIN(4 * RADIANS(I2))-1.25 * K2 * K2 * SIN(2 * RADIANS(J2)))'
  338. Generalised calculation format: Eq_of_Time_minutes = 4 * DEGREES(var_y * SIN(2 * RADIANS(Geom_Mean_Long_Sun_deg)) - 2 * Eccent_Earth_Orbit * SIN(RADIANS(Geom_Mean_Anom_Sun_deg)) + 4 * Eccent_Earth_Orbit * U2 * SIN(RADIANS(Geom_Mean_Anom_Sun_deg)) * COS(2 * RADIANS(Geom_Mean_Long_Sun_deg)) - 0.5 * var_y * var_y * SIN(4 * RADIANS(Geom_Mean_Long_Sun_deg)) - 1.25 * Eccent_Earth_Orbit * Eccent_Earth_Orbit * SIN(2*RADIANS(Geom_Mean_Anom_Sun_deg)))
  339.  
  340. 19. 'HA Sunrise (deg)'
  341. Description: The hour angle at sunrise, which is the solar hour angle when the sun is at the horizon, in degrees.
  342. Cell: W2
  343. Original Formula: '=DEGREES(ACOS(COS(RADIANS(90.833))/(COS(RADIANS($B$3))*COS(RADIANS(T2)))-TAN(RADIANS($B$3))*TAN(RADIANS(T2))))'
  344. Generalised calculation format: HA_Sunrise_deg = DEGREES(ACOS(COS(RADIANS(90.833)) / (COS(RADIANS(Latitude)) * COS(RADIANS(Sun_Declin_deg))) - TAN(RADIANS(Latitude)) * TAN(RADIANS(Sun_Declin_deg)))
  345.  
  346. 20. 'Solar Noon (LST)'
  347. Description: Local solar noon, which is the time when the Sun is at its highest point in the sky.
  348. Cell: X2
  349. Original formula: '=(720-4*$B$4-V2+$B$5*60)/1440'
  350. Generalised calculation format: Solar_Noon_LST = 720 - 4 * Longitude - Eq_of_Time_minutes * 60 /1440
  351.  
  352. 21. 'Sunrise Time (LST)'
  353. Description: Local time of sunrise.
  354. Cell: Y2
  355. Original formula: '=X2-W2*4/1440'
  356. Generalised calculation format: Sunrise_Time_LST = MOD(Solar_Noon_LST - HA_Sunrise_deg * 4, 1440)
  357.  
  358. 22. 'Sunset Time (LST)'
  359. Description: Local time of sunset.
  360. Cell: Z2
  361. Original formula: '=X2+W2*4/1440'
  362. Generalised calculation format: Solar_Noon_LST + HA_Sunrise_deg * 4 / 1440
  363.  
  364. 23. 'Sunlight Duration (minutes)'
  365. Description: The amount of daylight, from sunrise to sunset, in minutes.
  366. Cell: AA2
  367. Original formula: '=8*W2'
  368. Generalised calculation format: Sunlight_Duration_minutes = 8 * HA_Sunrise_deg
  369.  
  370. 24. 'True Solar Time (min)'
  371. Description: The actual solar time, based on the apparent motion of the Sun in the sky.
  372. Cell: AB2
  373. Original formula: '=MOD(E2*1440+V2+4*$B$4-60*$B$5,1440)'
  374. Generalised calculation format: True_Solar_Time_min = MOD(Time * 1440 + Eq_of_Time_minutes + 4 * Longitude - 60 * Time_Zone, 1440)
  375.  
  376. 25. 'Hour Angle (deg)'
  377. Description: The solar hour angle, in degrees.
  378. Cell: AC2
  379. Original formula: '=IF(AB2/4<0,AB2/4+180,AB2/4-180)'
  380. Generalised calculation format:
  381. IF
  382. True_Solar_Time_min/4 < 0
  383. THEN
  384. Hour_Angle_deg = True_Solar_Time_min/4 + 180
  385. ELSE
  386. Hour_Angle_deg = True_Solar_Time_min/4 - 180
  387.  
  388. 26. 'Solar Zenith Angle (deg)'
  389. Description: The angle between the direction of the Sun and the zenith (directly overhead), in degrees.
  390. Cell: AD2
  391. Original formula: '=DEGREES(ACOS(SIN(RADIANS($B$3))*SIN(RADIANS(T2))+COS(RADIANS($B$3))*COS(RADIANS(T2))*COS(RADIANS(AC2))))'
  392. Generalised calculation format: Solar_Zenith_Angle_deg = DEGREES(ACOS(SIN(RADIANS(Latitude)) * SIN(RADIANS(Sun_Declin_deg)) + COS(RADIANS(Latitude)) * COS(RADIANS(Sun_Declin_deg)) * COS(RADIANS(Hour_Angle_deg ))))
  393.  
  394. 27. 'Solar Elevation Angle (deg)'
  395. Description: The angle of the Sun above the horizon, in degrees.
  396. Cell: AE2
  397. Original formula: '=90-AD2'
  398. Generalised calculation format: Solar_Elevation_Angle_deg = 90 - Solar_Zenith_Angle_deg
  399.  
  400. 28. 'Approx Atmospheric Refraction (deg)'
  401. Description: The amount the atmosphere bends the incoming sunlight, in degrees.
  402. Cell: AF2
  403. Original formula: '=IF(AE2>85,0,IF(AE2>5,58.1/TAN(RADIANS(AE2))-0.07/POWER(TAN(RADIANS(AE2)),3)+0.000086/POWER(TAN(RADIANS(AE2)),5),IF(AE2>-0.575,1735+AE2*(-518.2+AE2*(103.4+AE2*(-12.79+AE2*0.711))),-20.772/TAN(RADIANS(AE2)))))/3600'
  404. Generalised calculation format:
  405. IF
  406. Solar_Elevation_Angle_deg > 85
  407. THEN
  408. Approx_Atmospheric_Refraction_deg = 0
  409. ELSE
  410. IF
  411. Solar_Elevation_Angle_deg > 5
  412. THEN
  413. Approx_Atmospheric_Refraction_deg = 58.1 / TAN(RADIANS(Solar_Elevation_Angle_deg )) - 0.07 / POW(TAN(RADIANS(Solar_Elevation_Angle_deg)),3) + 0.000086/POW(TAN(RADIANS(Solar_Elevation_Angle_deg )),5)
  414. ELSE
  415. IF
  416. AE2>-0.575
  417. THEN
  418. Approx_Atmospheric_Refraction_deg = 1735 + Solar_Elevation_Angle_deg * (-518.2 + Solar_Elevation_Angle_deg * (103.4 + Solar_Elevation_Angle_deg * (-12.79 + Solar_Elevation_Angle_deg * 0.711)))
  419. ELSE
  420. Approx_Atmospheric_Refraction_deg = -20.772 / TAN(RADIANS(Solar_Elevation_Angle_deg)))) / 3600
  421. ENDIF
  422. ENDIF
  423. ENDIF
  424.  
  425. 29. 'Solar Elevation corrected for atm refraction (deg)'
  426. Description: The solar elevation angle corrected for atmospheric refraction, in degrees.
  427. Cell: AG2
  428. Original formula: '=AE2+AF2'
  429. Generalised calculation format: Solar_Elevation_corrected_for_atm_refraction_deg = Solar_Elevation_Angle_deg + Approx_Atmospheric_Refraction_deg
  430.  
  431. 30. 'Solar Azimuth Angle (deg CW from N)'
  432. Description: The Sun's position in the sky as an angle, measured in degrees clockwise from North.
  433. Cell: AH2
  434. Original formula: '=IF(AC2>0,MOD(DEGREES(ACOS(((SIN(RADIANS($B$3))*COS(RADIANS(AD2)))-SIN(RADIANS(T2)))/(COS(RADIANS($B$3))*SIN(RADIANS(AD2)))))+180,360),MOD(540-DEGREES(ACOS(((SIN(RADIANS($B$3))*COS(RADIANS(AD2)))-SIN(RADIANS(T2)))/(COS(RADIANS($B$3))*SIN(RADIANS(AD2))))),360))'
  435. Generalised calculation format:
  436. IF
  437. AC2 > 0
  438. THEN
  439. X = DEGREES(ACOS(((SIN(RADIANS($B$3))*COS(RADIANS(AD2)))-SIN(RADIANS(T2)))/(COS(RADIANS($B$3))*SIN(RADIANS(AD2))))+180
  440. ELSE
  441. X = 360-DEGREES(ACOS(((SIN(RADIANS($B$3))*COS(RADIANS(AD2)))-SIN(RADIANS(T2)))/(COS(RADIANS($B$3))*SIN(RADIANS(AD2)))))
  442. ENDIF
  443. Solar_Azimuth_Angle_deg_CW_from_N = MOD(X,360)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement