Next / Previous / Contents / Shipman's homepage

Abstract

Describes the implementation of an automated system for producing reports displaying Christmas Bird Count data.

This publication is available in Web form and also as a PDF document. Please forward any comments to john@nmt.edu.

Table of Contents

1. Introduction
2. Requirements
3. Functional design
3.1. Alias sets
3.2. The art of combining circles
4. Page designs
4.1. Layout of the top page
4.2. General controls on the regional index page
4.3. Format of regional page entries
4.4. The detail history report
4.5. CSS considerations in page design
5. Data structure design
5.1. Data structures for the regional index page
5.2. Data structures for the history detail report
6. pickaregion.cgi: Select a region
6.1. pickaregion.cgi: Prologue
6.2. pickaregion.cgi: Imports
6.3. Manifest constants
6.4. pickaregion.cgi: main()
6.5. buildEmptyPage(): Set up an empty page
6.6. buildRegionsForm(): Build the table of region radiobuttons
6.7. addRadios(): Add regional selection radiobuttons
6.8. buildRow(): Build one row of region radiobuttons
6.9. buildRegionCell(): Build one cell of the region radiobuttons table
6.10. pickaregion.cgi: Epilogue
7. topform.py: Form constants for the top-level page
8. regx.cgi: Generate a region index page
8.1. regx.cgi: Prologue
8.2. regx.cgi: Imports
8.3. regx.cgi: main()
8.4. buildEmptyPage(): Set up an empty page
8.5. buildRegionsForm: Build the regional index form
8.6. buildRegionTitles(): Set up the titles for the selected region
8.7. startForm(): Set up the form and static controls
8.8. buildIndexSection(): Add the primary and secondary index entries
8.9. buildEntries(): Build all the BaseIndex instances
8.10. buildCircle(): Build entries for one circle center
8.11. addSecondaries(): Generate secondary index entries for one circle
8.12. class Args: The CGI arguments
8.13. Args.__init__()
8.14. regx.cgi: Epilogue
9. regform.py: Form constants for the regional index page
10. hist.cgi: Generate a history detail page
10.1. hist.cgi: Prologue
10.2. hist.cgi: Imports
10.3. hist.cgi: Manifest constants
10.4. hist.cgi: main()
10.5. hist.cgi: buildEmptyPage()
10.6. hist.cgi: buildContent()
10.7. hist.cgi: buildReport(): Main report logic
10.8. hist.cgi: buildHeadings()
10.9. hist.cgi: findEfforts(): Locate selected effort records
10.10. hist.cgi: buildFilter—Set up census record filtration
10.11. hist.cgi: updateAbbrs()
10.12. hist.cgi: updateSimpleAbbrs()
10.13. hist.cgi: updateCompoundAbbrs
10.14. fixOldAbbr(): Update an outdated bird code
10.15. hist.cgi: subspLumper()—Lump subspecies
10.16. hist.cgi: lumpCompoundForm
10.17. hist.cgi: lumpSimpleForm
10.18. hist.cgi: outputAllRows(): Build the body of the table
10.19. class Args(): CGI argument processing
10.20. Args.__init__()
10.21. Args._checkLatLonList(): Check all lat-lon arguments
10.22. Args._checkLatLon(): Check one lat-lon argument
10.23. hist.cgi: Epilogue
11. cbchistlib.py: Prologue
12. cbchistlib.py: Imports
13. cbchistlib.py: Manifest constants
13.1. CSS constants
13.2. Unicode constants
13.3. PASS_FILE
13.4. LAT_LON_PREFIX
13.5. ROW_GROUPING
13.6. COL_GROUPING
13.7. MIN_YEAR
13.8. MAX_YEAR
14. Specification functions
14.1. census-filter
14.2. class-dict
14.3. row-key
14.4. year-number
15. class ScriptError: Our exception
16. openDatabase(): Open the CBC database
17. buildErrorPage()
18. addDocLink(): Add a link to the documentation
19. class BaseIndex: Base class for regional page index entries
19.1. BaseIndex.__init__()
19.2. BaseIndex.__cmp__(): Comparator
20. class PriIndex: Primary regional index entry
20.1. PriIndex.__init__()
20.2. PriIndex.effByYear(): Sorting function for effort records
20.3. PriIndex.html()
20.4. PriIndex.htmlMain: First line of the primary index entry
20.5. PriIndex.htmlAs(): Generate primary “As” entries
20.6. PriIndex._buildAs(): Build an “As” line
20.7. PriIndex._htmlOverlaps(): Generate primary “Overlaps” index entries
20.8. PriIndex._overlapEntry(): Generate one overlap line
21. class SecIndex: Secondary regional index entry
21.1. SecIndex.__init__()
21.2. SecIndex.html()
22. yearBrackets(): Display a bracketed list of years worked
23. countValues(): Summarize a list of years
24. peelGroup(): Find the first date group in a list
25. latLonFormat(): Present the center coordinates in standard format
26. class CbcHist: The history class
26.1. CbcHist.nCensusRows(): How many census rows are there?
26.2. CbcHist.genCensusRows(): Generate the census rows in self
26.3. CbcHist.colLabel(): Retrieve a column label
26.4. CbcHist.findColumn()
26.5. CbcHist.genColLabels(): Generate the logical column labels
26.6. CbcHist.__init__()
26.7. CbcHist._buildCensusRows(): Build the census rows
26.8. CbcHist._addOneEffort()
26.9. CbcHist._addOneCensus()
26.10. CbcHist._rowKey(): What is the ._rowMap key for this census record?
27. class Row: Abstract class for logical rows
27.1. Row.__init__()
27.2. Row.physRowCount(): How many physical rows will this logical row occupy?
27.3. Row.html(): Render a logical row into XHTML
27.4. Row._physRender(): Render the physical rows
27.5. Row._setLogicalCells(): Copy the logical cells to physical rows
27.6. Row._setSuffixCells(): Copy the suffix cells to physical rows
28. class KeyRow: The first heading line
28.1. KeyRow.__init__()
28.2. KeyRow.suffixes()
29. class StatRow: Parent class for rows with statistics
29.1. StatRow.suffixes(): Compute statistics
30. class PartyHoursRow: Heading row showing total effort
30.1. PartyHoursRow.__init__()
30.2. PartyHoursRow._sumEfforts(): Find all the party-hours for a logical column
31. class RowLabel: Base class for row labels
32. class CensusRow: Numbers of individuals
32.1. CensusRow.__init__()
32.2. CensusRow.addCensus(): Accumulate data from one census record
33. class HeadRowLabel: Row label for a heading
33.1. HeadRowLabel.html(): Render a heading row label
34. class CensusRowLabel: Row label for kinds of birds
34.1. CensusRowLabel.__init__()
34.2. CensusRowLabel.html()
34.3. CensusRowLabel._htmlSimple()
34.4. CensusRowLabel._htmlCompound()
35. class Cell: Base class for table cells
36. class LabelCell: Column label cell
36.1. LabelCell.__init__()
36.2. LabelCell.html()
37. class SpacerCell: Empty cell
37.1. SpacerCell.html()
38. class NumberCell: Base class for numeric table cells
39. class PartyHoursCell: Heading row showing effort
39.1. PartyHoursCell.__init__()
39.2. PartyHoursCell.add(): Accumulate party-hours
39.3. PartyHoursCell.__float__()
39.4. PartyHoursCell.html()
40. class CensusCell: Accumulator for counts of individual birds
40.1. CensusCell.__init__()
40.2. CensusCell.add(): Accumulate data from one census record
40.3. CensusCell.html()
40.4. CensusCell.__float__()
41. class CensusTotal: Number of individuals in one category
41.1. CensusTotal.__init__()
41.2. CensusTotal.add(): Accumulate one count of individuals
41.3. CensusTotal.html()
41.4. CensusTotal.__float__()
42. class StatCell: Display a statistic
42.1. StatCell.__init__()
42.2. StatCell.html()
43. class PhysRow: One physical row
43.1. PhysRow.__init__()
43.2. PhysRow.setLabel()
43.3. PhysRow.setCell(): Set up a detail cell
43.4. PhysRow.html(): Render as XHTML
44. class ColumnLayout: Column layout controller
45. class LumpedLayout: Column layout for lumped years
45.1. LumpedLayout.__init__(): Constructor
45.2. LumpedLayout.findColumn()
45.3. LumpedLayout.label()
46. class SplitLayout: Column layout for split years
46.1. SplitLayout.__init__()
46.2. SplitLayout.findColumn()
46.3. SplitLayout.label()
47. class EffortKey: A unique key for the effort table
47.1. EffortKey.__init__()
47.2. EffortKey.__cmp__()
47.3. EffortKey.__str__()
48. FOR(): Build a “for=” attribute
49. divCeil(): Discrete rounding function
50. anchorName(): Format a page anchor
51. latLonKey(): Generate the lat-lon key for a given circle
52. yearCheck(): Validate a year number form entry
53. aliasFactory
54. nmAlias(): The New Mexico alias set
55. meanSigma(): Compute statistics
56. statNumber(): Display a float without too much precision
57. combineCss(): Combine CSS classes from different sources
58. The CSS-2 stylesheet
58.1. div.pri-div
58.2. span.pri-name
58.3. span.lat-lon
58.4. span.year-list
58.5. div.as-div
58.6. div.sec-div
58.7. span.sec-name
58.8. table.tb
58.9. td.col
58.10. div.hrl
58.11. td.crl
58.12. css-th-ph-cell
58.13. css-td-stat-cell
58.14. css-td-spacer-cell
58.15. td.cc
58.16. td.c1
58.17. th.c1
58.18. td.cl
58.19. td.ct
58.20. th.cl
58.21. th.ct
59. Directions for future work
59.1. Flexible aliasing
59.2. Rigorous comparability option
59.3. Overlap control
59.4. Alternate output formats
59.5. Nonparametric rank statistic for detecting low and high numbers

1. Introduction

The Christmas Bird Count of the National Audubon Society is a unique resource for ornithological researchers: a continent-wide survey of early winter bird numbers going back to 1900. Each published census is a count of all the birds in a 15-mile-diameter circle on one day between mid-December and early January.

This document describes the implementation of a Web-based application to display a report showing the history of a given circle or combination of circles.

This system is built on top of a number of existing layers that are documented elsewhere.

Click here to generate reports using this system.