Alpha Video Training
Results 1 to 8 of 8

Thread: Any Alpha Weather Database Ideas/Examples?

  1. #1
    Member
    Real Name
    Robert Stock
    Join Date
    Apr 2000
    Posts
    29

    Default Any Alpha Weather Database Ideas/Examples?

    I'm trying to design some tables, functions, etc. for weather data that will allow me to create routines that will identify extremes, averages, and such. At the same time I hope to learn much more about Alpha than I currently do.

    Is there anyone out there already using Alpha for a weather database? I'm struggling to come up with a general design plan and I'd appreciate any tips regarding efficient design, function/index usage, etc.

    I currently have more than a half-million 10-minute records representing 11 years of weather data from my home weather station imported into both yearly tables and a single (all data) table. I'm guessing I'll want to work with the ever-growing single table to write routines to identify various statistics.

    I'm thinking initially it might be best to create two more tables to post daily and monthly statistics to. For example: the daily table would be populated with stats for each MM/DD such as high/low/average Temp/Wind/Rain/Barometer/etc. This would answer questions like what is the normal high/low/ave for each element for a particular month/day. The same would be done for monthly statistics (i.e. for the month of MM).

    It seems this type of database would be a little different from the more common Invoice, Inventory, or Contact Management databases, or maybe it's more similar than I'm thinking. I hope I can get some good, efficient ideas, tips, etc. for getting this thing going, and/or finding someone who's already started working on something similar.

    Thanks for any replies!!!

  2. #2
    Member
    Real Name
    George Corder
    Join Date
    May 2002
    Location
    Kentucky
    Posts
    519

    Default Re: Any Alpha Weather Database Ideas/Examples?

    I beieve it might be helpful if you would post some of your sample data from one day. What do you mean by "10-minute records"?

  3. #3
    Volunteer Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,630

    Default Re: Any Alpha Weather Database Ideas/Examples?

    I did put a reply in your earlier thread, though only many weeks later -- I was too busy watching other weather sites.... I'd probably go with a single, flat file table. Put an index on the date field, learn a bit about Lightning Query Optimization (see the help files) and you'll be able to get your stats very quickly.
    -Steve


  4. #4
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Any Alpha Weather Database Ideas/Examples?

    Robert:
    The mere fact that a database has millions of records does not by default merit a complex structure. I do not see anything peculiar that require more than, as steve said, a flat table.

    However, when you deal with myriads of data as you would and if you try to print a report that for exsample show stats for daily or monthly, you will find out that it will take quite a while to print. I found out also, that avg() function is very time consuming.


    So, the only suggestion I would add to what Steve already said, is to create summary tables that reflects the stats you use on a frequent basis and print your reports of the summary tables instead.

  5. #5
    Member
    Real Name
    Robert Stock
    Join Date
    Apr 2000
    Posts
    29

    Default Re: Any Alpha Weather Database Ideas/Examples?

    Sorry I haven't been able to respond and give thanks for the relplies so far.

    George, by 10-minutes records I mean that my weather station is configured to log a record of 23 fields every 10 minutes. One of those fields is Outside High Temperature so the high temp for the past 10 minutes would be included in each record. I've imported these records into Alpha to hopefully analyze them in any number of ways. To determine the daily high temperature I would have to find the highest high temp of the 144 records recorded for that particular day. This is one of countless types of things I am interested in analyzing. I have attached a sample of the data I've imported-- it's all data my station captured for 2005.

    Steve, I did see your reply to my other thread, thanks. I didn't get the response I'd hoped for so I thought I'd try another area of the forum. I'm checking into the Lightning Query Optimization right now. Thanks for the advice.

    G Gabriel, I thought I would need a few summary tables otherwise, as I've already seen while dabbling, it will take forever to recalculate the same things over and over.

    Any tips or similar examples along the lines of summary tables? For example, one thing I'd like to define is a table to store daily almanac-type stats each day of the year. So, for all August 1STs (i.e 8/1/2006, 8/1/2005, 8/1/2004, ...) when was the warmest high, coolest low, highest gust, or what's the average high/low/gust/etc. for this day?

    The same would be done for monthly and yearly related stats, and of course there would be an all-time table as well. There are really countless things that could be analyzed. What's a good approach? Calculated fields, field rules, scripting, xbasic??

    Thanks again!!!

  6. #6
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,649

    Default Re: Any Alpha Weather Database Ideas/Examples?

    The down side of calc fields is that they will always evaluate (i.e. for a form), thus making your table views impossibly slow. If you are interested in daily stats, for example, just query that date w. xbasic and run a script that computes the stats and write them to a second table (assuming you want a permanent record). Seems kind of simple to my simple mind. If you don't know xbasic, you will have to learn, but it's not all that hard.

  7. #7
    Member
    Real Name
    Daniel Haanpaa
    Join Date
    Feb 2006
    Posts
    7

    Default Re: Any Alpha Weather Database Ideas/Examples?

    Will this be importing from a text file generated from the weather station?

  8. #8
    Member
    Real Name
    Robert Stock
    Join Date
    Apr 2000
    Posts
    29

    Default Re: Any Alpha Weather Database Ideas/Examples?

    Yes, not from the station directly but from text-based export files.

Similar Threads

  1. Xbasic Loop Processing Examples
    By Tom Cone Jr in forum Code Archive
    Replies: 23
    Last Post: 05-12-2008, 05:06 PM
  2. Weather Database Design Advice?
    By SWWeatherGuy in forum Database Design
    Replies: 1
    Last Post: 07-25-2006, 09:39 PM
  3. examples don't seem to work for me
    By dik_coleman in forum Alpha Five Version 5
    Replies: 6
    Last Post: 06-04-2004, 05:39 AM
  4. Looking for Good Xdialog examples
    By Edward Larrabee in forum Alpha Five Version 5
    Replies: 0
    Last Post: 02-18-2004, 05:54 AM
  5. Expressions examples
    By Larry Eaton in forum Alpha Five Version 5
    Replies: 1
    Last Post: 01-20-2004, 11:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •