Hello Aldebaran,
Regarding the time, from what I read in the documentation of Universal-time of Astro::Coord::ECI, it should be seconds since the Linux (lololol) Unix Epoch in UTC (Coordinated Universal Time) time zone. Which is what you get from a DateTime's epoch() method. So, I think this is correct:
my $sta = Astro::Coord::ECI-> universal ($start_time_dateobj->epoch())-> geodetic ($lat, $long, $alt);
In general, if you ever need to convert between time zones, here is some extra information. The startTime you get from the api.weather.gov already contains a timezone. I remember output like 2020-04-26T06:00:00-05:00. Interesting question is what place's that time zone (-05:00) is: the enquiring coordinates or the enquirer's computer location (unlikely). You can deduce that by running a couple of tests for far away locations.
A quick refresher on timezones from wikipedia tells us:
Negative UTC offsets describe a time zone west of UTC±00:00, where the civil time is behind (or earlier) than UTC so the zone designator will look like "−03:00","−0300", or "−03".
Positive UTC offsets describe a time zone east of UTC±00:00, where the civil time is ahead (or later) than UTC so the zone designator will look like "+02:00","+0200", or "+02".
Examples
"−05:00" for New York on standard time (UTC-05:00)
"−04:00" for New York on daylight saving time (UTC-04:00)
"+00:00" (but not "-00:00") for London (UTC±00:00)
"+02:00" for Cairo (UTC+02:00)
"+05:30" for Mumbai (UTC+05:30)
"+14:00" for Kiribati (UTC+14:00)
If you must set a new timezone for a DateTime object: e.g. UTC (universal time; I have just learned that its name was born out of perfect delicate diplomatic balance) (equivalent to GMT for the layman). You can do it like this: my $UTCdateobj = $start_time_dateobj->set_time_zone('UTC');
Given sun's relative position, the incoming solar energy per unit area can then be calculated, e.g. https://www.grc.nasa.gov/www/k-12/Numbers/Math/Mathematical_Thinking/sun12.htm
btw, your link to Astro::Coord::ECI::Sun should be formatted as [mod://Astro::Coord::ECI::Sun] and not as [Astro::Coord::ECI::Sun].
bw, bliako
In reply to Re: getting Sun info with Astro::Coord::ECI::Sun
by bliako
in thread getting Sun info with Astro::Coord::ECI::Sun
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |