← Herramienta ← Tool Manual de niebla Fog manual Portada Home

Manual: cielo para astrofotografía

Índice de calidad de cielo nocturno y fusión bayesiana multimodelo.

1. Qué es

Aplicación complementaria de la de niebla. Misma arquitectura (HTML autónomo, Open‑Meteo sin clave, dos pestañas, registro local con aprendizaje bayesiano), pero el objetivo es el contrario: predecir si la noche será útil para fotografiar el cielo. Combina la previsión meteorológica (nubes por capas, humedad, viento en superficie y en altura, punto de rocío), la composición atmosférica (profundidad óptica de aerosoles, AOD, del modelo CAMS) y la astronomía calculada localmente (altura del Sol y de la Luna, fase lunar). Se instala y se sirve igual que la de niebla: ambas pueden convivir en el mismo repositorio de GitHub Pages y están enlazadas entre sí.

2. Controles comunes

ControlFunción
Latitud, LongitudPunto de observación. También “Usar mi posición”.
ObjetivoReescala los pesos del índice. Cielo profundo: equilibrado, penaliza Luna y humedad. Planetaria / Luna: prima el seeing (viento en altura y en superficie) y casi ignora la Luna. Paisaje nocturno / Vía Láctea: penaliza fuertemente la Luna y la humedad (bruma de horizonte) y apenas valora el seeing.
ES / ENIdioma, compartido con la aplicación de niebla.

3. Pestaña 1: índice de cielo

Tarjetas. “Esta noche” y “Mañana por la noche”: para cada noche astronómica del intervalo (horas con Sol por debajo de −12°), el índice medio del mejor tramo de 3 horas, s₃, con su horario, la media de toda la noche, el intervalo de noche astronómica (Sol < −18°) y la Luna: iluminación y horas en que está sobre el horizonte.

Banda horaria. 48 horas. Verde ≥ 70 excelente, ámbar 50 a 69 aceptable, rojo < 50 malo. Fondo más oscuro en noche astronómica. La hora aparece en ámbar si la Luna está sobre el horizonte. Pasa el ratón para ver qué penaliza cada hora.

Gráfica. Índice (verde grueso), nubes totales (gris), nubes altas (azul discontinuo), altura de la Luna como área ámbar cuya opacidad crece con la iluminación, y fondo azul oscuro en noche astronómica.

Tabla. Índice, nubes totales y por capas, HR, T − Td, viento a 10 m y a 250 hPa, AOD, altura e iluminación de la Luna y altura del Sol.

4. El índice

Cada término se normaliza entre 0 y 1 y se pondera según el objetivo; la suma se reescala a 100 y se multiplica por el factor de oscuridad.

TérminoCálculoPeso (profundo / planetaria / paisaje)Por qué
Nubes(1 − c/100)² con c = máx(total, 0.9·bajas + 0.7·medias + 0.45·altas)45 / 45 / 45Condición dominante. Los cirros densos arruinan la noche aunque el total sea moderado; por eso las capas entran ponderadas. El cuadrado hace que un 30 % de nubes ya cueste la mitad.
TransparenciaAOD 550 nm: < 0.08 → 1, < 0.15 → 0.73, < 0.3 → 0.4, < 0.5 → 0.13, más → 015 / 8 / 12Aerosoles (polvo sahariano, humo, calima) reducen el contraste y el alcance en magnitud. Sin AOD se usa 0.7 (neutro).
HumedadHR: < 60 → 1, < 75 → 0.7, < 85 → 0.4, < 92 → 0.2, más → 010 / 6 / 14Bruma de horizonte, halos, pérdida de transparencia y rocío.
Seeing0.6·(viento 250 hPa: < 50 → 1, < 90 → 0.66, < 130 → 0.33, más → 0) + 0.4·(viento 10 m: < 10 → 1, < 20 → 0.66, < 30 → 0.33)15 / 30 / 4El viento en la corriente en chorro es el mejor predictor barato de turbulencia de alta atmósfera; el viento en superficie añade turbulencia local y vibración de la montura.
RocíoT − Td: > 4 → 1, > 2 → 0.6, > 1 → 0.2, menos → 05 / 5 / 5Riesgo de condensación en la óptica. Aviso para llevar cintas calefactoras.
Lunabajo el horizonte → 1; si no, (1 − iluminación)·(1 − 0.7·sen(altura))10 / 1 / 20Fondo de cielo. Luna llena alta destruye el cielo profundo y la Vía Láctea; no molesta para planetaria.
OscuridadSol > −6° → 0 · −6 a −12° → 0.3 · −12 a −18° → 0.7 · < −18° → 1factorCrepúsculos civil, náutico y astronómico.
Lluviaprecipitación ≥ 0.1 mm/h → índice 0anulaciónAnterior a todo lo demás: bajo un chubasco no hay noche que puntuar. Antes el dato se descargaba y se ignoraba, y un 60 % de nubes con 0.4 mm/h salía en ámbar. La consecuencia sobre el aprendizaje es que esas noches pasan de p ≈ 0.1 a 0.005 (el mínimo del clamp): el registro anterior a este cambio queda ligeramente desplazado en las noches lluviosas.

Las rachas de viento (wind_gusts_10m) se descargan y aparecen en la tabla horaria y en el veredicto en frase cuando llegan a 35 km/h en la noche, pero no entran en el índice: el viento medio ya está en el término de seeing y contarlas dos veces desplazaría la escala de p_of(s) y descalibraría el registro. Lo mismo vale para el núcleo galáctico, que se calcula y se informa pero no puntúa.

5. Pestaña 2: fusión bayesiana

Se descargan en paralelo los modelos seleccionados (mismo mecanismo y mismos modelos que en la aplicación de niebla, con límite de 12 s y selección persistente). Para cada modelo se calcula el índice horario y, en la noche de referencia (la primera noche astronómica del intervalo), s₃. La probabilidad de “noche útil” es p_m = σ((s₃ − 58)/12). El posterior se obtiene formando el consenso de los modelos (media ponderada en log‑odds, siempre dentro de la envolvente) y contrayéndolo hacia la climatología: logit P = logit π + γ·(logit p̄ − logit π), con γ ajustable entre 0.1 y 1 y prior Beta que se actualiza con tus noches, igual que en la aplicación de niebla (ver su manual, sección 5).

Tarjetas: posterior de noche útil con rango entre modelos e intervalo de noche astronómica; dispersión entre modelos; Luna. La gráfica muestra, hora a hora, la probabilidad de cada modelo y el posterior. La tabla “Esta noche por modelo” resume, por modelo, P útil, s₃, nubes totales y altas medias, HR media, viento a 250 hPa medio y el horario del mejor tramo.

La AOD procede de un único modelo (CAMS) y es común a todos los modelos meteorológicos; por tanto las diferencias entre modelos reflejan nubes, humedad y viento. Conviene tenerlo en cuenta al interpretar el acuerdo entre ellos: un acuerdo alto no cubre la incertidumbre de la transparencia.

6. Entrenamiento

Idéntico a la aplicación de niebla. Cada cálculo en la pestaña 2 congela automáticamente las probabilidades de cada modelo para la noche de referencia, asociadas a la fecha del atardecer. Al día siguiente el campo “Noche del” propone ya esa fecha; eliges Útil (despejado la mayor parte de la noche astronómica), Parcial (nubes intermitentes, sesión aprovechable a ratos) o Inútil (cubierto, bruma o rocío que impidió trabajar), y guardas. La observación se empareja con la previsión congelada la víspera; si no calculaste esa tarde, se guarda como pendiente y solo actualiza el prior.

Criterio de anotación: anota lo que viste en la ventana de noche astronómica en tu sitio habitual, no lo que dijo una estación lejana. Si la noche fue útil pese a un seeing malo, sigue siendo “Útil”: el registro entrena la probabilidad de poder trabajar, no la calidad de imagen.

Calibración de α: la pestaña 2 dibuja sola un diagrama de fiabilidad, en la sección «Calibración» junto a la tabla de pesos: agrupa las noches del registro por posterior congelado (0–25 %, 25–50 %, 50–75 %, 75–100 %) y pinta cada grupo como un punto (posterior medio, frecuencia real de noches útiles) sobre la diagonal de calibración perfecta, con área proporcional al número de noches. Si las frecuencias reales son sistemáticamente más extremas que el posterior, sube α; si son menos extremas, bájalo; si los puntos se pegan a la diagonal, déjalo como está. Orientativo a partir de unas 10 noches, fiable a partir de 30.

7. Datos y privacidad

El registro se guarda en localStorage bajo las claves astro_bayes y astro_models, independientes de las de niebla (niebla_*), aunque comparten el idioma. Las mismas reglas de persistencia: por navegador y por origen, se pierde al borrar datos del sitio, no se sincroniza entre dispositivos. Exporta el JSON (astro_observaciones.json) tras cada tanda de anotaciones y súbelo al repositorio.

8. Interpretación

Noche excelente de cielo profundo: nubes altas por debajo del 10 % durante toda la noche astronómica, AOD < 0.1, HR < 70 %, viento a 250 hPa < 60 km/h, Luna bajo el horizonte. Con todo eso el índice ronda 90. Un 70 con Luna al 40 % baja en el horizonte sigue siendo una noche buena para objetos brillantes o banda estrecha.

Planetaria: ignora el índice de cielo profundo y usa el objetivo “Planetaria”. Lo que cuenta es el viento en altura y en superficie, y la ausencia de nubes; la Luna da igual y una HR alta en noche estable puede ir con seeing excelente.

Vía Láctea y paisaje: la humedad y la bruma de horizonte importan más que en cielo profundo porque fotografías cerca del horizonte; el objetivo “Paisaje nocturno” lo recoge. La AOD alta (calima) es especialmente destructiva.

Desacuerdo entre modelos en nubes altas es frecuente: los cirros son lo peor previsto. Si la dispersión es alta, reconsulta por la tarde y mira las nubes altas en la tabla por modelo.

9. Límites conocidos

El seeing real depende de la turbulencia integrada en toda la columna y de la topografía local; el viento a 250 hPa es un proxy, no una medida. No hay contaminación lumínica: el índice no sabe si estás en Bortle 3 o 7, eso lo pones tú al elegir sitio. La astronomía es de baja precisión (error menor de medio grado), suficiente para crepúsculos y Luna, no para efemérides finas. La AOD de CAMS tiene resolución de decenas de kilómetros. Las nubes por capas no están disponibles en todos los modelos: si faltan, se usa el total para las bajas y cero para medias y altas.

10. Ajustes

En astro.html: el objeto WEIGHTS define los pesos por objetivo; score() contiene los umbrales de cada término; las constantes A0, B0, LAMBDA, TH, KAP, TIMEOUT controlan la fusión igual que en niebla; γ se ajusta desde la interfaz. Para que una noche cuente como noche astronómica se usa Sol < −12° en nights(); si prefieres exigir −18°, cambia ese umbral.

Añadidos posteriores, todos en astro.html: la pestaña 1 descarga forecast_days=7 y buildRows con límite 168 para el panorama de las próximas noches (las tarjetas, la tira, la gráfica y la tabla siguen usando las primeras 48 filas); la pestaña 2 descarga forecast_days=3 con límite 60 para fusionar también la noche siguiente, sin tocar la instantánea del registro, que sigue congelando solo refN. Las horas útiles son la intersección de Sol < −18° y Luna bajo el horizonte, contadas en nights(). El núcleo galáctico usa AR 266.4168° y Dec −29.0078° (J2000) en gcAltAz(), con el acimut medido desde el norte. El panel de subexposición usa KSKY = 1.7/(3.76/2)², calibrado para dar 1.7 e⁻/s a SQM 21.5, f/2 y píxel de 3.76 µm, ruido de lectura 1.5 / 1.5 / 1.2 e⁻ (M11 / Q3 / SL3-S por encima del cambio de ganancia) y la corrección lunar interpolada sobre iluminación 0 / 0.1 / 0.5 / 1 → 0 / 0.3 / 1.5 / 3.5 mag, escalada por el seno de la altura lunar.

Manual: sky for astrophotography

Night‑sky quality index and multi‑model Bayesian fusion.

1. What it is

Companion to the fog app. Same architecture (self‑contained HTML, Open‑Meteo without key, two tabs, local log with Bayesian learning), opposite goal: predict whether the night will be usable for photographing the sky. It combines the weather forecast (cloud layers, humidity, surface and upper wind, dew point), atmospheric composition (aerosol optical depth, AOD, from the CAMS model) and locally computed astronomy (Sun and Moon altitude, lunar phase). Install and serve it like the fog app: both can live in the same GitHub Pages repository and link to each other.

2. Common controls

ControlFunction
Latitude, LongitudeObserving site. Also “Use my location”.
TargetRescales the index weights. Deep sky: balanced, penalises Moon and humidity. Planetary / Moon: favours seeing (upper and surface wind) and almost ignores the Moon. Nightscape / Milky Way: strongly penalises Moon and humidity (horizon haze), barely values seeing.
ES / ENLanguage, shared with the fog app.

3. Tab 1: sky index

Cards. “Tonight” and “Tomorrow night”: for each astronomical night in range (hours with the Sun below −12°), the mean index of the best 3‑hour stretch, s₃, with its times, the whole‑night mean, the astronomical‑night interval (Sun < −18°) and the Moon: illumination and hours above the horizon.

Hourly strip. 48 hours. Green ≥ 70 excellent, amber 50 to 69 acceptable, red < 50 poor. Darker background during astronomical night. The hour is amber when the Moon is up. Hover to see what penalises each hour.

Chart. Index (thick green), total clouds (grey), high clouds (dashed blue), Moon altitude as an amber area whose opacity grows with illumination, dark blue background for astronomical night.

Table. Index, total and layered clouds, RH, T − Td, wind at 10 m and 250 hPa, AOD, Moon altitude and illumination, Sun altitude.

4. The index

Each term is normalised to 0 to 1 and weighted by target; the sum is rescaled to 100 and multiplied by the darkness factor.

TermComputationWeight (deep / planetary / nightscape)Why
Clouds(1 − c/100)² with c = max(total, 0.9·low + 0.7·mid + 0.45·high)45 / 45 / 45Dominant condition. Dense cirrus ruins a night even with moderate total cover; hence weighted layers. The square makes 30 % cover already cost half.
TransparencyAOD 550 nm: < 0.08 → 1, < 0.15 → 0.73, < 0.3 → 0.4, < 0.5 → 0.13, more → 015 / 8 / 12Aerosols (Saharan dust, smoke, haze) cut contrast and limiting magnitude. Without AOD, 0.7 (neutral) is used.
HumidityRH: < 60 → 1, < 75 → 0.7, < 85 → 0.4, < 92 → 0.2, more → 010 / 6 / 14Horizon haze, halos, transparency loss and dew.
Seeing0.6·(250 hPa wind: < 50 → 1, < 90 → 0.66, < 130 → 0.33, more → 0) + 0.4·(10 m wind: < 10 → 1, < 20 → 0.66, < 30 → 0.33)15 / 30 / 4Jet‑stream wind is the best cheap predictor of upper‑air turbulence; surface wind adds local turbulence and mount vibration.
DewT − Td: > 4 → 1, > 2 → 0.6, > 1 → 0.2, less → 05 / 5 / 5Condensation risk on optics. Reminder to bring dew heaters.
Moonbelow horizon → 1; otherwise (1 − illumination)·(1 − 0.7·sin(altitude))10 / 1 / 20Sky background. A high full Moon kills deep sky and the Milky Way; irrelevant for planetary.
DarknessSun > −6° → 0 · −6 to −12° → 0.3 · −12 to −18° → 0.7 · < −18° → 1factorCivil, nautical and astronomical twilight.
Rainprecipitation ≥ 0.1 mm/h → index 0overrideAhead of everything else: under a shower there is no night to score. The figure used to be downloaded and ignored, and 60 % cloud with 0.4 mm/h came out amber. The effect on learning is that such nights move from p ≈ 0.1 to 0.005 (the clamp floor): a log recorded before this change is slightly shifted on rainy nights.

Wind gusts (wind_gusts_10m) are downloaded and shown in the hourly table and in the spoken verdict when they reach 35 km/h during the night, but they do not enter the index: mean wind is already in the seeing term and counting it twice would shift the scale of p_of(s) and decalibrate the log. The same applies to the galactic core, which is computed and reported but does not score.

5. Tab 2: Bayesian fusion

Selected models are downloaded in parallel (same mechanism and models as in the fog app, 12 s limit, persistent selection). For each model the hourly index is computed and, for the reference night (the first astronomical night in range), s₃. The probability of a “usable night” is p_m = σ((s₃ − 58)/12). The posterior is formed by taking the model consensus (weighted mean in log‑odds, always inside the envelope) and shrinking it towards climatology: logit P = logit π + γ·(logit p̄ − logit π), with γ adjustable between 0.1 and 1 and a Beta prior updated with your nights, as in the fog app (see its manual, section 5).

Cards: posterior of a usable night with the range across models and the astronomical‑night interval; spread across models; Moon. The chart shows, hour by hour, each model’s probability and the posterior. The “Tonight per model” table summarises, per model, P usable, s₃, mean total and high clouds, mean RH, mean 250 hPa wind and the best stretch.

AOD comes from a single model (CAMS) and is shared by all weather models; differences between models therefore reflect clouds, humidity and wind. Keep this in mind when reading model agreement: high agreement does not cover transparency uncertainty.

6. Training

Identical to the fog app. Each compute in tab 2 automatically freezes each model’s probability for the reference night under the evening date. The next day the “Night of” field already proposes that date; choose Usable (clear most of the astronomical night), Partial (intermittent clouds, session usable at times) or Useless (overcast, haze or dew that prevented work), and save. The observation is paired with the forecast frozen the evening before; if you did not compute that evening, it is saved as pending and only updates the prior.

Logging criterion: record what you saw in the astronomical‑night window at your usual site, not what a distant station reported. If the night was usable despite poor seeing, it is still “Usable”: the log trains the probability of being able to work, not image quality.

Calibrating α: tab 2 draws a reliability diagram on its own, in the “Calibration” section next to the weights table: it groups the logged nights by frozen posterior (0–25 %, 25–50 %, 50–75 %, 75–100 %) and plots each group as a point (mean posterior, actual usable‑night frequency) against the perfect‑calibration diagonal, with area proportional to the number of nights. If actual frequencies are systematically more extreme than the posterior, raise α; if less extreme, lower it; if the points hug the diagonal, leave it as it is. Indicative from about 10 nights, reliable from 30.

7. Data and privacy

The log is kept in localStorage under the keys astro_bayes and astro_models, separate from the fog ones (niebla_*), although they share the language. Same persistence rules: per browser and per origin, lost when site data is cleared, not synced across devices. Export the JSON (astro_observaciones.json) after each logging session and commit it to the repository.

8. Interpretation

Excellent deep‑sky night: high clouds under 10 % through the astronomical night, AOD < 0.1, RH < 70 %, 250 hPa wind < 60 km/h, Moon below the horizon. With all that the index is around 90. A 70 with a 40 % Moon low on the horizon is still a good night for bright objects or narrowband.

Planetary: ignore the deep‑sky index and use the “Planetary” target. What matters is upper and surface wind and absence of cloud; the Moon is irrelevant and high RH on a stable night can come with excellent seeing.

Milky Way and nightscapes: humidity and horizon haze matter more than for deep sky because you shoot near the horizon; the “Nightscape” target captures it. High AOD (haze) is especially destructive.

Model disagreement on high clouds is common: cirrus is the worst‑forecast element. If the spread is high, re‑check in the evening and look at high clouds in the per‑model table.

9. Known limits

Real seeing depends on turbulence integrated over the whole column and on local topography; 250 hPa wind is a proxy, not a measurement. No light pollution: the index does not know whether you are in Bortle 3 or 7; that is your site choice. Astronomy is low precision (error under half a degree), fine for twilights and Moon, not for fine ephemerides. CAMS AOD has a resolution of tens of kilometres. Layered clouds are not available in every model: when missing, total is used for low and zero for mid and high.

10. Settings

In astro.html: the WEIGHTS object defines weights per target; score() holds each term’s thresholds; the constants A0, B0, LAMBDA, TH, KAP, TIMEOUT control fusion as in the fog app; γ is set from the interface. A night counts as astronomical when Sun < −12° in nights(); change that threshold to require −18°.

Later additions, all in astro.html: tab 1 downloads forecast_days=7 and calls buildRows with a 168-row limit for the next-nights outlook (cards, strip, chart and table still use the first 48 rows); tab 2 downloads forecast_days=3 with a 60-row limit so it can fuse the following night too, without touching the log snapshot, which still freezes refN only. Useful hours are the intersection of Sun < −18° and Moon below the horizon, counted in nights(). The galactic core uses RA 266.4168° and Dec −29.0078° (J2000) in gcAltAz(), with azimuth measured from north. The sub-exposure panel uses KSKY = 1.7/(3.76/2)², calibrated to give 1.7 e⁻/s at SQM 21.5, f/2 and a 3.76 µm pixel, read noise 1.5 / 1.5 / 1.2 e⁻ (M11 / Q3 / SL3-S above the gain switch) and a lunar correction interpolated over illumination 0 / 0.1 / 0.5 / 1 → 0 / 0.3 / 1.5 / 3.5 mag, scaled by the sine of lunar altitude.