pages/birds.php
Snapshot 2026.09.17-a2894de (current) · 25 lines · 2,226 bytes · tree · plain text
SHA-256
d6445399959599d82c0d14bcebf5a5e300913791e1976b5f8cf56b817d00e6e2| 1 | <?php |
| 2 | require_once __DIR__.'/../inc/layout.php'; |
| 3 | page_header('Birds & Soundscape','birds'); |
| 4 | echo '<h1>Birds & soundscape</h1><p class="lede">The study\'s central causal comparison: acoustic activity at the development site and at the control shoreline two kilometres away, compared on changes, never on levels. Period markers separate before, construction and operation.</p>'; |
| 5 | $from=$_GET['from']??date('Y-m-d',strtotime('-30 days')); $to=$_GET['to']??date('Y-m-d'); |
| 6 | echo '<form class="controls" method="get"><input type="hidden" name="p" value="birds">' |
| 7 | .'<div><label>FROM</label><input type="date" name="from" value="'.h($from).'"></div>' |
| 8 | .'<div><label>TO</label><input type="date" name="to" value="'.h($to).'"></div><button>Apply</button></form>'; |
| 9 | $imp=stream_by_code('ac_impact_activity'); $ctl=stream_by_code('ac_control_activity'); |
| 10 | if($imp&&$ctl){ |
| 11 | $a=series($imp,$from.' 00:00:00',$to.' 23:59:59'); $b=series($ctl,$from.' 00:00:00',$to.' 23:59:59'); |
| 12 | echo '<div class="card"><h3>Vocal activity index · impact vs control '.mode_badge($imp).' '.mode_badge($ctl).'</h3>'; |
| 13 | echo '<div class="chart tall" data-chart=\''.h(json_encode(['unit'=>'idx','normalize'=>false,'series'=>[ |
| 14 | ['label'=>'Development site','slot'=>0,'data'=>array_map(fn($r)=>[substr($r['ts'],0,16),(float)$r['value']],$a)], |
| 15 | ['label'=>'Control site (2 km)','slot'=>2,'data'=>array_map(fn($r)=>[substr($r['ts'],0,16),(float)$r['value']],$b)], |
| 16 | ]])).'\'></div>'; |
| 17 | echo '<p class="note">The control is not assumed to hold the same number of birds, and it does not need to: if activity falls at both sites, the region did it; if it falls only here, the development did.</p>'; |
| 18 | echo instrument_card($imp); echo instrument_card($ctl); echo '</div>'; |
| 19 | } |
| 20 | foreach(['ac_species_rich','ac_dawn_chorus'] as $c){ $s=stream_by_code($c); if(!$s) continue; |
| 21 | $r=series($s,$from.' 00:00:00',$to.' 23:59:59'); |
| 22 | echo '<div class="card"><h3>'.h($s['label']).' '.mode_badge($s).'</h3><div class="chart" data-chart=\''.h(json_encode(['unit'=>$s['unit'],'series'=>[['label'=>$s['label'],'slot'=>(int)$s['series_slot'],'data'=>array_map(fn($x)=>[substr($x['ts'],0,16),(float)$x['value']],$r)]]])).'\'></div>'.instrument_card($s).'</div>'; |
| 23 | } |
| 24 | page_footer(); |
| 25 | |
Lines can be cited as pages/birds.php L120-L140, platform code 2026.09.17-a2894de; add #L120-L140 to this page's address to highlight them. Source shown for scrutiny of the research platform. All rights reserved. Not offered as installable software.