Climate Library and Web Service

Requests for new functions or software apps

Posts: 137
Joined: Sat Feb 16, 2013 7:44 am
PostPosted: Fri Feb 22, 2013 3:18 pm
So would you be willing to pay for it? My problem is two fold... First hosting a web service, costs money. Second, I have yet to find a weather service that includes tide info for free. It would be kept low as possible, like say 10 bucks a year.
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Feb 22, 2013 4:12 pm
Honest answer... nope. It's just not that important to have another bill. I doubt there'd be enough to pay for any web hosting service. I'd rather come up with a function to simulate it and have it be fake then to start paying money for my fish tank to have legitimate tides :)

Posts: 137
Joined: Sat Feb 16, 2013 7:44 am
PostPosted: Fri Feb 22, 2013 4:45 pm
Fair enough... back to the calculation then :)
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Feb 22, 2013 5:35 pm
I did find some open source software (XTide) that does the calculations...unfortunately it requires harmonic files that are only available for the US. Apparently other countries have pulled this data from the public domain so the author does not maintain international data...
User avatar
Posts: 2746
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Sun Feb 24, 2013 6:26 pm
thekameleon wrote:I thought passing in variables by value was a bad practice as it forces a copy of object for that scope it is passed into. My problem was I had issues with passing by value... Since I saw your post, I just figured out what I did wrong and fixed it. However when I compile now my sketch size has gotten larger. So I think when you refer to memory, you are referring to the running process, correct?

By the way, in case you are wondering. I am using VisualMicro with Visual Studio 2012 for is debugging ability, like stepping through code.

Yes, passing variables in by value does copy the entire variable for the function to use. So it is bad practice to copy large variables (memory locations) around. It is better to pass a reference / pointer to them. However, I have noticed in the past that by doing that, arduino and the libraries get "messed up" at times (yes, I know, very technical wording). It would lose it's pointer and start referencing null memory.

Yes, with memory I'm referring to the RAM and the actual code compile size.
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Mar 01, 2013 2:38 pm
So, there are definitely free sites out there that have tidal information... I'm going to look at some data here for some info to build a faux schedule..

http://www.toptides.com/HI/2013/march/H ... awaii.html

I'll probably start a new thread to focus on a tidal program for setting wavemakers for those that are interested, but once that's set it could easily hook to realitime data if we had that functionality..

Random question, does anyone know why our MoonPhase() function peaks at 78%? I'm considering multiplying the value *1.28 to get full 0-100 dimming for my moonlights and for this option.

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Mar 01, 2013 5:11 pm
lnevo wrote:Random question, does anyone know why our MoonPhase() function peaks at 78%? I'm considering multiplying the value *1.28 to get full 0-100 dimming for my moonlights and for this option.

Bug :(
This is from the MoonPhase function:
Code: Select all
   PWMvalue = 4*abs(50-V);  // 5.12=100%    4=~80%

As you can see, multiplying by 4 gives a range of 0-80%....
Anyway, revisiting the function, I noticed some calculations that don't really need to be there.
The function should be this:
Code: Select all
byte MoonPhase()
{
   int m,d,y;
   int yy,mm;
   long K1,K2,K3,J,V;
   m = month();
   d = day();
   y = year();
   yy = y-((12-m)/10);
   mm = m+9;
   if (mm>=12) mm -= 12;
   K1 = 365.25*(yy+4712);
   K2 = 30.6*mm+.5;
   K3 = int(int((yy/100)+49)*.75)-38;
   J = K1+K2+d+58-K3;
   V = (J-2451550.1)/0.29530588853;
   V -= int(V/100)*100;
   V = abs(V-50);
   return (byte)(2*abs(50-V));
}

I'll update it in the next libraries patch... Thanks for finding it out :)

https://github.com/reefangel/Libraries/issues/63
Roberto.
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Mar 01, 2013 5:13 pm
So now that'll be 0-100%

How about MoonphaseLabel()? Will that match?

Thanks!!

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Mar 01, 2013 5:14 pm
The label has always been right all along. It uses different math at the end.
Roberto.
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Mar 01, 2013 5:15 pm
Cool.
PreviousNext

Return to Requests

Who is online

Users browsing this forum: No registered users and 2 guests

cron