Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here is the json-like list: \n 29. 'Solar Elevation corrected for atm refraction (deg)'
- Depends on: {
- 27. 'Solar Elevation Angle (deg)'
- Depends on: {
- 26. 'Solar Zenith Angle (deg)'
- Depends on: {
- $B$3
- 16. 'Sun Declin (deg)'
- Depends on: {
- 14. 'Obliq Corr (deg)'
- Depends on: {
- 13. 'Mean Obliq Ecliptic (deg)'
- Depends on: {
- 4.'Julian Century'
- Depends on:
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- }
- 25. 'Hour Angle (deg)'
- Depends on: {
- 24. 'True Solar Time (min)'
- Depends on: {
- 2. Time (past local midnight)
- $B$4
- $B$5
- 18. 'Eq of Time (minutes)'
- Depends on: {
- 17. 'var y'
- Depends on: {
- 14. 'Obliq Corr (deg)'
- Depends on: {
- 13. 'Mean Obliq Ecliptic (deg)'
- Depends on: {
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- }
- 5.'Geom Mean Long Sun (deg)'
- Depends on: {
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- 7.'Eccent Earth Orbit'
- Depends on: {
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- }
- 6.'Geom Mean Anom Sun (deg)'
- Depends on: {
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- }
- }
- }
- }
- }
- 28. 'Approx Atmospheric Refraction (deg)'
- Depends on: {
- 27. 'Solar Elevation Angle (deg)'
- Depends on: {
- 26. 'Solar Zenith Angle (deg)'
- Depends on: {
- $B$3
- 16. 'Sun Declin (deg)'
- Depends on: {
- 14. 'Obliq Corr (deg)'
- Depends on: {
- 13. 'Mean Obliq Ecliptic (deg)'
- Depends on: {
- 4.'Julian Century'
- Depends on:
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- }
- 25. 'Hour Angle (deg)'
- Depends on: {
- 24. 'True Solar Time (min)'
- Depends on: {
- 2. Time (past local midnight)
- $B$4
- $B$5
- 18. 'Eq of Time (minutes)'
- Depends on: {
- 17. 'var y'
- Depends on: {
- 14. 'Obliq Corr (deg)'
- Depends on: {
- 13. 'Mean Obliq Ecliptic (deg)'
- Depends on: {
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- }
- 5.'Geom Mean Long Sun (deg)'
- Depends on: {
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- 7.'Eccent Earth Orbit'
- Depends on: {
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- 6.'Geom Mean Anom Sun (deg)'
- Depends on: {
- 4.'Julian Century'
- Depends on: {
- 3. 'Julian Day'
- Depends on: {
- 1. Date
- 2. Time (past local midnight)
- $B$5 = Time Zone
- }
- }
- }
- }
- }
- }
- }
- }
- }
- } \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
- The Spreadsheet's Inputs
- The following are the original input cells on the NOAA spreadsheet
- $B$3 = Latitude (+ to N) eg. 52.4
- $B$4 = Longitude (+ to E) eg. -0.72
- $B$5 = Time Zone (+ to E) eg. 0 for GMT
- Note: This is the number of hours offset for the time zone in question. eg. 2 hours offset or -3 hours offset, etc.
- $B$7 = Date. eg. '23/05/2023'
- 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.
- 1. Date
- 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.
- Cell: D2
- References $B$7
- 2. Time (past local midnight)
- 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.
- Cell: E2
- Time = [user input with an adjustment if the leading digit = 0]
- 3. 'Julian Day'
- Description: Provides the Julian Day, a continuous count of days from the beginning of the Julian Period.
- Cell: F2
- Original Formula: '=D2+2415018.5+E2-$B$5/24'
- Generalised calculation format: Julian_Day = Date + 2415018.5 + Time - (Time_Zone_Hour_Offset/24)
- 4.'Julian Century'
- Description: Represents the time passed since J2000.0 epoch, expressed in Julian centuries (periods of 36525 days).
- Cell: G2
- Original Formula: '=(F2-2451545)/36525'
- Generalised calculation format: Julian_Century = (Julian_Day - 2451545)/36525
- 5.'Geom Mean Long Sun (deg)'
- Description: Represents the geometric mean longitude of the Sun, in degrees.
- Cell: I2
- Original Formula: '=MOD(280.46646+G2*(36000.76983 + G2*0.0003032),360)'
- Generalised calculation format: Geom_Mean_Long_Sun_deg = MOD(280.46646 + Julian_Century * ( 36000.76983 + Julian_Century * 0.0003032),360)
- 6.'Geom Mean Anom Sun (deg)'
- Description: Provides the geometric mean anomaly of the Sun, expressed in degrees.
- Cell: J2
- Original Formula: '=357.52911+G2*(35999.05029 - 0.0001537*G2)'
- Generalised calculation format: Geom_Mean_Anom_Sun_deg = 357.52911 + Julian_Century * (35999.05029 - 0.0001537 * Julian_Century)
- 7.'Eccent Earth Orbit'
- Description: Represents the eccentricity of Earth's orbit.
- Cell: K2
- Original Formula: '=0.016708634-G2*(0.000042037+0.0000001267*G2)'
- Generalised calculation format: Eccent_Earth_Orbit = 0.016708634 - Julian_Century * (0.000042037 + 0.0000001267 * Julian_Century)
- 8. 'Sun Eq of Ctr'
- 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.
- Cell: L2
- 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'
- 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
- 9. 'Sun True Long (deg)'
- Description: Provides the Sun's true longitude in degrees, which is the Sun's apparent geocentric ecliptic longitude corrected for aberration and nutation.
- Cell: M2
- Original Formula: '=I2+L2'
- Generalised calculation format: Sun_True_Long_deg = Geom_Mean_Long_Sun_deg + Sun_Eq_of_Ctr
- 10. 'Sun True Anom (deg)'
- 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.
- Cell: N2
- Original Formula: '=J2+L2'
- Generalised calculation format: Sun_True_Anom_deg = Geom_Mean_Anom_Sun_deg + Sun_Eq_of_Ctr
- 11. 'Sun Rad Vector (AUs)'
- Description: Gives the distance from the Earth to the Sun in astronomical units (AU).
- Cell: O2
- Original Formula: '=(1.000001018*(1-K2*K2))/(1+K2*COS(RADIANS(N2)))'
- 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)))
- 12. 'Sun App Long (deg)'
- Description: Provides the apparent geocentric longitude of the Sun, corrected for aberration and nutation, in degrees.
- Cell: P2
- Original Formula: '=M2-0.00569-0.00478*SIN(RADIANS(125.04-1934.136*G2))'
- Generalised calculation format: Sun_App_Long_deg = Sun_True_Long_deg - 0.00569 - 0.00478 * SIN(RADIANS(125.04 - 1934.136 * Julian_Century))
- 13. 'Mean Obliq Ecliptic (deg)'
- Description: Represents the mean obliquity (tilt) of Earth's axis, in degrees.
- Cell: Q2
- Original Formula: '=23+(26+((21.448-G2*(46.815+G2*(0.00059-G2*0.001813))))/60)/60'
- 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
- 14. 'Obliq Corr (deg)'
- Description: The corrected obliquity, which is the obliquity adjusted for nutation, in degrees.
- Cell: R2
- Original Formula: '=Q2+0.00256*COS(RADIANS(125.04-1934.136*G2))'
- Generalised calculation format: Obliq_Corr_deg = Mean_Obliq_Ecliptic_deg + 0.00256 * COS(RADIANS(125.04 - 1934.136 * Julian_Century))
- 15. 'Sun Rt Ascen (deg)'
- Description: The right ascension of the Sun, which is the Sun's position along the celestial equator, in degrees.
- Cell: S2
- Original Formula: '=DEGREES(ATAN2(COS(RADIANS(P2)),COS(RADIANS(R2))*SIN(RADIANS(P2))))'
- 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))))
- 16. 'Sun Declin (deg)'
- Description: The Sun's declination, which is its position in the sky relative to the celestial equator, in degrees.
- Cell: T2
- Original Formula: '=DEGREES(ASIN(SIN(RADIANS(R2))*SIN(RADIANS(P2))))'
- Generalised calculation format: Sun_Declin_deg = DEGREES(ASIN(SIN(RADIANS(Obliq_Corr_deg)) * SIN(RADIANS(Sun_App_Long_deg))))
- 17. 'var y'
- Description: Auxiliary variable used in calculation of the equation of time.
- Cell: U2
- Original Formula: '=TAN(RADIANS(R2]/2))*TAN(RADIANS(R2/2)'
- Generalised calculation format: var_y = TAN(RADIANS(Obliq_Corr_deg/2)) * TAN(RADIANS(Obliq_Corr_deg/2))
- 18. 'Eq of Time (minutes)'
- Description: The equation of time, which is the difference between apparent solar time and mean solar time.
- Cell V2
- 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)))'
- 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)))
- 19. 'HA Sunrise (deg)'
- Description: The hour angle at sunrise, which is the solar hour angle when the sun is at the horizon, in degrees.
- Cell: W2
- Original Formula: '=DEGREES(ACOS(COS(RADIANS(90.833))/(COS(RADIANS($B$3))*COS(RADIANS(T2)))-TAN(RADIANS($B$3))*TAN(RADIANS(T2))))'
- 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)))
- 20. 'Solar Noon (LST)'
- Description: Local solar noon, which is the time when the Sun is at its highest point in the sky.
- Cell: X2
- Original formula: '=(720-4*$B$4-V2+$B$5*60)/1440'
- Generalised calculation format: Solar_Noon_LST = 720 - 4 * Longitude - Eq_of_Time_minutes * 60 /1440
- 21. 'Sunrise Time (LST)'
- Description: Local time of sunrise.
- Cell: Y2
- Original formula: '=X2-W2*4/1440'
- Generalised calculation format: Sunrise_Time_LST = MOD(Solar_Noon_LST - HA_Sunrise_deg * 4, 1440)
- 22. 'Sunset Time (LST)'
- Description: Local time of sunset.
- Cell: Z2
- Original formula: '=X2+W2*4/1440'
- Generalised calculation format: Solar_Noon_LST + HA_Sunrise_deg * 4 / 1440
- 23. 'Sunlight Duration (minutes)'
- Description: The amount of daylight, from sunrise to sunset, in minutes.
- Cell: AA2
- Original formula: '=8*W2'
- Generalised calculation format: Sunlight_Duration_minutes = 8 * HA_Sunrise_deg
- 24. 'True Solar Time (min)'
- Description: The actual solar time, based on the apparent motion of the Sun in the sky.
- Cell: AB2
- Original formula: '=MOD(E2*1440+V2+4*$B$4-60*$B$5,1440)'
- Generalised calculation format: True_Solar_Time_min = MOD(Time * 1440 + Eq_of_Time_minutes + 4 * Longitude - 60 * Time_Zone, 1440)
- 25. 'Hour Angle (deg)'
- Description: The solar hour angle, in degrees.
- Cell: AC2
- Original formula: '=IF(AB2/4<0,AB2/4+180,AB2/4-180)'
- Generalised calculation format:
- IF
- True_Solar_Time_min/4 < 0
- THEN
- Hour_Angle_deg = True_Solar_Time_min/4 + 180
- ELSE
- Hour_Angle_deg = True_Solar_Time_min/4 - 180
- 26. 'Solar Zenith Angle (deg)'
- Description: The angle between the direction of the Sun and the zenith (directly overhead), in degrees.
- Cell: AD2
- Original formula: '=DEGREES(ACOS(SIN(RADIANS($B$3))*SIN(RADIANS(T2))+COS(RADIANS($B$3))*COS(RADIANS(T2))*COS(RADIANS(AC2))))'
- 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 ))))
- 27. 'Solar Elevation Angle (deg)'
- Description: The angle of the Sun above the horizon, in degrees.
- Cell: AE2
- Original formula: '=90-AD2'
- Generalised calculation format: Solar_Elevation_Angle_deg = 90 - Solar_Zenith_Angle_deg
- 28. 'Approx Atmospheric Refraction (deg)'
- Description: The amount the atmosphere bends the incoming sunlight, in degrees.
- Cell: AF2
- 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'
- Generalised calculation format:
- IF
- Solar_Elevation_Angle_deg > 85
- THEN
- Approx_Atmospheric_Refraction_deg = 0
- ELSE
- IF
- Solar_Elevation_Angle_deg > 5
- THEN
- 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)
- ELSE
- IF
- AE2>-0.575
- THEN
- 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)))
- ELSE
- Approx_Atmospheric_Refraction_deg = -20.772 / TAN(RADIANS(Solar_Elevation_Angle_deg)))) / 3600
- ENDIF
- ENDIF
- ENDIF
- 29. 'Solar Elevation corrected for atm refraction (deg)'
- Description: The solar elevation angle corrected for atmospheric refraction, in degrees.
- Cell: AG2
- Original formula: '=AE2+AF2'
- Generalised calculation format: Solar_Elevation_corrected_for_atm_refraction_deg = Solar_Elevation_Angle_deg + Approx_Atmospheric_Refraction_deg
- 30. 'Solar Azimuth Angle (deg CW from N)'
- Description: The Sun's position in the sky as an angle, measured in degrees clockwise from North.
- Cell: AH2
- 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))'
- Generalised calculation format:
- IF
- AC2 > 0
- THEN
- X = DEGREES(ACOS(((SIN(RADIANS($B$3))*COS(RADIANS(AD2)))-SIN(RADIANS(T2)))/(COS(RADIANS($B$3))*SIN(RADIANS(AD2))))+180
- ELSE
- X = 360-DEGREES(ACOS(((SIN(RADIANS($B$3))*COS(RADIANS(AD2)))-SIN(RADIANS(T2)))/(COS(RADIANS($B$3))*SIN(RADIANS(AD2)))))
- ENDIF
- Solar_Azimuth_Angle_deg_CW_from_N = MOD(X,360)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement