Files
gnommoplayer/public/glitch/glitch_gallery/assets/index-CMvlyyxu.js
T

2 lines
38 KiB
JavaScript
Raw Normal View History

2026-04-11 09:21:22 +02:00
import{r as o,j as e}from"./index-CEeZxcxj.js";const F=18,W=F*F,O=1e3,L=12,K=O*L,Q=K+O,J=["orbit","intro","receptor","transition-photon","photon","transition-eventlist","eventlist","transition-binning","binning","transition-flux","flux","transition-periodogram","periodogram","transition-spectrogram","spectrogram","closing"],I=["orbit","intro","receptor","transition-photon","photon","transition-eventlist","eventlist","transition-binning","binning","transition-flux","flux","transition-periodogram","periodogram","transition-spectrogram","spectrogram","closing"],j=[{label:"Red",shortLabel:"R",wavelength:690,hue:2,saturation:100,lightness:66,energy:.44,decay:700,radius:.28},{label:"Orange",shortLabel:"O",wavelength:620,hue:18,saturation:100,lightness:64,energy:.5,decay:760,radius:.3},{label:"Amber",shortLabel:"A",wavelength:590,hue:36,saturation:100,lightness:66,energy:.56,decay:820,radius:.32},{label:"Yellow",shortLabel:"Y",wavelength:570,hue:56,saturation:100,lightness:69,energy:.62,decay:900,radius:.34},{label:"Green",shortLabel:"G",wavelength:530,hue:108,saturation:84,lightness:66,energy:.7,decay:980,radius:.36},{label:"Cyan",shortLabel:"C",wavelength:500,hue:188,saturation:94,lightness:68,energy:.8,decay:1120,radius:.4},{label:"Blue",shortLabel:"B",wavelength:450,hue:232,saturation:100,lightness:71,energy:.92,decay:1300,radius:.45},{label:"Violet",shortLabel:"V",wavelength:410,hue:274,saturation:100,lightness:74,energy:1.08,decay:1540,radius:.52}],ee=[{page:"binning",title:"Count events per second",diagram:"count-time",rule:"Group event rows into 1 second time bins and count how many clicks fall into each bin.",output:"Light curve / count periodogram"},{page:"flux",title:"Sum energy per second",diagram:"energy-time",rule:"Group event rows into 1 second time bins and sum the total photon energy inside each bin.",output:"Flux variability"},{page:"periodogram",title:"Sum energy by wavelength bin",diagram:"energy-wavelength",rule:"Group event rows by wavelength and sum the energy across the recent time window.",output:"Spectrum"},{page:"spectrogram",title:"Count events by wavelength over time",diagram:"count-wavelength-time",rule:"Group event rows into both time bins and wavelength bins, then count clicks in each cell.",output:"Spectrogram"}],U={"transition-photon":{title:"Every photon has energy",body:"Colour tells us something about wavelength and energy. Before we record the hits, it helps to see what that means.",nextPage:"photon",emoji:"😶‍🌫️"},"transition-eventlist":{title:"Now record the hits",body:"Each photon hit becomes one row with a time, an energy, and a CCD position.",nextPage:"eventlist",emoji:"📝"},"transition-binning":{title:"Chart #1 : Brightness over time",body:"We now use the data and make the first chart",nextPage:"binning",emoji:"🫰🏻⏰"},"transition-flux":{title:"Chart #2: Energy over time",body:"Instead of counting clicks equally, we sum up the energy of each phton inside each time bin.",nextPage:"flux",emoji:"🔥⏰"},"transition-periodogram":{title:"Chart #3: Build a spectrum",body:"The same event list can also be grouped by wavelength. Is it lots of low-energy red photons, or high-energy violet ones? Let`s find out.",nextPage:"periodogram",emoji:"🌈"},"transition-spectrogram":{title:"Chart #3 : Let´s mix things up",body:"Now try both time bins, and wavelength/energy bins at the same time!",nextPage:"spectrogram",emoji:"🤪"}},Y=["receptor","photon","eventlist","binning","flux","periodogram","spectrogram"];function se(){return Array.from({length:W},(t,n)=>({id:n,level:0,size:.22,decay:900,tint:"hsla(0 0% 100% / 0)",glow:"hsla(0 0% 100% / 0)"}))}function te(){return Array.from({length:j.length},()=>0)}function ne(){return{cells:se(),eventHistory:[],totalPhotons:0}}function G(t,n,s){return Math.min(s,Math.max(n,t))}function ae(t){const n=Math.floor(t/1e3),s=Math.floor(n/60),a=n%60,c=Math.floor(t%1e3/10);return[s,a].map(r=>String(r).padStart(2,"0")).join(":")+"."+String(c).padStart(2,"0")}function ce(t){const n=t.replace(/^#/,"");return J.includes(n)?n:"orbit"}function z(){return