# FESSolarCalculator
Calculate sunrise, sunset, and twilight times for a given location and date.
## Goals
1. Given a location and a date provide:
* Sunrise date and time for that location
* Sunset date and time for that location
* Solar Noon date and time (when the sun is overhead)
* Dawn and Dusk (twilight) dates and times for that location:
* Civil
* Nautical
* Astronomical
2. Allow the user to disable some calculations (e.g., only calculate Official) when run.
## API
There is only one class: `FESSolarCalculator`
* pass in date and time to get back new object with `-initWithDate:location:`
* limit what calculations are done with `-initWithDate:location:mask:`
* see the `FESSolarCalculationType` enum for the types of calculations
* property readonly: NSDate startDate
* property readonly: CLLocation location
* property readonly: NSDate sunrise (Official)
* property readonly: NSDate sunset (Official)
* property readonly: NSDate solarNoon
* property readonly: NSDate civilDawn
* property readonly: NSDate civilDusk
* property readonly: NSDate nauticalDawn
* property readonly: NSDate nauticalDusk
* property readonly: NSDate astronomicalDawn
* property readonly: NSDate astronomicalDusk
Note: Properties will be nil if the calculations have not been run or if they were outside the calculation mask.
In addition there are two class methods that are provided as a utility:
* `+julianDayNumberFromDate:`
* `+dateFromJulianDayNumber:`
These are provided to convert to and from [Julian Day Numbers](http://en.wikipedia.org/wiki/Julian_day). Normally one would just use the '_g_' format option to `NSDateFormatter`, however in developing this a bug
was discovered that converts to and from the wrong hour on a given day. See [http://openradar.appspot.com/11023565](http://openradar.appspot.com/11023565) for details. These will be revisited or removed when or if that bug is resolved.
## Usage
See the examples in the source. It is recommended that your start date is at noon, but it can be any time on a given day.
## Issues
There one known issue:
* [Need to handle the sun never rising or setting for a given location](https://github.com/danimal/FESSolarCalculator/issues/2)
Check the [issues page for the project](https://github.com/danimal/FESSolarCalculator/issues) for the latest status.
## Precision
The precision is likely around three minutes, mostly due to approximation. Also, this calculation does not take into account the effect of air temperature, altitude, etc. Together, these may affect the time by 5 minutes or more. This is likely not what you need if you are in need of a very precise solar calculation.
Note that dates prior to 01 January 2000 GMT are not guarenteed to return correct results at this time (if ever).
## Automatic Reference Counting (ARC)
The source code in this repository uses Automatic Reference Counting. No plans exist to support non-ARC code. If your project requires non-ARC code compile these files with -fobjc-arc. See the [clang docs](http://clang.llvm.org/docs/AutomaticReferenceCounting.html) for more details.
## License
This code is licensed under the MIT license. The license is reproduced below.
If a non-attribution license is required contact Daniel Weeks for details:
Copyright © 2012 Daniel Weeks.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
没有合适的资源?快使用搜索试试~ 我知道了~
iOS游戏应用源代码——danimal-FESSolarCalculator-ec3d97a.zip
共38个文件
m:8个
h:6个
plist:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 34 浏览量
2023-07-02
16:45:03
上传
评论
收藏 63KB ZIP 举报
温馨提示
iOS游戏应用源代码——danimal-FESSolarCalculator-ec3d97a.zip
资源推荐
资源详情
资源评论
收起资源包目录
iOS游戏应用源代码——danimal-FESSolarCalculator-ec3d97a.zip (38个子文件)
danimal-FESSolarCalculator-ec3d97a
Source
FESSolarCalculator.m 12KB
FESSolarCalculator.h 3KB
SolarCalculatorExample
SolarCalculatorExample.xcodeproj
xcshareddata
xcschemes
MacOS_Example.xcscheme 3KB
iOS_Example.xcscheme 4KB
project.pbxproj 37KB
xcuserdata
dan.xcuserdatad
xcdebugger
Breakpoints.xcbkptlist 91B
xcschemes
xcschememanagement.plist 790B
project.xcworkspace
contents.xcworkspacedata 167B
MacOS_Example
MacOS_Example-Prefix.pch 157B
AppDelegate.h 1KB
AppDelegate.m 3KB
main.m 261B
MacOS_Example-Info.plist 1KB
en.lproj
MainMenu.xib 251KB
Credits.rtf 436B
InfoPlist.strings 45B
SolarCalculatorTests
SolarCalculatorTests-Info.plist 691B
SolarCalculatorTests.h 1KB
SolarCalculatorTests.m 23KB
SolarCalculatorTests-Prefix.pch 0B
en.lproj
InfoPlist.strings 45B
OSX_Tests
OSX_Tests.m 432B
OSX_Tests-Prefix.pch 149B
OSX_Tests.h 225B
OSX_Tests-Info.plist 691B
en.lproj
InfoPlist.strings 45B
iOS_Example
ViewController.h 2KB
AppDelegate.h 1KB
AppDelegate.m 3KB
main.m 1KB
iOS_Example-Prefix.pch 1KB
iOS_Example-Info.plist 2KB
ViewController.m 4KB
en.lproj
MainStoryboard_iPad.storyboard 2KB
InfoPlist.strings 45B
MainStoryboard_iPhone.storyboard 21KB
.gitignore 12B
README.md 4KB
共 38 条
- 1
资源评论
快乐无限出发
- 粉丝: 1139
- 资源: 7289
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功