@jjlmoya/utils-astronomy 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/package.json +60 -0
  2. package/src/category/i18n/en.ts +57 -0
  3. package/src/category/i18n/es.ts +57 -0
  4. package/src/category/i18n/fr.ts +58 -0
  5. package/src/category/index.ts +16 -0
  6. package/src/category/seo.astro +15 -0
  7. package/src/components/PreviewNavSidebar.astro +116 -0
  8. package/src/components/PreviewToolbar.astro +143 -0
  9. package/src/data.ts +19 -0
  10. package/src/env.d.ts +5 -0
  11. package/src/index.ts +22 -0
  12. package/src/layouts/PreviewLayout.astro +117 -0
  13. package/src/pages/[locale]/[slug].astro +146 -0
  14. package/src/pages/[locale].astro +251 -0
  15. package/src/pages/index.astro +4 -0
  16. package/src/tests/faq_count.test.ts +24 -0
  17. package/src/tests/mocks/astro_mock.js +2 -0
  18. package/src/tests/seo_length.test.ts +57 -0
  19. package/src/tests/tool_validation.test.ts +145 -0
  20. package/src/tool/bortleVisualizer/bibliography.astro +14 -0
  21. package/src/tool/bortleVisualizer/component.astro +491 -0
  22. package/src/tool/bortleVisualizer/i18n/en.ts +153 -0
  23. package/src/tool/bortleVisualizer/i18n/es.ts +161 -0
  24. package/src/tool/bortleVisualizer/i18n/fr.ts +153 -0
  25. package/src/tool/bortleVisualizer/index.ts +41 -0
  26. package/src/tool/bortleVisualizer/logic.ts +118 -0
  27. package/src/tool/bortleVisualizer/seo.astro +61 -0
  28. package/src/tool/bortleVisualizer/style.css +5 -0
  29. package/src/tool/deepSpaceScope/bibliography.astro +14 -0
  30. package/src/tool/deepSpaceScope/component.astro +849 -0
  31. package/src/tool/deepSpaceScope/i18n/en.ts +157 -0
  32. package/src/tool/deepSpaceScope/i18n/es.ts +157 -0
  33. package/src/tool/deepSpaceScope/i18n/fr.ts +157 -0
  34. package/src/tool/deepSpaceScope/index.ts +48 -0
  35. package/src/tool/deepSpaceScope/logic.ts +41 -0
  36. package/src/tool/deepSpaceScope/seo.astro +61 -0
  37. package/src/tool/deepSpaceScope/style.css +5 -0
  38. package/src/tool/starExposureCalculator/bibliography.astro +14 -0
  39. package/src/tool/starExposureCalculator/component.astro +562 -0
  40. package/src/tool/starExposureCalculator/i18n/en.ts +163 -0
  41. package/src/tool/starExposureCalculator/i18n/es.ts +163 -0
  42. package/src/tool/starExposureCalculator/i18n/fr.ts +158 -0
  43. package/src/tool/starExposureCalculator/index.ts +53 -0
  44. package/src/tool/starExposureCalculator/logic.ts +49 -0
  45. package/src/tool/starExposureCalculator/seo.astro +61 -0
  46. package/src/tool/starExposureCalculator/style.css +5 -0
  47. package/src/tool/telescopeResolution/bibliography.astro +14 -0
  48. package/src/tool/telescopeResolution/component.astro +556 -0
  49. package/src/tool/telescopeResolution/i18n/en.ts +168 -0
  50. package/src/tool/telescopeResolution/i18n/es.ts +163 -0
  51. package/src/tool/telescopeResolution/i18n/fr.ts +168 -0
  52. package/src/tool/telescopeResolution/index.ts +52 -0
  53. package/src/tool/telescopeResolution/logic.ts +39 -0
  54. package/src/tool/telescopeResolution/seo.astro +61 -0
  55. package/src/tool/telescopeResolution/style.css +5 -0
  56. package/src/tools.ts +19 -0
  57. package/src/types.ts +71 -0
@@ -0,0 +1,153 @@
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { BortleVisualizerUI, BortleVisualizerLocaleContent } from '../index';
3
+
4
+ const slug = 'dark-sky-simulator';
5
+ const title = 'Dark Sky Simulator (Bortle Scale)';
6
+ const description = 'Interactively visualize the 9 levels of the Bortle Scale and discover how light pollution erases the starry night sky.';
7
+
8
+ const ui: BortleVisualizerUI = {
9
+ toolTitle: 'Dark Sky Simulator',
10
+ sliderLabel: 'Drag to adjust light pollution level',
11
+ classLabel: 'Bortle Class',
12
+ nelmLabel: 'NELM',
13
+ sqmLabel: 'SQM',
14
+ };
15
+
16
+ const faq: BortleVisualizerLocaleContent['faq'] = [
17
+ {
18
+ question: 'What is the Bortle Scale?',
19
+ answer: 'It is a 9-point numerical scale that measures the brightness of the night sky at a given location. It was created by amateur astronomer John E. Bortle in 2001 and published in Sky & Telescope. Level 1 represents the darkest possible sky (remote deserts) and Level 9 the most light-polluted (city centers).',
20
+ },
21
+ {
22
+ question: 'What is the minimum Bortle level to see the Milky Way?',
23
+ answer: 'The Milky Way begins to be clearly visible from Bortle 4 (rural/suburban zone). At levels 1 and 2 it is spectacular, with detailed structure even capable of casting faint shadows. From Bortle 6 onwards it is practically invisible to the naked eye.',
24
+ },
25
+ {
26
+ question: 'What do NELM and SQM mean?',
27
+ answer: 'NELM (Naked Eye Limiting Magnitude) is the magnitude of the faintest star visible to the naked eye under those conditions. SQM (Sky Quality Meter) measures sky brightness in magnitudes per square arcsecond, being the objective scientific standard.',
28
+ },
29
+ {
30
+ question: 'How can I find darker skies near me?',
31
+ answer: 'Use light pollution maps like lightpollutionmap.info to find Bortle 3 or darker zones within a few hours\' drive. National parks, high mountain areas, and designated dark sky reserves offer the best conditions.',
32
+ },
33
+ ];
34
+
35
+ const howTo: BortleVisualizerLocaleContent['howTo'] = [
36
+ { name: '1. Adjust the Bortle level', text: 'Drag the slider to simulate how light pollution increases from level 1 (desert) to level 9 (city center).' },
37
+ { name: '2. Observe the visual effects', text: 'Notice how faint stars disappear, the Milky Way fades, and the sky takes on an orange or grey tone with each level.' },
38
+ { name: '3. Identify your current level', text: 'Compare what you see from your usual observing spot with the simulations to identify your local Bortle level.' },
39
+ ];
40
+
41
+ const bibliography: BortleVisualizerLocaleContent['bibliography'] = [
42
+ { name: 'Original Bortle Article (Sky & Telescope, 2001)', url: 'https://skyandtelescope.org/astronomy-resources/light-pollution-and-astronomy-the-bortle-dark-sky-scale/' },
43
+ { name: 'Light Pollution Map - World Map', url: 'https://www.lightpollutionmap.info/' },
44
+ { name: 'International Dark-Sky Association', url: 'https://www.darksky.org/' },
45
+ { name: 'Globe at Night - Citizen Science', url: 'https://www.globeatnight.org/' },
46
+ ];
47
+
48
+ const seo: BortleVisualizerLocaleContent['seo'] = [
49
+ {
50
+ type: 'summary',
51
+ title: 'Bortle Scale Key Points',
52
+ items: [
53
+ 'Bortle 1-2: Reference dark sky, Milky Way casts shadows, NELM > 7.5.',
54
+ 'Bortle 3-4: Optimal rural sky, Milky Way visible in detail but horizon contaminated.',
55
+ 'Bortle 5-6: Suburban, faint or invisible Milky Way, good for planets and moon.',
56
+ 'Bortle 7-9: Urban sky, only bright objects visible to naked eye.',
57
+ ],
58
+ },
59
+ { type: 'title', text: 'The Bortle Scale: Measuring Sky Darkness', level: 2 },
60
+ {
61
+ type: 'paragraph',
62
+ html: 'The <strong>Bortle Scale</strong> is the international standard system used by amateur astronomers worldwide to quantify the quality of the night sky. Created by John E. Bortle, a veteran observer of comets and deep-sky objects from New York, it was published in 2001 in Sky & Telescope magazine with the goal of providing an objective and reproducible scale for communicating observing conditions.',
63
+ },
64
+ {
65
+ type: 'paragraph',
66
+ html: 'The scale ranges from <strong>level 1</strong> (the darkest possible sky, found only in remote deserts and high mountains far from any civilization) to <strong>level 9</strong> (the interior of large cities, where the sky glows with a permanent orange or whitish brightness and only the Moon and brightest planets are visible). Each level has specific descriptors that allow identification without instrumentation.',
67
+ },
68
+ { type: 'title', text: 'Light Pollution: A Silent Global Crisis', level: 2 },
69
+ {
70
+ type: 'paragraph',
71
+ html: 'The growth of light pollution is one of the least discussed but most widespread environmental problems. According to recent studies, more than <strong>80% of the world\'s population</strong> lives under light-polluted skies, and in Europe and North America the percentage exceeds 99%. The consequences go beyond astronomy: artificial light at night disrupts the circadian rhythms of humans and animals, disorients migratory birds, affects sea turtle reproduction, and suppresses melatonin production in mammals.',
72
+ },
73
+ {
74
+ type: 'table',
75
+ headers: ['Bortle Class', 'NELM', 'SQM (mag/arcsec²)', 'Milky Way', 'Key Feature'],
76
+ rows: [
77
+ ['1 - Excellent', '8.0', '21.99 - 22.0', 'Casts shadows', 'M33 visible naked eye'],
78
+ ['2 - Typical Dark', '7.5', '21.89 - 21.99', 'Very structured', 'Clouds = black holes'],
79
+ ['3 - Rural', '7.0', '21.69 - 21.89', 'Complex', 'Some horizon glow'],
80
+ ['4 - Rural/Suburban', '6.5', '20.49 - 21.69', 'Visible', 'Light domes on horizon'],
81
+ ['5 - Suburban', '6.0', '19.50 - 20.49', 'Faint', 'Greyish sky'],
82
+ ['6 - Bright Sub.', '5.5', '18.94 - 19.50', 'Invisible', 'M31 barely visible'],
83
+ ['7 - Sub/Urban', '5.0', '18.38 - 18.94', 'Absent', 'Light grey sky'],
84
+ ['8 - Urban', '4.5', '< 18.38', 'Absent', 'Main constellations only'],
85
+ ['9 - Inner City', '4.0', '< 18.00', 'Absent', 'Moon and planets only'],
86
+ ],
87
+ },
88
+ {
89
+ type: 'tip',
90
+ title: 'Objective Measurement: The Sky Quality Meter',
91
+ html: 'For precise and reproducible measurements, astronomers use the <strong>Sky Quality Meter (SQM)</strong>, a device that measures sky luminance in magnitudes per square arcsecond (mag/arcsec²). An SQM of 22.0 corresponds to an excellent Bortle 1 sky, while a value of 18.0 indicates a Bortle 8-9 sky. You can check real-time measurements on the Globe at Night network.',
92
+ },
93
+ { type: 'title', text: 'Finding Dark Sky Sanctuaries Near You', level: 2 },
94
+ {
95
+ type: 'paragraph',
96
+ html: 'Despite widespread light pollution, dark sky sanctuaries still exist. National parks, designated dark sky reserves, and remote highland areas offer Bortle 2-4 conditions accessible within hours of most major cities. The IDA (International Dark-Sky Association) maintains a global registry of certified dark sky places, from small parks to entire island reserves. Planning a night trip to a darker location will transform your astronomical experience more than any equipment upgrade.',
97
+ },
98
+ {
99
+ type: 'diagnostic',
100
+ variant: 'success',
101
+ title: 'Planning Tool',
102
+ icon: 'mdi:map-marker-star',
103
+ badge: 'Pro Tip',
104
+ html: 'Before any observation outing, check the light pollution map at lightpollutionmap.info to identify Bortle 3 or darker zones within a 1-2 hour radius. Combine this with astronomical weather forecasts from Clear Outside or Meteoblue Astro to choose the perfect night.',
105
+ },
106
+ ];
107
+
108
+ const faqSchema: WithContext<FAQPage> = {
109
+ '@context': 'https://schema.org',
110
+ '@type': 'FAQPage',
111
+ mainEntity: faq.map((item) => ({
112
+ '@type': 'Question',
113
+ name: item.question,
114
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
115
+ })),
116
+ };
117
+
118
+ const howToSchema: WithContext<HowTo> = {
119
+ '@context': 'https://schema.org',
120
+ '@type': 'HowTo',
121
+ name: title,
122
+ description,
123
+ step: howTo.map((step) => ({
124
+ '@type': 'HowToStep',
125
+ name: step.name,
126
+ text: step.text,
127
+ })),
128
+ };
129
+
130
+ const appSchema: WithContext<SoftwareApplication> = {
131
+ '@context': 'https://schema.org',
132
+ '@type': 'SoftwareApplication',
133
+ name: title,
134
+ description,
135
+ applicationCategory: 'UtilitiesApplication',
136
+ operatingSystem: 'Web',
137
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
138
+ inLanguage: 'en',
139
+ };
140
+
141
+ export const content: BortleVisualizerLocaleContent = {
142
+ slug,
143
+ title,
144
+ description,
145
+ ui,
146
+ seo,
147
+ faq,
148
+ faqTitle: 'Frequently Asked Questions',
149
+ bibliography,
150
+ bibliographyTitle: 'Bibliographic References',
151
+ howTo,
152
+ schemas: [faqSchema as any, howToSchema as any, appSchema],
153
+ };
@@ -0,0 +1,161 @@
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { BortleVisualizerUI, BortleVisualizerLocaleContent } from '../index';
3
+
4
+ const slug = 'simulador-cielo-oscuro';
5
+ const title = 'Simulador de Cielo Oscuro (Escala de Bortle)';
6
+ const description = 'Visualiza interactivamente los 9 niveles de la Escala de Bortle y descubre cómo la contaminación lumínica borra el cielo nocturno estrellado.';
7
+
8
+ const ui: BortleVisualizerUI = {
9
+ toolTitle: 'Simulador de Cielo Oscuro',
10
+ sliderLabel: 'Desliza para ajustar la contaminación lumínica',
11
+ classLabel: 'Clase Bortle',
12
+ nelmLabel: 'NELM',
13
+ sqmLabel: 'SQM',
14
+ };
15
+
16
+ const faq: BortleVisualizerLocaleContent['faq'] = [
17
+ {
18
+ question: '¿Qué es la Escala de Bortle?',
19
+ answer: 'Es una escala numérica de 9 puntos que mide el brillo del cielo nocturno en un lugar determinado. Fue creada por el astrónomo aficionado John E. Bortle en 2001 y publicada en Sky & Telescope. El Nivel 1 representa el cielo más oscuro posible (desiertos remotos) y el Nivel 9 el más contaminado (centros de ciudades).',
20
+ },
21
+ {
22
+ question: '¿Cuál es el nivel de Bortle mínimo para ver la Vía Láctea?',
23
+ answer: 'La Vía Láctea empieza a ser claramente visible a partir de Bortle 4 (zona rural/suburbana). En niveles 1 y 2 es espectacular, con estructura detallada y capaz de proyectar sombras tenues. En Bortle 6 en adelante es prácticamente invisible a simple vista.',
24
+ },
25
+ {
26
+ question: '¿Qué significa NELM y SQM?',
27
+ answer: 'NELM (Naked Eye Limiting Magnitude) es la magnitud de la estrella más tenue visible a simple vista bajo esas condiciones. SQM (Sky Quality Meter) mide el brillo del cielo en magnitudes por segundo de arco al cuadrado, siendo el estándar científico objetivo.',
28
+ },
29
+ {
30
+ question: '¿Cómo puedo mejorar el Bortle de mi zona de observación?',
31
+ answer: 'El Bortle de tu zona es fijo, pero puedes mejorar tu experiencia desplazándote. Consulta mapas de contaminación lumínica como lightpollutionmap.info para encontrar zonas Bortle 3 o menos a pocas horas. En España, zonas como Sierra Morena, Montsec o La Palma tienen certificación Starlight.',
32
+ },
33
+ ];
34
+
35
+ const howTo: BortleVisualizerLocaleContent['howTo'] = [
36
+ { name: '1. Ajusta el nivel de Bortle', text: 'Arrastra el slider para simular cómo aumenta la contaminación lumínica desde nivel 1 (desierto) hasta nivel 9 (centro ciudad).' },
37
+ { name: '2. Observa los efectos visuales', text: 'Fíjate cómo desaparecen las estrellas tenues, la Vía Láctea se desvanece y el cielo adquiere un tono anaranjado o grisáceo con cada nivel.' },
38
+ { name: '3. Identifica tu nivel actual', text: 'Compara lo que ves desde tu lugar habitual de observación con las simulaciones para identificar tu Bortle local.' },
39
+ ];
40
+
41
+ const bibliography: BortleVisualizerLocaleContent['bibliography'] = [
42
+ { name: 'Artículo Original de John E. Bortle (Sky & Telescope, 2001)', url: 'https://skyandtelescope.org/astronomy-resources/light-pollution-and-astronomy-the-bortle-dark-sky-scale/' },
43
+ { name: 'Light Pollution Map - Mapa Mundial', url: 'https://www.lightpollutionmap.info/' },
44
+ { name: 'Fundación Starlight - Reservas de Cielo Oscuro', url: 'https://fundacionstarlight.org/' },
45
+ { name: 'International Dark-Sky Association', url: 'https://www.darksky.org/' },
46
+ ];
47
+
48
+ const seo: BortleVisualizerLocaleContent['seo'] = [
49
+ {
50
+ type: 'summary',
51
+ title: 'Claves de la Escala de Bortle',
52
+ items: [
53
+ 'Bortle 1-2: Cielo oscuro de referencia, Vía Láctea proyecta sombras, NELM > 7.5.',
54
+ 'Bortle 3-4: Cielo rural óptimo, Vía Láctea visible con detalle pero horizonte contaminado.',
55
+ 'Bortle 5-6: Suburbano, Vía Láctea débil o invisible, bueno para planetas y luna.',
56
+ 'Bortle 7-9: Cielo urbano, solo objetos brillantes visibles a simple vista.',
57
+ ],
58
+ },
59
+ { type: 'title', text: 'La Escala de Bortle: Medir la Oscuridad del Cielo', level: 2 },
60
+ {
61
+ type: 'paragraph',
62
+ html: 'La <strong>Escala de Bortle</strong> es el sistema estándar internacional utilizado por astrónomos aficionados de todo el mundo para cuantificar la calidad del cielo nocturno. Creada por John E. Bortle, un observador veterano de cometas y objetos de cielo profundo de Nueva York, fue publicada en 2001 en la revista Sky & Telescope con el objetivo de proporcionar una escala objetiva y reproducible para comunicar las condiciones de observación.',
63
+ },
64
+ {
65
+ type: 'paragraph',
66
+ html: 'La escala va del <strong>nivel 1</strong> (el cielo más oscuro posible, encontrado solo en desiertos remotos y alta montaña alejados de toda civilización) al <strong>nivel 9</strong> (el interior de grandes ciudades, donde el cielo brilla con un resplandor anaranjado o blanquecino permanente y solo la Luna y los planetas más brillantes son visibles). Cada nivel tiene descriptores específicos que permiten identificarlo sin instrumentación.',
67
+ },
68
+ { type: 'title', text: 'Contaminación Lumínica: Una Crisis Global Silenciosa', level: 2 },
69
+ {
70
+ type: 'paragraph',
71
+ html: 'El crecimiento de la contaminación lumínica es uno de los problemas medioambientales menos discutidos pero más extendidos. Según estudios recientes, más del <strong>80% de la población mundial</strong> vive bajo cielos contaminados lumínicamente, y en Europa y Norteamérica el porcentaje supera el 99%. En España, la situación varía enormemente: desde las ciudades costeras con Bortle 8-9 hasta las zonas protegidas de la España interior con Bortle 2-3.',
72
+ },
73
+ {
74
+ type: 'paragraph',
75
+ html: 'Las consecuencias van más allá de la astronomía. La <strong>luz artificial nocturna</strong> altera los ritmos circadianos de humanos y animales, desorienta a aves migratorias, afecta a la reproducción de tortugas marinas y suprime la producción de melatonina en mamíferos. La IDA (International Dark-Sky Association) trabaja para designar Reservas de Cielo Oscuro en todo el mundo, y en España el programa Starlight ha certificado varias zonas de excelencia astronómica.',
76
+ },
77
+ {
78
+ type: 'table',
79
+ headers: ['Clase Bortle', 'NELM', 'SQM (mag/arcsec²)', 'Vía Láctea', 'Característica Clave'],
80
+ rows: [
81
+ ['1 - Excelente', '8.0', '21.99 - 22.0', 'Proyecta sombras', 'M33 visible a simple vista'],
82
+ ['2 - Oscuro Típico', '7.5', '21.89 - 21.99', 'Muy estructurada', 'Nubes = agujeros negros'],
83
+ ['3 - Rural', '7.0', '21.69 - 21.89', 'Compleja', 'Algo de luz en horizonte'],
84
+ ['4 - Rural/Suburbano', '6.5', '20.49 - 21.69', 'Visible', 'Domos de luz en horizonte'],
85
+ ['5 - Suburbano', '6.0', '19.50 - 20.49', 'Tenue', 'Cielo grisáceo'],
86
+ ['6 - Sub. Brillante', '5.5', '18.94 - 19.50', 'Invisible', 'M31 apenas visible'],
87
+ ['7 - Sub/Urbano', '5.0', '18.38 - 18.94', 'Ausente', 'Cielo gris claro'],
88
+ ['8 - Urbano', '4.5', '< 18.38', 'Ausente', 'Solo constelaciones principales'],
89
+ ['9 - Urbano Interior', '4.0', '< 18.00', 'Ausente', 'Solo Luna y planetas'],
90
+ ],
91
+ },
92
+ {
93
+ type: 'tip',
94
+ title: 'Medición Objetiva: El Sky Quality Meter',
95
+ html: 'Para mediciones precisas y reproducibles, los astrónomos utilizan el <strong>Sky Quality Meter (SQM)</strong>, un dispositivo que mide la luminancia del cielo en magnitudes por segundo de arco al cuadrado (mag/arcsec²). Un SQM de 22.0 corresponde a un cielo Bortle 1 excelente, mientras que un valor de 18.0 indica un cielo Bortle 8-9. Puedes consultar mediciones en tiempo real en la red Globe at Night.',
96
+ },
97
+ {
98
+ type: 'title',
99
+ text: 'Santuarios de Oscuridad: Las Mejores Zonas para Observar en España',
100
+ level: 2,
101
+ },
102
+ {
103
+ type: 'paragraph',
104
+ html: 'España cuenta con algunos de los mejores cielos oscuros de Europa. La combinación de geografía (alta meseta, relieves montañosos, islas volcánicas) y zonas despobladas hace que encontrar cielos Bortle 2-3 sea posible a pocas horas de cualquier ciudad. Las Reservas Starlight de Sierra Morena (la más grande del mundo con más de 400km²), Montsec en Lleida, el Valle del Jerte en Extremadura y toda la isla de La Palma (sede del Gran Telescopio Canarias) son destinos de referencia internacional para el astroturismo.',
105
+ },
106
+ {
107
+ type: 'diagnostic',
108
+ variant: 'success',
109
+ title: 'Herramienta de Planificación',
110
+ icon: 'mdi:map-marker-star',
111
+ badge: 'Pro Tip',
112
+ html: 'Antes de cualquier salida de observación, consulta el mapa de contaminación lumínica en lightpollutionmap.info para identificar zonas Bortle 3 o menores en un radio de 1-2 horas. Combínalo con las previsiones meteorológicas de Clear Outside o Meteoblue Astro para elegir la noche perfecta.',
113
+ },
114
+ ];
115
+
116
+ const faqSchema: WithContext<FAQPage> = {
117
+ '@context': 'https://schema.org',
118
+ '@type': 'FAQPage',
119
+ mainEntity: faq.map((item) => ({
120
+ '@type': 'Question',
121
+ name: item.question,
122
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
123
+ })),
124
+ };
125
+
126
+ const howToSchema: WithContext<HowTo> = {
127
+ '@context': 'https://schema.org',
128
+ '@type': 'HowTo',
129
+ name: title,
130
+ description,
131
+ step: howTo.map((step) => ({
132
+ '@type': 'HowToStep',
133
+ name: step.name,
134
+ text: step.text,
135
+ })),
136
+ };
137
+
138
+ const appSchema: WithContext<SoftwareApplication> = {
139
+ '@context': 'https://schema.org',
140
+ '@type': 'SoftwareApplication',
141
+ name: title,
142
+ description,
143
+ applicationCategory: 'UtilitiesApplication',
144
+ operatingSystem: 'Web',
145
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
146
+ inLanguage: 'es',
147
+ };
148
+
149
+ export const content: BortleVisualizerLocaleContent = {
150
+ slug,
151
+ title,
152
+ description,
153
+ ui,
154
+ seo,
155
+ faq,
156
+ faqTitle: 'Preguntas Frecuentes',
157
+ bibliography,
158
+ bibliographyTitle: 'Referencias Bibliográficas',
159
+ howTo,
160
+ schemas: [faqSchema as any, howToSchema as any, appSchema],
161
+ };
@@ -0,0 +1,153 @@
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { BortleVisualizerUI, BortleVisualizerLocaleContent } from '../index';
3
+
4
+ const slug = 'simulateur-ciel-sombre';
5
+ const title = 'Simulateur de Ciel Sombre (Échelle de Bortle)';
6
+ const description = 'Visualisez interactivement les 9 niveaux de l\'Échelle de Bortle et découvrez comment la pollution lumineuse efface le ciel nocturne étoilé.';
7
+
8
+ const ui: BortleVisualizerUI = {
9
+ toolTitle: 'Simulateur de Ciel Sombre',
10
+ sliderLabel: 'Faites glisser pour ajuster la pollution lumineuse',
11
+ classLabel: 'Classe Bortle',
12
+ nelmLabel: 'NELM',
13
+ sqmLabel: 'SQM',
14
+ };
15
+
16
+ const faq: BortleVisualizerLocaleContent['faq'] = [
17
+ {
18
+ question: 'Qu\'est-ce que l\'Échelle de Bortle?',
19
+ answer: 'C\'est une échelle numérique à 9 points qui mesure la luminosité du ciel nocturne à un endroit donné. Elle a été créée par l\'astronome amateur John E. Bortle en 2001 et publiée dans Sky & Telescope. Le niveau 1 représente le ciel le plus sombre possible (déserts isolés) et le niveau 9 le plus pollué (centres-villes).',
20
+ },
21
+ {
22
+ question: 'Quel est le niveau de Bortle minimum pour voir la Voie Lactée?',
23
+ answer: 'La Voie Lactée commence à être clairement visible à partir de Bortle 4 (zone rurale/suburbaine). Aux niveaux 1 et 2, elle est spectaculaire, avec une structure détaillée capable de projeter de faibles ombres. À partir de Bortle 6, elle est pratiquement invisible à l\'oeil nu.',
24
+ },
25
+ {
26
+ question: 'Que signifient NELM et SQM?',
27
+ answer: 'NELM (Naked Eye Limiting Magnitude) est la magnitude de l\'étoile la plus faible visible à l\'oeil nu dans ces conditions. SQM (Sky Quality Meter) mesure la luminosité du ciel en magnitudes par seconde d\'arc au carré, étant le standard scientifique objectif.',
28
+ },
29
+ {
30
+ question: 'Comment trouver des ciels plus sombres près de chez moi?',
31
+ answer: 'Utilisez des cartes de pollution lumineuse comme lightpollutionmap.info pour trouver des zones Bortle 3 ou moins à quelques heures de route. Les parcs nationaux, les zones de haute montagne et les réserves de ciel étoilé offrent les meilleures conditions.',
32
+ },
33
+ ];
34
+
35
+ const howTo: BortleVisualizerLocaleContent['howTo'] = [
36
+ { name: '1. Ajustez le niveau de Bortle', text: 'Faites glisser le curseur pour simuler comment la pollution lumineuse augmente du niveau 1 (désert) au niveau 9 (centre-ville).' },
37
+ { name: '2. Observez les effets visuels', text: 'Notez comment les étoiles faibles disparaissent, la Voie Lactée s\'estompe et le ciel prend une teinte orange ou grise à chaque niveau.' },
38
+ { name: '3. Identifiez votre niveau actuel', text: 'Comparez ce que vous voyez depuis votre lieu d\'observation habituel avec les simulations pour identifier votre niveau de Bortle local.' },
39
+ ];
40
+
41
+ const bibliography: BortleVisualizerLocaleContent['bibliography'] = [
42
+ { name: 'Article Original de John E. Bortle (Sky & Telescope, 2001)', url: 'https://skyandtelescope.org/astronomy-resources/light-pollution-and-astronomy-the-bortle-dark-sky-scale/' },
43
+ { name: 'Carte de Pollution Lumineuse Mondiale', url: 'https://www.lightpollutionmap.info/' },
44
+ { name: 'Association Internationale Ciel Sombre (IDA)', url: 'https://www.darksky.org/' },
45
+ { name: 'Globe at Night - Science Citoyenne', url: 'https://www.globeatnight.org/' },
46
+ ];
47
+
48
+ const seo: BortleVisualizerLocaleContent['seo'] = [
49
+ {
50
+ type: 'summary',
51
+ title: 'Points Clés de l\'Échelle de Bortle',
52
+ items: [
53
+ 'Bortle 1-2: Ciel sombre de référence, la Voie Lactée projette des ombres, NELM > 7.5.',
54
+ 'Bortle 3-4: Ciel rural optimal, Voie Lactée visible en détail mais horizon contaminé.',
55
+ 'Bortle 5-6: Suburbain, Voie Lactée faible ou invisible, bon pour planètes et lune.',
56
+ 'Bortle 7-9: Ciel urbain, seuls les objets brillants visibles à l\'oeil nu.',
57
+ ],
58
+ },
59
+ { type: 'title', text: 'L\'Échelle de Bortle: Mesurer l\'Obscurité du Ciel', level: 2 },
60
+ {
61
+ type: 'paragraph',
62
+ html: 'L\'<strong>Échelle de Bortle</strong> est le système standard international utilisé par les astronomes amateurs du monde entier pour quantifier la qualité du ciel nocturne. Créée par John E. Bortle, un observateur vétéran de comètes et d\'objets du ciel profond de New York, elle a été publiée en 2001 dans le magazine Sky & Telescope avec l\'objectif de fournir une échelle objective et reproductible pour communiquer les conditions d\'observation.',
63
+ },
64
+ {
65
+ type: 'paragraph',
66
+ html: 'L\'échelle va du <strong>niveau 1</strong> (le ciel le plus sombre possible, trouvé seulement dans des déserts isolés et en haute montagne loin de toute civilisation) au <strong>niveau 9</strong> (l\'intérieur des grandes villes, où le ciel brille d\'une lueur orange ou blanchâtre permanente et seule la Lune et les planètes les plus brillantes sont visibles). Chaque niveau possède des descripteurs spécifiques qui permettent son identification sans instrumentation.',
67
+ },
68
+ { type: 'title', text: 'Pollution Lumineuse: Une Crise Mondiale Silencieuse', level: 2 },
69
+ {
70
+ type: 'paragraph',
71
+ html: 'La croissance de la pollution lumineuse est l\'un des problèmes environnementaux les moins discutés mais les plus répandus. Selon des études récentes, plus de <strong>80% de la population mondiale</strong> vit sous des ciels pollués lumineusement, et en Europe et en Amérique du Nord le pourcentage dépasse 99%. Les conséquences vont au-delà de l\'astronomie: la lumière artificielle nocturne perturbe les rythmes circadiens des humains et des animaux, désoriente les oiseaux migrateurs et supprime la production de mélatonine chez les mammifères.',
72
+ },
73
+ {
74
+ type: 'table',
75
+ headers: ['Classe Bortle', 'NELM', 'SQM (mag/arcsec²)', 'Voie Lactée', 'Caractéristique'],
76
+ rows: [
77
+ ['1 - Excellent', '8.0', '21.99 - 22.0', 'Projette des ombres', 'M33 visible à l\'oeil nu'],
78
+ ['2 - Sombre Typique', '7.5', '21.89 - 21.99', 'Très structurée', 'Nuages = trous noirs'],
79
+ ['3 - Rural', '7.0', '21.69 - 21.89', 'Complexe', 'Quelque lumière à l\'horizon'],
80
+ ['4 - Rural/Suburbain', '6.5', '20.49 - 21.69', 'Visible', 'Dômes de lumière à l\'horizon'],
81
+ ['5 - Suburbain', '6.0', '19.50 - 20.49', 'Faible', 'Ciel grisâtre'],
82
+ ['6 - Sub. Brillant', '5.5', '18.94 - 19.50', 'Invisible', 'M31 à peine visible'],
83
+ ['7 - Sub/Urbain', '5.0', '18.38 - 18.94', 'Absente', 'Ciel gris clair'],
84
+ ['8 - Urbain', '4.5', '< 18.38', 'Absente', 'Constellations principales seulement'],
85
+ ['9 - Centre-Ville', '4.0', '< 18.00', 'Absente', 'Lune et planètes seulement'],
86
+ ],
87
+ },
88
+ {
89
+ type: 'tip',
90
+ title: 'Mesure Objective: le Sky Quality Meter',
91
+ html: 'Pour des mesures précises et reproductibles, les astronomes utilisent le <strong>Sky Quality Meter (SQM)</strong>, un dispositif qui mesure la luminance du ciel en magnitudes par seconde d\'arc au carré (mag/arcsec²). Un SQM de 22.0 correspond à un excellent ciel Bortle 1, tandis qu\'une valeur de 18.0 indique un ciel Bortle 8-9.',
92
+ },
93
+ { type: 'title', text: 'Trouver des Sanctuaires de Ciel Sombre', level: 2 },
94
+ {
95
+ type: 'paragraph',
96
+ html: 'Malgré la pollution lumineuse généralisée, des sanctuaires de ciel sombre existent encore. Les parcs nationaux, les réserves de ciel étoilé certifiées et les zones de haute montagne isolées offrent des conditions Bortle 2-4 accessibles en quelques heures depuis la plupart des grandes villes. L\'IDA maintient un registre mondial des lieux de ciel sombre certifiés, des petits parcs aux réserves insulaires entières. Planifier une sortie nocturne vers un endroit plus sombre transformera votre expérience astronomique plus que n\'importe quel achat d\'équipement.',
97
+ },
98
+ {
99
+ type: 'diagnostic',
100
+ variant: 'success',
101
+ title: 'Outil de Planification',
102
+ icon: 'mdi:map-marker-star',
103
+ badge: 'Conseil Pro',
104
+ html: 'Avant toute sortie d\'observation, consultez la carte de pollution lumineuse sur lightpollutionmap.info pour identifier les zones Bortle 3 ou moins dans un rayon de 1-2 heures. Combinez cela avec les prévisions météo astronomiques de Clear Outside ou Meteoblue Astro pour choisir la nuit parfaite.',
105
+ },
106
+ ];
107
+
108
+ const faqSchema: WithContext<FAQPage> = {
109
+ '@context': 'https://schema.org',
110
+ '@type': 'FAQPage',
111
+ mainEntity: faq.map((item) => ({
112
+ '@type': 'Question',
113
+ name: item.question,
114
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
115
+ })),
116
+ };
117
+
118
+ const howToSchema: WithContext<HowTo> = {
119
+ '@context': 'https://schema.org',
120
+ '@type': 'HowTo',
121
+ name: title,
122
+ description,
123
+ step: howTo.map((step) => ({
124
+ '@type': 'HowToStep',
125
+ name: step.name,
126
+ text: step.text,
127
+ })),
128
+ };
129
+
130
+ const appSchema: WithContext<SoftwareApplication> = {
131
+ '@context': 'https://schema.org',
132
+ '@type': 'SoftwareApplication',
133
+ name: title,
134
+ description,
135
+ applicationCategory: 'UtilitiesApplication',
136
+ operatingSystem: 'Web',
137
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
138
+ inLanguage: 'fr',
139
+ };
140
+
141
+ export const content: BortleVisualizerLocaleContent = {
142
+ slug,
143
+ title,
144
+ description,
145
+ ui,
146
+ seo,
147
+ faq,
148
+ faqTitle: 'Questions Fréquentes',
149
+ bibliography,
150
+ bibliographyTitle: 'Références Bibliographiques',
151
+ howTo,
152
+ schemas: [faqSchema as any, howToSchema as any, appSchema],
153
+ };
@@ -0,0 +1,41 @@
1
+ import type { AstronomyToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
+ import BortleVisualizerComponent from './component.astro';
3
+ import BortleVisualizerSEO from './seo.astro';
4
+ import BortleVisualizerBibliography from './bibliography.astro';
5
+
6
+ export interface BortleVisualizerUI {
7
+ [key: string]: string;
8
+ toolTitle: string;
9
+ sliderLabel: string;
10
+ classLabel: string;
11
+ nelmLabel: string;
12
+ sqmLabel: string;
13
+ }
14
+
15
+ export type BortleVisualizerLocaleContent = ToolLocaleContent<BortleVisualizerUI>;
16
+
17
+ import { content as es } from './i18n/es';
18
+ import { content as en } from './i18n/en';
19
+ import { content as fr } from './i18n/fr';
20
+
21
+ export const bortleVisualizer: AstronomyToolEntry<BortleVisualizerUI> = {
22
+ id: 'bortle-visualizer',
23
+ icons: {
24
+ bg: 'mdi:weather-night',
25
+ fg: 'mdi:telescope',
26
+ },
27
+ i18n: {
28
+ es: async () => es,
29
+ en: async () => en,
30
+ fr: async () => fr,
31
+ },
32
+ };
33
+
34
+ export { BortleVisualizerComponent, BortleVisualizerSEO, BortleVisualizerBibliography };
35
+
36
+ export const BORTLE_VISUALIZER_TOOL: ToolDefinition = {
37
+ entry: bortleVisualizer,
38
+ Component: BortleVisualizerComponent,
39
+ SEOComponent: BortleVisualizerSEO,
40
+ BibliographyComponent: BortleVisualizerBibliography,
41
+ };
@@ -0,0 +1,118 @@
1
+ export interface BortleClass {
2
+ level: number;
3
+ title: string;
4
+ description: string;
5
+ nelm: number;
6
+ sqm: string;
7
+ starsVisible: boolean;
8
+ milkyWayVisible: boolean;
9
+ cloudsLit: boolean;
10
+ skyBrightness: number;
11
+ }
12
+
13
+ export const BORTLE_SCALE: Record<number, BortleClass> = {
14
+ 1: {
15
+ level: 1,
16
+ title: 'Cielo Oscuro Excelente',
17
+ description: 'El nirvana astronómico. La Vía Láctea proyecta sombras. La luz zodiacal es visible y colorida. M33 es visible a simple vista.',
18
+ nelm: 8.0,
19
+ sqm: '21.99 - 22.0',
20
+ starsVisible: true,
21
+ milkyWayVisible: true,
22
+ cloudsLit: false,
23
+ skyBrightness: 0.0,
24
+ },
25
+ 2: {
26
+ level: 2,
27
+ title: 'Cielo Oscuro Típico',
28
+ description: 'Sitios realmente oscuros. La Vía Láctea es muy estructurada. Nubes solo visibles como agujeros negros en el cielo.',
29
+ nelm: 7.5,
30
+ sqm: '21.89 - 21.99',
31
+ starsVisible: true,
32
+ milkyWayVisible: true,
33
+ cloudsLit: false,
34
+ skyBrightness: 0.1,
35
+ },
36
+ 3: {
37
+ level: 3,
38
+ title: 'Cielo Rural',
39
+ description: 'Vía Láctea compleja. Alguna contaminación lumínica en el horizonte. Las nubes están iluminadas cerca del horizonte pero oscuras arriba.',
40
+ nelm: 7.0,
41
+ sqm: '21.69 - 21.89',
42
+ starsVisible: true,
43
+ milkyWayVisible: true,
44
+ cloudsLit: true,
45
+ skyBrightness: 0.2,
46
+ },
47
+ 4: {
48
+ level: 4,
49
+ title: 'Transición Rural/Suburbana',
50
+ description: 'La Vía Láctea pierde detalle pero se ve. Domos de luz en el horizonte. Las nubes están iluminadas por abajo.',
51
+ nelm: 6.5,
52
+ sqm: '20.49 - 21.69',
53
+ starsVisible: true,
54
+ milkyWayVisible: true,
55
+ cloudsLit: true,
56
+ skyBrightness: 0.35,
57
+ },
58
+ 5: {
59
+ level: 5,
60
+ title: 'Cielo Suburbano',
61
+ description: 'La Vía Láctea es muy débil o invisible cerca del horizonte. Luz zodiacal rara vez visible. El cielo se ve grisáceo, no negro.',
62
+ nelm: 6.0,
63
+ sqm: '19.50 - 20.49',
64
+ starsVisible: true,
65
+ milkyWayVisible: true,
66
+ cloudsLit: true,
67
+ skyBrightness: 0.5,
68
+ },
69
+ 6: {
70
+ level: 6,
71
+ title: 'Cielo Suburbano Brillante',
72
+ description: 'Vía Láctea invisible. El cielo es gris brillante. Nubes muy brillantes. M31 (Andrómeda) apenas visible.',
73
+ nelm: 5.5,
74
+ sqm: '18.94 - 19.50',
75
+ starsVisible: true,
76
+ milkyWayVisible: false,
77
+ cloudsLit: true,
78
+ skyBrightness: 0.65,
79
+ },
80
+ 7: {
81
+ level: 7,
82
+ title: 'Transición Suburbana/Urbana',
83
+ description: 'Fondo del cielo gris claro. Fuentes de luz fuertes en todas direcciones. Solo las estrellas más brillantes son visibles.',
84
+ nelm: 5.0,
85
+ sqm: '18.38 - 18.94',
86
+ starsVisible: true,
87
+ milkyWayVisible: false,
88
+ cloudsLit: true,
89
+ skyBrightness: 0.8,
90
+ },
91
+ 8: {
92
+ level: 8,
93
+ title: 'Cielo Urbano',
94
+ description: 'El cielo es gris blanquecino o naranja. Se pueden leer titulares de periódico. Solo se ven constelaciones principales.',
95
+ nelm: 4.5,
96
+ sqm: '< 18.38',
97
+ starsVisible: true,
98
+ milkyWayVisible: false,
99
+ cloudsLit: true,
100
+ skyBrightness: 0.9,
101
+ },
102
+ 9: {
103
+ level: 9,
104
+ title: 'Cielo Urbano Interior',
105
+ description: 'El cielo es muy brillante, incluso en el cenit. Solo se ven la Luna, planetas y un puñado de estrellas brillantes.',
106
+ nelm: 4.0,
107
+ sqm: '< 18.00',
108
+ starsVisible: false,
109
+ milkyWayVisible: false,
110
+ cloudsLit: true,
111
+ skyBrightness: 1.0,
112
+ },
113
+ };
114
+
115
+ export function getBortleData(level: number): BortleClass {
116
+ const safeLevel = Math.max(1, Math.min(9, Math.floor(level)));
117
+ return BORTLE_SCALE[safeLevel]!;
118
+ }