last day (15 days later) » 

14:51
0
Q: How do I calculate sunlight from GPS coordinate and Date/Time?

GoldnameWhat's the formula I can use to get the amount of sunlight in a location given its GPS coordinates, the date, and time?

What do you mean by "amount of sunlight"? Do you mean the total irradiance? And do you want to account for the atmosphere? If so, your answer because much more complicated and prone to much more uncertainty.
@zephyr No, the total amount of sunlight received on the ground. I'm not sure what the units are for this. I suppose it's irradiance.
You didn't really answer any of my questions. I can tell you that the solar constant is $1360\:\mathrm{W/m^2}$. If the sun is at an angle, you decrease it by the $cos$ of the angle the Sun is from the zenith. The main difficulty will be determining how it decreases as it travels through the atmosphere, which will be angle dependent and proportional to the $sec$ of the angle the Sun is from the zenith (to first order). This is not a simple problem with a simple equation and you should provide more information if someone is to help.
@zephyr Ignoring the atmosphere, wouldn't there be an equation describing this?
Not an easy one. At the very least, you'd need some sort of ephemeris package to calculate the precise location and orientation of the Sun with respect to the Earth at any given date/time.
14:51
@zephyr Ok, I confirmed illuminance is the right thing that I want. Any idea on how I would get started on calculating the illuminance?
@zephyr I'm thinking I'd use your ephemeris package to calculate the location of the sun given a specific date/time, but then to calculate the illuminance given an arbitrary location that the sun is at (with respect to Earth) and at an arbitrary location on Earth, I am lost on how I would approach it.
Well, you can calculate the solar irradiance in the absence of an atmosphere and for a given, localized point on the Earth via $\frac{L}{4\pi d^2}\cos(\theta)$, where $L$ is the Sun's luminosity, $d$ is the distance between the Earth and Sun at the given time, and $\theta$ is the angle of the Sun from the zenith. You can get $d$ and $\theta$ from the ephemeris package with a little bit of work.
And I just realized math doesn't render in here so the equation, more readable, is (L/(4*pi*d^2)) * cos(theta).
Of course, if you're looking for accuracy you may be out of luck since L varies significantly (by several percents) over a variety of timescales (e.g., solar minimum vs solar maximum).
Would the results be noticeable different with the variations of L? As long as it's not noticeable, I think it may be fine
Ok, so theta changes with the hours in a day, and also the months/seasons right? d changes with just the date/seasons
Depends on what you count as noticeable. From wikipedia: "rhe actual direct solar irradiance at the top of the atmosphere fluctuates by about 6.9% during a year". If you want this calculated to better than about 10% you're going to find that hard because the natural variability of the Sun over time is unpredictable.
And yes, theta will change with seasons, months, years, days, hours, and even by the second.
And by noticeable, I mean someone outside viewing the sunlight, for example if I calculate outside right now some lux value, an average person wouldn't notice much of a difference
ok great
What's the L/(4*pi*d^2)) * cos(theta) formula called?
I doubt the human eye could notice a 10% difference. Keep in mind, I'm also talking about ALL radiation (UV, radio, gamma ray, infrared, etc) not just visible. And I don't think there's necessarily a name for that formula. It's just an inverse square law for luminosity fall off that accounts for the angle of incidence (theta)
And all of this says nothing about the atmosphere. Once you throw that in, things get way more uncertain. You have to account for reflection of some small percentage of light into space and refraction of a good amount of the rest, depending on theta.

  last day (15 days later) »