@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,163 @@
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { StarExposureCalculatorUI, StarExposureCalculatorLocaleContent } from '../index';
3
+
4
+ const slug = '500-rule-calculator';
5
+ const title = '500 Rule and NPF Astrophotography Calculator';
6
+ const description = 'Calculate the maximum exposure time for astrophotography without star trails. Classic 500 rule and high-precision NPF model for modern sensors.';
7
+
8
+ const ui: StarExposureCalculatorUI = {
9
+ toolTitle: '500 Rule Calculator',
10
+ modeLabel: 'Mode',
11
+ classicMode: 'Classic (500)',
12
+ npfMode: 'Precise (NPF)',
13
+ sensorLabel: 'Sensor (Crop Factor)',
14
+ focalLabel: 'Focal Length (mm)',
15
+ apertureLabel: 'Aperture (f/stop)',
16
+ megapixelsLabel: 'Megapixels (MP)',
17
+ declinationLabel: 'Celestial Declination',
18
+ equatorLabel: 'Equator',
19
+ poleLabel: 'Pole',
20
+ secondsUnit: 'seconds',
21
+ resultText: 'Maximum time for point stars.',
22
+ simLabel: 'Visual Simulation (200% Zoom)',
23
+ simRangeLabel: 'Simulate time excess',
24
+ pointStars: 'Stars as points',
25
+ trailStars: 'Star trail visible',
26
+ };
27
+
28
+ const faq: StarExposureCalculatorLocaleContent['faq'] = [
29
+ {
30
+ question: 'What happens if I exceed the calculated time?',
31
+ answer: 'If you exceed the maximum time, stars will begin to elongate instead of being sharp points. If the exposure is very long, you will get star trails, a valid artistic technique but requiring much longer times to be aesthetic.',
32
+ },
33
+ {
34
+ question: 'When should I use NPF instead of the 500 Rule?',
35
+ answer: 'The NPF model is more accurate and recommended for cameras with high-resolution sensors (24MP or more). With the classic 500 Rule you might get trails invisible on a 4x6 print but visible when printing large or viewing on a 4K monitor. If your goal is maximum sharpness, use NPF.',
36
+ },
37
+ {
38
+ question: 'How do I find the declination of the object I want to photograph?',
39
+ answer: 'You can use apps like Stellarium, SkySafari, or check star charts. As a general rule: the closer to the celestial pole (Dec 90°) the object is, the more exposure time you can afford.',
40
+ },
41
+ {
42
+ question: 'Does this calculator work with a star tracker?',
43
+ answer: 'Not for the sky itself, since the tracker compensates for rotation. However, it\'s vital for calculating the foreground shot where the tracker doesn\'t help, or for verifying if the motor is failing when you see unexpected trails.',
44
+ },
45
+ ];
46
+
47
+ const howTo: StarExposureCalculatorLocaleContent['howTo'] = [
48
+ { name: '1. Choose the calculation mode', text: 'Select Classic (500 Rule) for a quick estimate or NPF if you have a high-resolution sensor and seek maximum sharpness.' },
49
+ { name: '2. Configure your equipment', text: 'Enter the focal length of your lens and select the crop factor of your camera.' },
50
+ { name: '3. Adjust the declination', text: 'If photographing near the celestial pole, increase declination to allow longer exposures without trails.' },
51
+ { name: '4. Simulate time excess', text: 'Use the simulation slider to visualize how a star would look if you exceed the calculated time.' },
52
+ ];
53
+
54
+ const bibliography: StarExposureCalculatorLocaleContent['bibliography'] = [
55
+ { name: 'French Astronomical Society: The NPF Model', url: 'https://sahavre.fr/wp/regle-npf-rule/' },
56
+ { name: 'PetaPixel: Why the 500 Rule is No Longer Enough', url: 'https://petapixel.com/2015/01/06/avoid-star-trails-following-500-rule/' },
57
+ { name: 'Lonely Speck: Astrophotography Shutter Time Calculator', url: 'https://www.lonelyspeck.com/advanced-astrophotography-shutter-time-calculator/' },
58
+ ];
59
+
60
+ const seo: StarExposureCalculatorLocaleContent['seo'] = [
61
+ {
62
+ type: 'summary',
63
+ title: 'Key Points of the 500 Rule and NPF',
64
+ items: [
65
+ 'The 500 Rule is a valid approximation for low-resolution sensors and small-format viewing.',
66
+ 'The NPF model is more accurate for modern sensors with high pixel density.',
67
+ 'Celestial declination allows more exposure time near the poles (Dec 90°).',
68
+ 'Your sensor\'s crop factor multiplies the effective focal length and reduces maximum time.',
69
+ ],
70
+ },
71
+ { type: 'title', text: 'Mastering Astrophotography: 500 Rule and NPF Model', level: 2 },
72
+ {
73
+ type: 'paragraph',
74
+ html: 'Capturing the vastness of the night sky is one of the most rewarding challenges for any photographer. However, the first obstacle is Earth\'s rotation. If we leave the shutter open too long, those perfect points of light become unsightly trails. To get sharp point-like stars, we need to calculate the <strong>maximum exposure time</strong> using the 500 Rule or the NPF Model.',
75
+ },
76
+ { type: 'title', text: 'What is the 500 Rule?', level: 2 },
77
+ {
78
+ type: 'paragraph',
79
+ html: 'The <strong>500 Rule</strong> is a simplified empirical formula that has been the standard in landscape astrophotography for decades. Its formula is: <code>Time = 500 / (Focal Length × Crop Factor)</code>. It is quick, mental, and accurate enough for low-resolution sensors and small-format viewing.',
80
+ },
81
+ { type: 'title', text: 'The Crop Factor and Its Impact', level: 2 },
82
+ {
83
+ type: 'paragraph',
84
+ html: 'Many beginners forget that the 500 Rule is based on the 35mm (Full Frame) standard. If your camera has a smaller sensor, the field of view is narrower and star movement is magnified. A 14mm lens on an APS-C (1.5x crop) behaves like a 21mm equivalent, reducing maximum time from 35.7s to just 23.8s.',
85
+ },
86
+ {
87
+ type: 'table',
88
+ headers: ['Sensor', 'Crop', '14mm', '24mm', '50mm', '85mm'],
89
+ rows: [
90
+ ['Full Frame', 'x1.0', '35.7s', '20.8s', '10.0s', '5.9s'],
91
+ ['APS-C Nikon/Sony', 'x1.5', '23.8s', '13.9s', '6.7s', '3.9s'],
92
+ ['APS-C Canon', 'x1.6', '22.3s', '13.0s', '6.3s', '3.7s'],
93
+ ['Micro 4/3', 'x2.0', '17.9s', '10.4s', '5.0s', '2.9s'],
94
+ ],
95
+ },
96
+ { type: 'title', text: 'The NPF Model: Precision for Modern Sensors', level: 2 },
97
+ {
98
+ type: 'paragraph',
99
+ html: 'The 500 Rule was born in the film era. Today, with 24-60MP sensors, pixels are so small that trails are perceived much sooner. The <strong>NPF Model</strong>, developed by the French Astronomical Society, adds aperture and pixel density to the calculation: <code>t = (35×f + 30×p) / F</code>, where f is aperture, p is pixel pitch and F is focal length.',
100
+ },
101
+ {
102
+ type: 'tip',
103
+ title: 'Declination: The Advanced Photographer\'s Secret',
104
+ html: 'Stars near the <strong>celestial pole</strong> (Polaris in the northern hemisphere) trace very small circles in the sky. This means they move very slowly across your sensor, allowing much longer exposures. If photographing the area around Polaris, you can use double or triple the calculated time without trail visibility. Declination tells you how close to the celestial pole your target is.',
105
+ },
106
+ {
107
+ type: 'stats',
108
+ columns: 2,
109
+ items: [
110
+ { label: '500 Rule - 14mm FF', value: '35.7s', icon: 'mdi:timer' },
111
+ { label: 'NPF - 14mm f/2.8 24MP', value: '~12s', icon: 'mdi:timer-sand' },
112
+ { label: 'Dec 60° Correction', value: 'x2.0', icon: 'mdi:compass' },
113
+ { label: 'Dec 80° Correction', value: 'x5.8', icon: 'mdi:compass' },
114
+ ],
115
+ },
116
+ ];
117
+
118
+ const faqSchema: WithContext<FAQPage> = {
119
+ '@context': 'https://schema.org',
120
+ '@type': 'FAQPage',
121
+ mainEntity: faq.map((item) => ({
122
+ '@type': 'Question',
123
+ name: item.question,
124
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
125
+ })),
126
+ };
127
+
128
+ const howToSchema: WithContext<HowTo> = {
129
+ '@context': 'https://schema.org',
130
+ '@type': 'HowTo',
131
+ name: title,
132
+ description,
133
+ step: howTo.map((step) => ({
134
+ '@type': 'HowToStep',
135
+ name: step.name,
136
+ text: step.text,
137
+ })),
138
+ };
139
+
140
+ const appSchema: WithContext<SoftwareApplication> = {
141
+ '@context': 'https://schema.org',
142
+ '@type': 'SoftwareApplication',
143
+ name: title,
144
+ description,
145
+ applicationCategory: 'UtilitiesApplication',
146
+ operatingSystem: 'Web',
147
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
148
+ inLanguage: 'en',
149
+ };
150
+
151
+ export const content: StarExposureCalculatorLocaleContent = {
152
+ slug,
153
+ title,
154
+ description,
155
+ ui,
156
+ seo,
157
+ faq,
158
+ faqTitle: 'Frequently Asked Questions',
159
+ bibliography,
160
+ bibliographyTitle: 'Bibliographic References',
161
+ howTo,
162
+ schemas: [faqSchema as any, howToSchema as any, appSchema],
163
+ };
@@ -0,0 +1,163 @@
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { StarExposureCalculatorUI, StarExposureCalculatorLocaleContent } from '../index';
3
+
4
+ const slug = 'calculadora-regla-500';
5
+ const title = 'Calculadora Regla de los 500 y NPF';
6
+ const description = 'Calcula el tiempo de exposición máximo para astrofotografía sin trazas de estrellas. Regla de los 500 clásica y modelo NPF de alta precisión para sensores modernos.';
7
+
8
+ const ui: StarExposureCalculatorUI = {
9
+ toolTitle: 'Calculadora Regla de los 500',
10
+ modeLabel: 'Modo',
11
+ classicMode: 'Clásico (500)',
12
+ npfMode: 'Preciso (NPF)',
13
+ sensorLabel: 'Sensor (Factor de Recorte)',
14
+ focalLabel: 'Distancia Focal (mm)',
15
+ apertureLabel: 'Apertura (f/stop)',
16
+ megapixelsLabel: 'Megapíxeles (MP)',
17
+ declinationLabel: 'Declinación Celeste',
18
+ equatorLabel: 'Ecuador',
19
+ poleLabel: 'Polo',
20
+ secondsUnit: 'segundos',
21
+ resultText: 'Tiempo máximo para estrellas puntuales.',
22
+ simLabel: 'Simulación Visual (Zoom 200%)',
23
+ simRangeLabel: 'Simular exceso de tiempo',
24
+ pointStars: 'Estrellas como puntos',
25
+ trailStars: 'Trazo de estrella visible',
26
+ };
27
+
28
+ const faq: StarExposureCalculatorLocaleContent['faq'] = [
29
+ {
30
+ question: '¿Qué pasa si supero el tiempo calculado?',
31
+ answer: 'Si superas el tiempo máximo, las estrellas empezarán a alargarse en lugar de ser puntos nítidos. Si la exposición es muy larga, obtendrás star trails (trazos), una técnica artística válida pero que requiere tiempos mucho mayores para ser estética.',
32
+ },
33
+ {
34
+ question: '¿Cuándo debo usar NPF en lugar de la Regla de los 500?',
35
+ answer: 'El modelo NPF es más preciso y recomendable para cámaras con sensores de alta resolución (24MP o más). Con la Regla de los 500 clásica puedes obtener trazas invisibles en una pantalla de 10x15cm, pero visibles al imprimir grande o ver en un monitor 4K. Si tu objetivo es la máxima nitidez, usa NPF.',
36
+ },
37
+ {
38
+ question: '¿Cómo encuentro la declinación del objeto que quiero fotografiar?',
39
+ answer: 'Puedes usar aplicaciones como Stellarium, SkySafari o consultar cartas celestes. Como regla general: cuanto más cerca del polo celeste (Dec 90°) esté el objeto, más tiempo de exposición puedes permitirte.',
40
+ },
41
+ {
42
+ question: '¿Esta calculadora sirve con seguimiento (star tracker)?',
43
+ answer: 'No para el cielo en sí, ya que el tracker compensa la rotación. Sin embargo, es vital para calcular la toma del primer plano (foreground) donde el tracker no ayuda, o para verificar si el motor está fallando cuando ves trazas inesperadas.',
44
+ },
45
+ ];
46
+
47
+ const howTo: StarExposureCalculatorLocaleContent['howTo'] = [
48
+ { name: '1. Elige el modo de cálculo', text: 'Selecciona Clásico (Regla de los 500) para una estimación rápida o NPF si tienes sensor de alta resolución y buscas máxima nitidez.' },
49
+ { name: '2. Configura tu equipo', text: 'Introduce la distancia focal de tu objetivo y selecciona el factor de recorte de tu cámara.' },
50
+ { name: '3. Ajusta la declinación', text: 'Si fotografías cerca del polo celeste, aumenta la declinación para permitir exposiciones más largas sin trazas.' },
51
+ { name: '4. Simula el exceso de tiempo', text: 'Usa el slider de simulación para visualizar cómo se vería una estrella si superas el tiempo calculado.' },
52
+ ];
53
+
54
+ const bibliography: StarExposureCalculatorLocaleContent['bibliography'] = [
55
+ { name: 'Sociedad Astronómica de Francia: El Modelo NPF', url: 'https://sahavre.fr/wp/regle-npf-rule/' },
56
+ { name: 'PetaPixel: Why the 500 Rule is No Longer Enough', url: 'https://petapixel.com/2015/01/06/avoid-star-trails-following-500-rule/' },
57
+ { name: 'Lonely Speck: Astrophotography Shutter Time Calculator', url: 'https://www.lonelyspeck.com/advanced-astrophotography-shutter-time-calculator/' },
58
+ ];
59
+
60
+ const seo: StarExposureCalculatorLocaleContent['seo'] = [
61
+ {
62
+ type: 'summary',
63
+ title: 'Claves de la Regla de los 500 y NPF',
64
+ items: [
65
+ 'La Regla de los 500 es una aproximación válida para sensores de baja resolución y visualización en pequeño.',
66
+ 'El modelo NPF es más preciso para sensores modernos de alta densidad de píxeles.',
67
+ 'La declinación celeste permite más tiempo de exposición cerca de los polos (Dec 90°).',
68
+ 'El factor de recorte de tu sensor multiplica la focal efectiva y reduce el tiempo máximo.',
69
+ ],
70
+ },
71
+ { type: 'title', text: 'Dominando la Astrofotografía: Regla de los 500 y Modelo NPF', level: 2 },
72
+ {
73
+ type: 'paragraph',
74
+ html: 'Capturar la inmensidad del cielo nocturno es uno de los desafíos más gratificantes para cualquier fotógrafo. Sin embargo, el primer obstáculo es la rotación de la Tierra. Si dejamos el obturador abierto demasiado tiempo, esos puntos de luz perfectos se convierten en trazos antiestéticos. Para conseguir estrellas como puntos nítidos, necesitamos calcular el <strong>tiempo máximo de exposición</strong> con la Regla de los 500 o el Modelo NPF.',
75
+ },
76
+ { type: 'title', text: '¿Qué es la Regla de los 500?', level: 2 },
77
+ {
78
+ type: 'paragraph',
79
+ html: 'La <strong>Regla de los 500</strong> es una fórmula empírica simplificada que ha sido el estándar en la astrofotografía de paisaje durante décadas. Su fórmula es: <code>Tiempo = 500 / (Distancia Focal × Factor de Recorte)</code>. Es rápida, mental y suficientemente precisa para sensores de baja resolución y visualización en formatos pequeños.',
80
+ },
81
+ { type: 'title', text: 'El Factor de Recorte y su Impacto', level: 2 },
82
+ {
83
+ type: 'paragraph',
84
+ html: 'Muchos principiantes olvidan que la Regla de los 500 se basa en el estándar de 35mm (Full Frame). Si tu cámara tiene un sensor más pequeño, el campo de visión es más estrecho y el movimiento de las estrellas se magnifica. Un objetivo de 14mm en una APS-C (crop 1.5x) se comporta como un 21mm equivalente, reduciendo el tiempo máximo de 35.7s a solo 23.8s.',
85
+ },
86
+ {
87
+ type: 'table',
88
+ headers: ['Sensor', 'Crop', '14mm', '24mm', '50mm', '85mm'],
89
+ rows: [
90
+ ['Full Frame', 'x1.0', '35.7s', '20.8s', '10.0s', '5.9s'],
91
+ ['APS-C Nikon/Sony', 'x1.5', '23.8s', '13.9s', '6.7s', '3.9s'],
92
+ ['APS-C Canon', 'x1.6', '22.3s', '13.0s', '6.3s', '3.7s'],
93
+ ['Micro 4/3', 'x2.0', '17.9s', '10.4s', '5.0s', '2.9s'],
94
+ ],
95
+ },
96
+ { type: 'title', text: 'El Modelo NPF: Precisión para Sensores Modernos', level: 2 },
97
+ {
98
+ type: 'paragraph',
99
+ html: 'La Regla de los 500 nació en la era de la película. Hoy, con sensores de 24-60MP, los píxeles son tan pequeños que el trazo se percibe mucho antes. El <strong>Modelo NPF</strong>, desarrollado por la Sociedad Astronómica de Francia, añade la apertura y la densidad de píxeles al cálculo: <code>t = (35×f + 30×p) / F</code>, donde f es la apertura, p es el pixel pitch y F es la focal.',
100
+ },
101
+ {
102
+ type: 'tip',
103
+ title: 'La Declinación: El Secreto de los Fotógrafos Avanzados',
104
+ html: 'Las estrellas cercanas al <strong>polo celeste</strong> (Polaris en el hemisferio norte) describen círculos muy pequeños en el cielo. Esto significa que en la práctica se mueven muy lentamente sobre tu sensor, permitiendo exposiciones mucho más largas. Si fotografías la zona de Polaris, puedes usar el doble o el triple del tiempo calculado sin rastro de trazas. La declinación te dice qué tan cerca del polo celeste está tu objetivo.',
105
+ },
106
+ {
107
+ type: 'stats',
108
+ columns: 2,
109
+ items: [
110
+ { label: 'Regla 500 - 14mm FF', value: '35.7s', icon: 'mdi:timer' },
111
+ { label: 'NPF - 14mm f/2.8 24MP', value: '~12s', icon: 'mdi:timer-sand' },
112
+ { label: 'Corrección Dec 60°', value: 'x2.0', icon: 'mdi:compass' },
113
+ { label: 'Corrección Dec 80°', value: 'x5.8', icon: 'mdi:compass' },
114
+ ],
115
+ },
116
+ ];
117
+
118
+ const faqSchema: WithContext<FAQPage> = {
119
+ '@context': 'https://schema.org',
120
+ '@type': 'FAQPage',
121
+ mainEntity: faq.map((item) => ({
122
+ '@type': 'Question',
123
+ name: item.question,
124
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
125
+ })),
126
+ };
127
+
128
+ const howToSchema: WithContext<HowTo> = {
129
+ '@context': 'https://schema.org',
130
+ '@type': 'HowTo',
131
+ name: title,
132
+ description,
133
+ step: howTo.map((step) => ({
134
+ '@type': 'HowToStep',
135
+ name: step.name,
136
+ text: step.text,
137
+ })),
138
+ };
139
+
140
+ const appSchema: WithContext<SoftwareApplication> = {
141
+ '@context': 'https://schema.org',
142
+ '@type': 'SoftwareApplication',
143
+ name: title,
144
+ description,
145
+ applicationCategory: 'UtilitiesApplication',
146
+ operatingSystem: 'Web',
147
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
148
+ inLanguage: 'es',
149
+ };
150
+
151
+ export const content: StarExposureCalculatorLocaleContent = {
152
+ slug,
153
+ title,
154
+ description,
155
+ ui,
156
+ seo,
157
+ faq,
158
+ faqTitle: 'Preguntas Frecuentes',
159
+ bibliography,
160
+ bibliographyTitle: 'Referencias Bibliográficas',
161
+ howTo,
162
+ schemas: [faqSchema as any, howToSchema as any, appSchema],
163
+ };
@@ -0,0 +1,158 @@
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { StarExposureCalculatorUI, StarExposureCalculatorLocaleContent } from '../index';
3
+
4
+ const slug = 'calculateur-regle-500';
5
+ const title = 'Calculateur Règle des 500 et NPF';
6
+ const description = 'Calculez le temps d\'exposition maximum pour l\'astrophotographie sans traînées d\'étoiles. Règle des 500 classique et modèle NPF de haute précision pour les capteurs modernes.';
7
+
8
+ const ui: StarExposureCalculatorUI = {
9
+ toolTitle: 'Calculateur Règle des 500',
10
+ modeLabel: 'Mode',
11
+ classicMode: 'Classique (500)',
12
+ npfMode: 'Précis (NPF)',
13
+ sensorLabel: 'Capteur (Facteur de Recadrage)',
14
+ focalLabel: 'Longueur Focale (mm)',
15
+ apertureLabel: 'Ouverture (f/stop)',
16
+ megapixelsLabel: 'Mégapixels (MP)',
17
+ declinationLabel: 'Déclinaison Céleste',
18
+ equatorLabel: 'Équateur',
19
+ poleLabel: 'Pôle',
20
+ secondsUnit: 'secondes',
21
+ resultText: 'Temps maximum pour des étoiles ponctuelles.',
22
+ simLabel: 'Simulation Visuelle (Zoom 200%)',
23
+ simRangeLabel: 'Simuler un excès de temps',
24
+ pointStars: 'Étoiles en points',
25
+ trailStars: 'Traînée d\'étoile visible',
26
+ };
27
+
28
+ const faq: StarExposureCalculatorLocaleContent['faq'] = [
29
+ {
30
+ question: 'Que se passe-t-il si je dépasse le temps calculé?',
31
+ answer: 'Si vous dépassez le temps maximum, les étoiles commenceront à s\'allonger au lieu d\'être des points nets. Si l\'exposition est très longue, vous obtiendrez des traînées d\'étoiles (star trails), une technique artistique valide mais qui nécessite des temps beaucoup plus longs pour être esthétique.',
32
+ },
33
+ {
34
+ question: 'Quand dois-je utiliser NPF plutôt que la Règle des 500?',
35
+ answer: 'Le modèle NPF est plus précis et recommandé pour les appareils photo avec des capteurs haute résolution (24MP ou plus). Avec la Règle des 500 classique, vous pourriez obtenir des traînées invisibles sur une impression 10x15cm, mais visibles lors d\'une grande impression ou sur un moniteur 4K. Si votre objectif est la netteté maximale, utilisez NPF.',
36
+ },
37
+ {
38
+ question: 'Comment trouver la déclinaison de l\'objet que je veux photographier?',
39
+ answer: 'Vous pouvez utiliser des applications comme Stellarium, SkySafari ou consulter des cartes célestes. En règle générale: plus l\'objet est proche du pôle céleste (Dec 90°), plus vous pouvez vous permettre un temps d\'exposition long.',
40
+ },
41
+ {
42
+ question: 'Ce calculateur fonctionne-t-il avec un suiveur d\'étoiles?',
43
+ answer: 'Pas pour le ciel lui-même, car le suiveur compense la rotation. Cependant, il est vital pour calculer la prise du premier plan où le suiveur n\'aide pas, ou pour vérifier si le moteur est défaillant lorsque vous voyez des traînées inattendues.',
44
+ },
45
+ ];
46
+
47
+ const howTo: StarExposureCalculatorLocaleContent['howTo'] = [
48
+ { name: '1. Choisissez le mode de calcul', text: 'Sélectionnez Classique (Règle des 500) pour une estimation rapide ou NPF si vous avez un capteur haute résolution et recherchez une netteté maximale.' },
49
+ { name: '2. Configurez votre équipement', text: 'Entrez la longueur focale de votre objectif et sélectionnez le facteur de recadrage de votre appareil photo.' },
50
+ { name: '3. Ajustez la déclinaison', text: 'Si vous photographiez près du pôle céleste, augmentez la déclinaison pour permettre des expositions plus longues sans traînées.' },
51
+ { name: '4. Simulez l\'excès de temps', text: 'Utilisez le curseur de simulation pour visualiser à quoi ressemblerait une étoile si vous dépassez le temps calculé.' },
52
+ ];
53
+
54
+ const bibliography: StarExposureCalculatorLocaleContent['bibliography'] = [
55
+ { name: 'Société Astronomique de France: Le Modèle NPF', url: 'https://sahavre.fr/wp/regle-npf-rule/' },
56
+ { name: 'PetaPixel: Pourquoi la Règle des 500 ne suffit plus', url: 'https://petapixel.com/2015/01/06/avoid-star-trails-following-500-rule/' },
57
+ { name: 'Lonely Speck: Calculateur de Temps d\'Obturation', url: 'https://www.lonelyspeck.com/advanced-astrophotography-shutter-time-calculator/' },
58
+ ];
59
+
60
+ const seo: StarExposureCalculatorLocaleContent['seo'] = [
61
+ {
62
+ type: 'summary',
63
+ title: 'Points Clés de la Règle des 500 et NPF',
64
+ items: [
65
+ 'La Règle des 500 est une approximation valide pour les capteurs basse résolution et la visualisation petit format.',
66
+ 'Le modèle NPF est plus précis pour les capteurs modernes à haute densité de pixels.',
67
+ 'La déclinaison céleste permet plus de temps d\'exposition près des pôles (Dec 90°).',
68
+ 'Le facteur de recadrage de votre capteur multiplie la focale effective et réduit le temps maximum.',
69
+ ],
70
+ },
71
+ { type: 'title', text: 'Maîtriser l\'Astrophotographie: Règle des 500 et Modèle NPF', level: 2 },
72
+ {
73
+ type: 'paragraph',
74
+ html: 'Capturer l\'immensité du ciel nocturne est l\'un des défis les plus gratifiants pour tout photographe. Cependant, le premier obstacle est la rotation de la Terre. Si nous laissons l\'obturateur ouvert trop longtemps, ces points de lumière parfaits deviennent des traînées disgracieuses. Pour obtenir des étoiles comme des points nets, nous devons calculer le <strong>temps d\'exposition maximum</strong> avec la Règle des 500 ou le Modèle NPF.',
75
+ },
76
+ { type: 'title', text: 'Qu\'est-ce que la Règle des 500?', level: 2 },
77
+ {
78
+ type: 'paragraph',
79
+ html: 'La <strong>Règle des 500</strong> est une formule empirique simplifiée qui a été la norme en astrophotographie de paysage depuis des décennies. Sa formule est: <code>Temps = 500 / (Longueur Focale × Facteur de Recadrage)</code>. Elle est rapide, mentale et suffisamment précise pour les capteurs basse résolution et la visualisation en petits formats.',
80
+ },
81
+ { type: 'title', text: 'Le Modèle NPF: Précision pour Capteurs Modernes', level: 2 },
82
+ {
83
+ type: 'paragraph',
84
+ html: 'La Règle des 500 est née à l\'ère de la pellicule. Aujourd\'hui, avec des capteurs de 24-60MP, les pixels sont si petits que les traînées se perçoivent beaucoup plus tôt. Le <strong>Modèle NPF</strong>, développé par la Société Astronomique de France, ajoute l\'ouverture et la densité de pixels au calcul: <code>t = (35×f + 30×p) / F</code>, où f est l\'ouverture, p est le pitch de pixel et F est la focale.',
85
+ },
86
+ {
87
+ type: 'table',
88
+ headers: ['Capteur', 'Crop', '14mm', '24mm', '50mm', '85mm'],
89
+ rows: [
90
+ ['Full Frame', 'x1.0', '35.7s', '20.8s', '10.0s', '5.9s'],
91
+ ['APS-C Nikon/Sony', 'x1.5', '23.8s', '13.9s', '6.7s', '3.9s'],
92
+ ['APS-C Canon', 'x1.6', '22.3s', '13.0s', '6.3s', '3.7s'],
93
+ ['Micro 4/3', 'x2.0', '17.9s', '10.4s', '5.0s', '2.9s'],
94
+ ],
95
+ },
96
+ {
97
+ type: 'tip',
98
+ title: 'La Déclinaison: Le Secret des Photographes Avancés',
99
+ html: 'Les étoiles proches du <strong>pôle céleste</strong> (Polaris dans l\'hémisphère nord) décrivent de très petits cercles dans le ciel. Cela signifie qu\'elles se déplacent très lentement sur votre capteur, permettant des expositions beaucoup plus longues. Si vous photographiez la zone autour de Polaris, vous pouvez utiliser le double ou le triple du temps calculé sans traînées visibles.',
100
+ },
101
+ {
102
+ type: 'stats',
103
+ columns: 2,
104
+ items: [
105
+ { label: 'Règle 500 - 14mm FF', value: '35.7s', icon: 'mdi:timer' },
106
+ { label: 'NPF - 14mm f/2.8 24MP', value: '~12s', icon: 'mdi:timer-sand' },
107
+ { label: 'Correction Dec 60°', value: 'x2.0', icon: 'mdi:compass' },
108
+ { label: 'Correction Dec 80°', value: 'x5.8', icon: 'mdi:compass' },
109
+ ],
110
+ },
111
+ ];
112
+
113
+ const faqSchema: WithContext<FAQPage> = {
114
+ '@context': 'https://schema.org',
115
+ '@type': 'FAQPage',
116
+ mainEntity: faq.map((item) => ({
117
+ '@type': 'Question',
118
+ name: item.question,
119
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
120
+ })),
121
+ };
122
+
123
+ const howToSchema: WithContext<HowTo> = {
124
+ '@context': 'https://schema.org',
125
+ '@type': 'HowTo',
126
+ name: title,
127
+ description,
128
+ step: howTo.map((step) => ({
129
+ '@type': 'HowToStep',
130
+ name: step.name,
131
+ text: step.text,
132
+ })),
133
+ };
134
+
135
+ const appSchema: WithContext<SoftwareApplication> = {
136
+ '@context': 'https://schema.org',
137
+ '@type': 'SoftwareApplication',
138
+ name: title,
139
+ description,
140
+ applicationCategory: 'UtilitiesApplication',
141
+ operatingSystem: 'Web',
142
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
143
+ inLanguage: 'fr',
144
+ };
145
+
146
+ export const content: StarExposureCalculatorLocaleContent = {
147
+ slug,
148
+ title,
149
+ description,
150
+ ui,
151
+ seo,
152
+ faq,
153
+ faqTitle: 'Questions Fréquentes',
154
+ bibliography,
155
+ bibliographyTitle: 'Références Bibliographiques',
156
+ howTo,
157
+ schemas: [faqSchema as any, howToSchema as any, appSchema],
158
+ };
@@ -0,0 +1,53 @@
1
+ import type { AstronomyToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
+ import StarExposureCalculatorComponent from './component.astro';
3
+ import StarExposureCalculatorSEO from './seo.astro';
4
+ import StarExposureCalculatorBibliography from './bibliography.astro';
5
+
6
+ export interface StarExposureCalculatorUI {
7
+ [key: string]: string;
8
+ toolTitle: string;
9
+ modeLabel: string;
10
+ classicMode: string;
11
+ npfMode: string;
12
+ sensorLabel: string;
13
+ focalLabel: string;
14
+ apertureLabel: string;
15
+ megapixelsLabel: string;
16
+ declinationLabel: string;
17
+ equatorLabel: string;
18
+ poleLabel: string;
19
+ secondsUnit: string;
20
+ resultText: string;
21
+ simLabel: string;
22
+ simRangeLabel: string;
23
+ pointStars: string;
24
+ trailStars: string;
25
+ }
26
+
27
+ export type StarExposureCalculatorLocaleContent = ToolLocaleContent<StarExposureCalculatorUI>;
28
+
29
+ import { content as es } from './i18n/es';
30
+ import { content as en } from './i18n/en';
31
+ import { content as fr } from './i18n/fr';
32
+
33
+ export const starExposureCalculator: AstronomyToolEntry<StarExposureCalculatorUI> = {
34
+ id: 'star-exposure-calculator',
35
+ icons: {
36
+ bg: 'mdi:star-shooting',
37
+ fg: 'mdi:timer-sand',
38
+ },
39
+ i18n: {
40
+ es: async () => es,
41
+ en: async () => en,
42
+ fr: async () => fr,
43
+ },
44
+ };
45
+
46
+ export { StarExposureCalculatorComponent, StarExposureCalculatorSEO, StarExposureCalculatorBibliography };
47
+
48
+ export const STAR_EXPOSURE_CALCULATOR_TOOL: ToolDefinition = {
49
+ entry: starExposureCalculator,
50
+ Component: StarExposureCalculatorComponent,
51
+ SEOComponent: StarExposureCalculatorSEO,
52
+ BibliographyComponent: StarExposureCalculatorBibliography,
53
+ };
@@ -0,0 +1,49 @@
1
+ export type SensorCropFactor = 1.0 | 1.5 | 1.6 | 2.0;
2
+ export type CalculatorMode = 'classic' | 'npf';
3
+
4
+ export interface ExposureParams {
5
+ mode: CalculatorMode;
6
+ focalLength: number;
7
+ cropFactor: SensorCropFactor;
8
+ aperture: number;
9
+ megapixels: number;
10
+ declination: number;
11
+ }
12
+
13
+ export function calculateClassicTime(focalLength: number, cropFactor: number): number {
14
+ return 500 / (focalLength * cropFactor);
15
+ }
16
+
17
+ export function calculateNPFTime(
18
+ focalLength: number,
19
+ cropFactor: number,
20
+ aperture: number,
21
+ megapixels: number,
22
+ ): number {
23
+ const sensorWidth = 36 / cropFactor;
24
+ const pixelPitch = Math.sqrt((sensorWidth * sensorWidth) / (1.5 * megapixels * 1e6)) * 1000;
25
+ return (35 * aperture + 30 * pixelPitch) / focalLength;
26
+ }
27
+
28
+ export function applyDeclinationCorrection(baseTime: number, declinationDeg: number): number {
29
+ const declinationRad = declinationDeg * (Math.PI / 180);
30
+ return baseTime / Math.cos(declinationRad);
31
+ }
32
+
33
+ export function calculateExposureTime(params: ExposureParams): number {
34
+ const { mode, focalLength, cropFactor, aperture, megapixels, declination } = params;
35
+ let baseTime: number;
36
+ if (mode === 'classic') {
37
+ baseTime = calculateClassicTime(focalLength, cropFactor);
38
+ } else {
39
+ baseTime = calculateNPFTime(focalLength, cropFactor, aperture, megapixels);
40
+ }
41
+ return applyDeclinationCorrection(baseTime, declination);
42
+ }
43
+
44
+ export const SENSOR_OPTIONS: { value: SensorCropFactor; label: string }[] = [
45
+ { value: 1.0, label: 'Full Frame (x1.0)' },
46
+ { value: 1.5, label: 'APS-C Nikon/Sony/Fuji (x1.5)' },
47
+ { value: 1.6, label: 'APS-C Canon (x1.6)' },
48
+ { value: 2.0, label: 'Micro Four Thirds (x2.0)' },
49
+ ];
@@ -0,0 +1,61 @@
1
+ ---
2
+ import {
3
+ SEOTitle,
4
+ SEOTable,
5
+ SEOTip,
6
+ SEOCard,
7
+ SEOStats,
8
+ SEOGlossary,
9
+ SEOProsCons,
10
+ SEOSummary,
11
+ SEODiagnostic,
12
+ SEOArticle
13
+ } from '@jjlmoya/utils-shared';
14
+ import { starExposureCalculator } from './index';
15
+ import type { KnownLocale } from '../../types';
16
+
17
+ interface Props {
18
+ locale?: KnownLocale;
19
+ }
20
+
21
+ const { locale = 'es' } = Astro.props;
22
+ const content = await starExposureCalculator.i18n[locale]?.();
23
+ if (!content) return null;
24
+
25
+ const { seo } = content;
26
+ ---
27
+
28
+ <SEOArticle>
29
+ {seo.map((section: any) => {
30
+ switch (section.type) {
31
+ case 'summary':
32
+ return <SEOSummary title={section.title} items={section.items} />;
33
+ case 'title':
34
+ return <SEOTitle title={section.text} level={section.level || 2} />;
35
+ case 'paragraph':
36
+ return <p set:html={section.html} />;
37
+ case 'stats':
38
+ return <SEOStats stats={section.items} columns={section.columns} />;
39
+ case 'card':
40
+ return <SEOCard title={section.title} icon={section.icon}><Fragment set:html={section.html} /></SEOCard>;
41
+ case 'tip':
42
+ return <SEOTip title={section.title}><Fragment set:html={section.html} /></SEOTip>;
43
+ case 'table':
44
+ return (
45
+ <SEOTable headers={section.headers}>
46
+ {section.rows.map((row: string[]) => (
47
+ <tr>{row.map((cell: string) => <td set:html={cell} />)}</tr>
48
+ ))}
49
+ </SEOTable>
50
+ );
51
+ case 'proscons':
52
+ return <SEOProsCons title={section.title} items={section.items} />;
53
+ case 'diagnostic':
54
+ return <SEODiagnostic title={section.title} icon={section.icon} type={section.variant} badge={section.badge}><Fragment set:html={section.html} /></SEODiagnostic>;
55
+ case 'glossary':
56
+ return <SEOGlossary items={section.items} />;
57
+ default:
58
+ return null;
59
+ }
60
+ })}
61
+ </SEOArticle>
@@ -0,0 +1,5 @@
1
+ .star-calc-wrapper {
2
+ width: 100%;
3
+ max-width: 56rem;
4
+ margin: 0 auto;
5
+ }