473,471 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Anyone good at astronomy?

I've put some code together to calculate sun rise/set, moon rise/set, and
moon phase and illumination. Everything is right on the money except for the
moon rise/set. I can't seem to find where I'm going wrong. If you think you
can help, I'll post the code here. I'd really appreciate the extra set of
eyes!

TIA
Nov 9 '08 #1
6 2777
On Nov 9, 3:30*am, "Jessica Griego" <j...@example.comwrote:
I've put some code together to calculate sun rise/set, moon rise/set, and
moon phase and illumination. Everything is right on the money except for the
moon rise/set. I can't seem to find where I'm going wrong. If you think you
can help, I'll post the code here. I'd really appreciate the extra set of
eyes!

TIA
I think php 5 has some new functions for that, check the date time
functions at php.net. That way you don't have to calculate it yourself
Nov 9 '08 #2

"Yorian" <yo************@hotmail.comwrote in message
news:7a**********************************@i20g2000 prf.googlegroups.com...
On Nov 9, 3:30 am, "Jessica Griego" <j...@example.comwrote:
I've put some code together to calculate sun rise/set, moon rise/set, and
moon phase and illumination. Everything is right on the money except for
the
moon rise/set. I can't seem to find where I'm going wrong. If you think
you
can help, I'll post the code here. I'd really appreciate the extra set of
eyes!

TIA
I think php 5 has some new functions for that, check the date time
functions at php.net. That way you don't have to calculate it yourself

In php 5 there is a sun rise/set function, but it doesn't work as far as I
can tell. Also, there are no functions for moon information...like rise/set,
phase, and illumination. The core of what I have should be able to work for
any celestial body...and is what I use to calculate the sun and moon. The
only problem is that the moon rise seems to be off by about 20 minutes and
the moon set seems to be off by about 30 to 45 minutes.

Nov 9 '08 #3
Jessica Griego said the following on 09/11/2008 18:51:
In php 5 there is a sun rise/set function, but it doesn't work as far as I
can tell. Also, there are no functions for moon information...like rise/set,
phase, and illumination. The core of what I have should be able to work for
any celestial body...and is what I use to calculate the sun and moon. The
only problem is that the moon rise seems to be off by about 20 minutes and
the moon set seems to be off by about 30 to 45 minutes.
Ask the US Navy, they might have something that you can-rejig to fit?

http://aa.usno.navy.mil/software/novas/novas_info.php
Nov 9 '08 #4

"Richard Brooks" <ri***********@vickers-armstrongs.comwrote in message
news:S4******************************@bt.com...
Jessica Griego said the following on 09/11/2008 18:51:
>In php 5 there is a sun rise/set function, but it doesn't work as far as
I can tell. Also, there are no functions for moon information...like
rise/set, phase, and illumination. The core of what I have should be able
to work for any celestial body...and is what I use to calculate the sun
and moon. The only problem is that the moon rise seems to be off by about
20 minutes and the moon set seems to be off by about 30 to 45 minutes.

Ask the US Navy, they might have something that you can-rejig to fit?

http://aa.usno.navy.mil/software/novas/novas_info.php
Well, I've been to that sight many times. It's actually where I've gotten
most of the formulas. They have a data entry form that actually gives you
the results. I could just parse that, but I'd like to have the tools at my
disposal. Anyway, like I said, everything I have matches the USNO data
perfectly...just not the moon rise/set.

Thanks for the suggestion though!
Nov 9 '08 #5
>In php 5 there is a sun rise/set function, but it doesn't work as far as I
>can tell. Also, there are no functions for moon information...like rise/set,
phase, and illumination. The core of what I have should be able to work for
any celestial body...and is what I use to calculate the sun and moon. The
only problem is that the moon rise seems to be off by about 20 minutes and
the moon set seems to be off by about 30 to 45 minutes.
It matters where you are east/west within a time zone. Does your formula
take that into account?

It probably also matters whether you're talking about the top of
the moon or the bottom of the moon or the center of the moon at the
horizon. Oh, yes, local hills and mountains may mess up your
observations.

Nov 9 '08 #6

"Gordon Burditt" <go***********@burditt.orgwrote in message
news:Dr******************************@posted.inter netamerica...
In php 5 there is a sun rise/set function, but it doesn't work as far as
I
can tell. Also, there are no functions for moon information...like
rise/set,
phase, and illumination. The core of what I have should be able to work
for
any celestial body...and is what I use to calculate the sun and moon. The
only problem is that the moon rise seems to be off by about 20 minutes and
the moon set seems to be off by about 30 to 45 minutes.

It matters where you are east/west within a time zone. Does your formula
take that into account?

It probably also matters whether you're talking about the top of
the moon or the bottom of the moon or the center of the moon at the
horizon. Oh, yes, local hills and mountains may mess up your
observations.
Yes, I account not only for time zones but for refraction as well.
Calculations are geocentric and I use the effective, civil, and astronomic
azthmus' in providing different sun rise/sets. The moon is being calculated
the same way except there is only one calculation for rise/set, and that's
based on an 8 arcminute point...the classical definition - sin(RADIANS * 8 /
60)

Would you be able to review the code if I posted it here? There isn't that
much to it really...I just can't seem to be able to catch the problem.
Originally, I thought php had something to do with it in that it wasn't
carrying the floating precision far enough...but, that's just not the case
after further investigation.

I'd appreciate any help you could provide, Gordon.
Nov 10 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Harag | last post by:
Hi all Classic ASP, Textpad Local "test" WebServer. IIS5 Well my MS script debugger isn't running and I can't findout why. I'm sick of it failing on me so was looking for an alternative. I...
11
by: Angel Todorov | last post by:
Hello, sometimes I get a strange error from postgresql when I try to connect using ssl to the server: LOG: parse_hba: invalid syntax in pg_hba.conf file at line 46, token "hostssl" FATAL: ...
1
by: Bruno van Dooren | last post by:
Hi, currently we have an intern writing an OPC server for us in C++. OPC is a hierarchy of classes based on DCOM. When the intern leaves I will have to maintain that server. since i am new to...
3
by: Mephistopheles | last post by:
>>"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message >>news >>:%23N6vQmpSFHA.3184@TK2MSFTNGP14.phx.gbl... >> Hi, >> I have a function already but I need to solve one...
6
by: Aaron Smith | last post by:
Has anyone used ComponentOne's Enterprise studio that comes in the VB.Net resource kit? I like some of the controls they have, but I've had a few wierd issues and I am wondering if that's a sign of...
2
by: No Spam | last post by:
Dear Access 2003 Users, I have been given an Excel 2003 spreadsheet with thousands of records, and I need to bring it into Access 2003. Does anyone know an Access formula that can convert these...
8
by: firewood | last post by:
I am developing a form-based website development system using PHP5, and I want to incorporate a secure, reliable, Wysiwyg textarea script in place of the standard, unformatable, text-only textarea...
6
by: theintrepidfox | last post by:
Dear Group I've installed MSSQL 2005 STD on Vista and now can't attach my databases. I've installed SQL SP2 and the SQL Vista Beta Update. The error I'm getting is: Unable to open the...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
1
by: Angus | last post by:
Hello I am a programmer (C++) and know a little JavaScript. I need to learn Ajax for a project and want to buy a good, readable book so I can read on the train etc to get me started. Can...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.