Christmas Bird Count
Jean B. Rogers
Personal computers can make any hobby more rewarding. Here's how a PET contributed to the author's bird watching, along with some hints on effective pre-planning when writing large programs.
Every year, during a two-week period near Christmas, thousands of bird watchers spend whole days surveying all the birds around them. This event, the annual Audubon Christmas Bird Count, provides large amounts of information about bird populations throughout North and Central America.
The first Christmas Bird Count (CBC) was held on Christmas Day, 1900, when 27 birders noted all the birds they saw during the day. Those birders covered 25 different areas, mostly in cities in the Northeastern USA. CBC's have been held every year since then; currently about 34,000 birders survey nearly 1360 different count areas each year. Results from these CBC's are submitted to the National Audubon Society and are published in its journal, American Birds.
In 1979, my teen-aged son and my husband decided to establish a CBC in the area near our home, Port Orford, Oregon. To initiate a CBC, a circular area 15 miles in diameter is chosen, separate from an existing CBC area. This circle is then subdivided into sections, and a group of people is assigned to scour each section, recording every bird identified by sight or sound. Each group tallies the birds according to the number of each species seen. After the count, the number of different species seen by each party of observers and the number of species seen by the total group are counted. For CBC's held in 1979, these totals varied from the Atlantic area of the Panama Canal Zone with 320 species, to Bethel, Alaska, with 4. A reasonable expectation for the Port Orford area is 100 to 120.
Additionally, the observers record the number of individual birds of each species seen on the count. For some species such as Screech Owl, only one individual might be found in the whole count area. Others, like the American Robin or the Common Murre, might be tallied in the thousands. The main data processing task related to a CBC thus is a tabulation of sums of species and individuals seen. A count report including this information is provided for each participant in the count as well as being sent to the National Audubon Society.
Since we wanted an easy-to-read, attractive report, and needed to do some simple numerical calculations, I concluded that this would be a very reasonable task for a microcomputer using BASIC. I had available a PET with 8K of memory and cassette for storage, and a CBM printer. We designed software that worked successfully for the 1979 Port Orford CBC and have used the same programs for CBC's since.
Designing The Project
I think that many amateur programmers have a bigger problem analyzing the project they've undertaken than they do coding it. Thus, I propose to explain how I attacked the problem rather than to provide the BASIC code I used. While the code might be useful to some people with projects very much like mine, the information on problem analysis will possibly be helpful to many people with a wide variety of interests.
The first step in working on the project was to sit down with my son and find out specifically what information he wanted on the output report, as well as approximately what he expected it to look like. The report would essentially consist of a list of the names of birds seen on the count, the number of individuals of that species seen by each of the parties (people assigned to a sub-area of the count circle), and the total seen by the whole group.
In discussing the report, we realized that, with little additional work, we could produce a field form for use on the count. This is a recording sheet listing the birds one might expect to see, with spaces for tallying the number of individuals of each species seen. Each party has one person designated as recorder who keeps track of the tallies. On the field form and on the final report, birds are listed in phylogenetic order. This is a standard order based on evolutionary progression, and is used in field guides, ornithological research, and scientific documents.
So the overall task was divided down into subtasks: build a bird list, tabulate the results of the count, print the report. A basic list of the birds one might expect to see in our area, then, was the first thing we would need. Having this list on a separate file stored on a tape would make it easily available for whatever future need we had of it.
The Master Bird List
The program to build the list and store it on the cassette was very simple.
- Open the cassette file for writing
- While there are more birds to go onto the list
2.1 Input a bird name
2.2 If the name does not have typos
2.2.1 Then write the name on the tape file
2.2.2 Else request re-entering that bird name
- Close the file
We'd need to be able to make changes in the list when the count results were being tabulated as some unexpected birds would appear, and other expected ones would not.
For creating the field form, however, this list would be used directly. We wanted the complete form to fit on one page for convenience in the field. By reading the whole list into an array in memory, then printing the list in two columns, one from the beginning of the array and one from the midpoint of the array, all the names fit on one sheet.
There was even space for eight unexpected birds to be noted on the bottom of the form. To divide up the tally space, a row of dashes was printed in front of each bird name. The procedure was this:
- Initialize array space for names
- Initialize dash string to correct number of dashes
- Open name file
- Read complete list into array
- Close name file
- Specify format to printer
- While more copies of the form are needed
7.1 For number of birds from one to half of total
7.1.1 Print dash string; bird name (counter); dash string; bird name (counter + halfnumber)
7.2 Print four lines of pairs of double-dash strings
By using the formatting capability of the CBM printer, it was easy to line up the strings in even rows. This could have been done by padding the name strings with blanks so they would be an even length, as I did later in this project, doing the report.
Processing The Results
After the day of the count we were ready to tabulate the data that had been collected. The primary subtasks of the tabulation and report writing process were these:
- Get the bird list and edit it
- Input the numbers of species seen by party
- Calculate the cross totals and species counts
- Print the report
- Save the data for future use
Each of these would be divided further.
The list of names of expected birds was stored on a cassette tape, but some of these birds had not been found on the count day, while a few unexpected others did appear. Using a simple editing program, we read in the original list and wrote out a new list of all the birds sighted on that year's count. The procedure was this:
- Initialize an array for the names
- Open the master list file
- Read names into the array
- Close master list file
- Open list file for this year
- While not at end of list in array
6.1 Print next name on list for user
6.2 If a new name should be inserted before next name
6.2.1 Then accept input of name to be inserted
Write new name to year file
6.2.2 Else if next name should be kept Then write name to year file
Move to next name
- Close the file with this year's list
This procedure deletes birds not seen by simply skipping over them and not writing them on the current year list file.
The next step required entering the data on sightings of each bird by each party. The input mechanism I chose for this portion of the project was the READ-DATA combination. With this method, the data is specified in the program in non-executable statements that look like this:
2001 DATA 5,0,4,14,6,3,9
They are read by an executable statement (READ) elsewhere in the program. I think of this method as attaching a data file onto the end of the program. When using a PET, there is a very good reason for doing this: the PET screen editor.
The built-in editor on Commodore computers is very flexible and easy to use, not only for correcting typos, but also for duplicating lines or parts of lines. I find that entering a lot of numerical data is hard to do accurately, even when using a number pad. If such data is being input interactively, the user must be asked to confirm each item for correctness, making data entry very boring.
Using the screen editor, however, makes it relatively painless to get a complete set of correct data via DATA lines within the program.
For this project, we needed the number of birds of each species seen by each party. I used one DATA statement for a set of three birds, with the line numbers of the statements keying back to the birds on the list. I then ran the program to combine the names from the cassette file with the data on the sightings.
- Open name file
- Initialize array for names
- Read in names
- Close name file
- Open results file on cassette
- For birds from 1 to end of list in array do
6.1 Read a set of data from the sequential DATA statements
6.2 Get the next name from the array
6.3 Write the name plus the data to the results file
- Close results file
By now you have noticed that I write intermediate steps of my processing out to cassette files frequently. This is not because I enjoy waiting for the tape read and writes. It is my insurance against radical loss. I am cautious enough about my machine and the perfection of my programs that I never want to get too far away from my last plateau. Additionally, by dividing the total project into chunks, each of the parts did not come up against the size limitation of 8K memory, while a program to do the complete project undoubtedly would have.
Creating The Report
The next step was to actually process the data. This cycle, I read each line of data including the name from the cassette file and processed the numbers in it. I then packed it into a string variable and put it temporarily in an array. It was necessary to do this in sections because the memory is insufficient to hold the complete set of data in the array.
This was still quite convenient, though, because we found that 25 lines of data, plus a heading, fit nicely on a page for the report. We processed it in units of this size, ending up with a report with five pages of results (see the chart).
After each set of 25 was processed, we printed the needed number of copies of that page of the report, then proceeded to the next. The last page was somewhat different because of the totals, but the general process was this:
- Open input file
- a string array of 25 elements
- an eight-element array to read the data into(seen)
- an eight-element array to count species seen by party (count)
- Create the heading strings
- For the first hundred birds (four sets) do
4.1 For 25 data lines do
4.1.1 Read a data line (name and eight numbers into seen (party))
4.1.2 For each of the eight parties
18.104.22.168 If bird seen by the party (not 0) Then increment count (part) by 1
4.1.3 Sum numbers seen across the eight parties
4.1.4 Make strings of the numbers seen and the total
4.1.5 Build a string of the name, number strings, total string
4.1.6 Place this output string in the string array
4.1.7 Accumulate grand total of numbers seen
4.2 For the number of copies of the report needed
4.2.1 Print heading
4.2.2 Print the set of 25 output lines
4.3 Write the set of 25 output lines to a file
The process was repeated in a similar manner for the last page. Here there were fewer data lines, and at the bottom of that page, the total number of species seen by each party and the grand total of individuals and of species seen were printed.
When building the output string, the name and number strings were padded with blanks, effectively formatting the printed output. BASIC'S string functions make this quite simple, and storing in one string array again saves space in memory.
Using these programs, we have been able to get reports out to participants within a week of the count. We have been pleased with the quality and attractiveness of the reports, as well as appreciating the use of our personal computer to make another hobby, birding, even more enjoyable.