procesar_sol.py · versión 2 · Nikon Z8 procesar_sol.py · version 2 · Nikon Z8

Realce de
manchas solares

Sunspot
enhancement

Divide el disco por su perfil radial de brillo y estira linealmente el residuo. La fotosfera acaba en el 90,9 % del blanco; las manchas, en el negro.

Divides the disc by its own radial brightness profile and stretches the residual linearly. The photosphere ends up at 90.9 % of white; the sunspots, at black.

ver el código view the source
Focal implícita
566 mm
Escala de imagen
1,58 arcsec/px
Sobre el Sol
1149 km/px
Planitud del cociente
1,000 ± 0,007
Salida
16 o 32 bits
Implied focal length
566 mm
Image scale
1.58 arcsec/px
On the Sun
1149 km/px
Flatness of the ratio
1.000 ± 0.007
Output
16 or 32 bits

Tubería de procesado

Processing pipeline

Cada paso opera sobre la salida del anterior. Los nombres en azul son las funciones del archivo.

Each step operates on the output of the one before it. The names in blue are the functions in the file.

  1. Revelado lineal cargar() rawpy con gamma=(1,1), sin autoexposición, 16 bits, demosaicado AHD, balance de la cámara. La división por el flat exige valores proporcionales al flujo, y una curva sRGB rompe esa proporcionalidad.
  2. Extracción de un canal Se toma el verde: doble de fotositos en el mosaico de Bayer, y con filtro solar el rojo satura antes. El resto de la cadena opera sobre un escalar.
  3. Binning opcional binear() Promedio de bloques N×N. Reduce el ruido en un factor N. El detalle se pierde solo si el muestreo está por debajo de lo que resuelve el conjunto óptica más atmósfera.
  4. Apilado opcional apilar() Detecta el centro del disco en cada fotograma, compensa la traslación y promedia. El ruido baja como 1/√N.
  5. Geometría del disco detectar_disco() Umbral en el 25 % entre el percentil 5 y el 99,5, cierre y apertura morfológicos con elipse de 15 px, contorno mayor, círculo mínimo envolvente. La máscara final es el círculo relleno, de modo que las manchas quedan dentro.
  6. Flat radial flat_radial() Mediana de intensidad en 200 anillos concéntricos, suavizada con ventana de Hann de 9 bins e interpolada a dos dimensiones. La mediana descarta las manchas, así que el perfil describe el oscurecimiento del limbo.
  7. Cociente Imagen dividida por el flat. La fotosfera queda en 1,000, la penumbra entre 0,70 y 0,90 y la umbra entre 0,25 y 0,50, con independencia de la distancia al centro.
  8. Mapa tonal y enfoque Estirado lineal de la ventana [bajo, alto] al rango completo, atenuación del último 2,5 % del radio para suprimir el aro del limbo, y máscara de enfoque en dos escalas cuando --enfoque es mayor que cero.
  1. Linear development cargar() rawpy with gamma=(1,1), no auto-exposure, 16 bits, AHD demosaicing, camera white balance. Division by the flat field demands values proportional to flux, and an sRGB curve breaks that proportionality.
  2. Extraction of a single channel The green is taken: twice as many photosites in the Bayer mosaic, and behind a solar filter the red saturates sooner. The rest of the chain works on a scalar.
  3. Optional binning binear() Average of N×N blocks. Reduces the noise by a factor of N. Detail is lost only if the sampling lies below what the optics and the atmosphere together actually resolve.
  4. Optional stacking apilar() Detects the centre of the disc in every frame, compensates for the translation and averages. The noise falls as 1/√N.
  5. Geometry of the disc detectar_disco() Threshold at 25 % between the 5th and the 99.5th percentile, morphological closing and opening with a 15 px ellipse, largest contour, minimum enclosing circle. The final mask is the filled circle, so that the sunspots fall inside it.
  6. Radial flat flat_radial() Median intensity over 200 concentric annuli, smoothed with a 9-bin Hann window and interpolated back to two dimensions. The median discards the sunspots, so the profile describes the limb darkening.
  7. Ratio Image divided by the flat. The photosphere settles at 1.000, the penumbra between 0.70 and 0.90 and the umbra between 0.25 and 0.50, irrespective of the distance from the centre.
  8. Tone mapping and sharpening Linear stretch of the window [bajo, alto] to the full range, roll-off over the outermost 2.5 % of the radius to suppress the limb ring, and a two-scale unsharp mask when --enfoque is greater than zero.

Perfil de oscurecimiento del limbo

Limb darkening profile

Hacia el borde, la línea de visión atraviesa capas más frías y la intensidad cae al 30 % del valor central. El gradiente supera el contraste de una mancha pequeña, así que el estirado va después de quitarlo.

Towards the edge, the line of sight crosses cooler layers and the intensity falls to 30 % of its central value. This radial gradient exceeds the contrast of a small sunspot, so the stretch comes only after it has been removed.

Perfil medido Flat gaussiano (v1) Cociente con flat radial
Measured profile Gaussian flat (v1) Ratio with the radial flat
Medido sobre tus archivos. El flat gaussiano de la primera versión desenfoca disco y fondo negro juntos: el cociente subía a 1,025 en r/R = 0,8 y caía a 0,61 en el limbo, y ese patrón anular era casi toda la señal visible. El flat radial deja 1,000 ± 0,007 en todo el disco.
Measured on your own files. The Gaussian flat of the first version blurs the disc and the black background together: the ratio rose to 1.025 at r/R = 0.8 and fell to 0.61 at the limb, and that annular pattern was very nearly all the visible signal. The radial flat leaves 1.000 ± 0.007 across the whole disc.

Parámetros

Parameters

Solo el archivo de entrada es obligatorio. Los valores por omisión están ajustados a un disco de unos 1200 px de diámetro.

Only the input file is compulsory. The defaults are tuned to a disc of some 1200 px in diameter.

Entrada y salida

Input and output

archivosposicional, uno o varios

Rutas a NEF, CR2, CR3, ARW, DNG y otros RAW que abra libraw, o a TIFF, PNG y JPEG. Admite comodines del shell.

En la Z8, dispara en compresión RAW “sin pérdida”. Los NEF de “Alta eficiencia” usan TicoRAW, que libraw solo decodifica desde la versión 0.21.2; el script detecta ese error y lo indica.

--salidadefecto: directorio actual

Carpeta de destino. Se crea si no existe.

--formatotiff16 | tiff32 | png16
defecto: tiff16

tiff16, entero de 16 bits, 65536 niveles. Formato de trabajo para Photoshop o Capture One; los 14 bits del NEF caben con margen.

tiff32, coma flotante, valores en [0,1] sin cuantizar. Para cadenas de varias operaciones fotométricas, donde el redondeo se acumula. Lo leen Photoshop, GIMP 2.10 en adelante, PixInsight, Siril e ImageJ.

png16, alternativa portable.

--linealinterruptor

Exporta además el cociente aplanado antes del estirado y del enfoque. En tiff32 se guarda tal cual, con la fotosfera en 1,0; en los formatos enteros se divide por 1,25 para que quepa en el rango.

Es el archivo a llevar al editor para aplicar curvas propias en lugar de la ventana fija del script.

--sin-previnterruptor

Omite el JPEG de previsualización de 8 bits.

--canalr | g | b | l
super | superg
defecto: g

g, r, b: un canal del RAW demosaicado. l: luminancia BT.709 de los tres. super: superpíxel 2×2 sobre el mosaico Bayer crudo sumando los cuatro fotositos de cada celda. superg: igual, con los dos verdes.

Los dos modos super no demosaican y no aplican balance de blancos: el valor es proporcional a los electrones totales de la celda. Salen a la mitad de resolución lineal.

Sobre combinar canales: una celda Bayer 2×2 tiene 1 R, 2 G y 1 B, así que el verde ya recoge la mitad de los fotones. La cota de mejora es √((NR+2NG+NB) / 2NG), es decir ×1,41 con flujo igual en los tres canales y ×1,32 con una película Baader, no √3. Medido sobre mosaico simulado con demosaicado AHD, el superpíxel da ×1,29, que coincide con la predicción. La media de los tres canales demosaicados mide ×1,92, por encima de la cota física: el exceso es paso-bajo de la interpolación de R y B, y se paga en contraste, con 0,52 de retención en manchas de 1 px de radio frente a 0,89 a 1,03 por encima de 3 px.

archivospositional, one or more

Paths to NEF, CR2, CR3, ARW, DNG and other RAW files that libraw can open, or to TIFF, PNG and JPEG. Shell wildcards are accepted.

On the Z8, shoot in “lossless” RAW compression. The “High efficiency” NEFs use TicoRAW, which libraw only decodes from version 0.21.2 onwards; the script detects that error and reports it.

--salidadefault: current directory

Destination folder. It is created if it does not exist.

--formatotiff16 | tiff32 | png16
default: tiff16

tiff16, 16-bit integer, 65536 levels. The working format for Photoshop or Capture One; the 14 bits of the NEF fit with room to spare.

tiff32, floating point, values in [0,1] without quantisation. For chains of several photometric operations, where rounding accumulates. It is read by Photoshop, GIMP 2.10 onwards, PixInsight, Siril and ImageJ.

png16, a portable alternative.

--linealswitch

Additionally exports the flattened ratio, before the stretch and the sharpening. In tiff32 it is saved as it stands, with the photosphere at 1.0; in the integer formats it is divided by 1.25 so that it fits within the range.

This is the file to take into the editor in order to apply curves of your own instead of the fixed window of the script.

--sin-prevswitch

Omits the 8-bit preview JPEG.

--canalr | g | b | l
super | superg
default: g

g, r, b: one channel of the demosaiced RAW. l: BT.709 luminance of the three. super: a 2×2 superpixel over the raw Bayer mosaic, summing the four photosites of each cell. superg: the same, with the two greens.

The two super modes neither demosaic nor apply white balance: the value is proportional to the total electrons in the cell. They come out at half the linear resolution.

On combining channels: a 2×2 Bayer cell holds 1 R, 2 G and 1 B, so the green already collects half the photons. The upper bound on the gain is √((NR+2NG+NB) / 2NG), that is, ×1.41 with equal flux in all three channels and ×1.32 behind a Baader film, not √3. Measured on a simulated mosaic with AHD demosaicing, the superpixel gives ×1.29, in agreement with the prediction. The mean of the three demosaiced channels measures ×1.92, above the physical bound: the excess is the low-pass of the R and B interpolation, and it is paid for in contrast, with 0.52 retention on sunspots of 1 px radius against 0.89 to 1.03 above 3 px.

Reducción de ruido y geometría

Noise reduction and geometry

--bin Nentero · defecto: 1

Promedia bloques de N×N píxeles antes de todo lo demás. Con N = 2 la relación señal/ruido se duplica y el archivo baja a la cuarta parte.

Aplicable cuando la escala de imagen está por debajo del límite de resolución del conjunto, como en tu caso con 1,58 arcsec/px.

--apilarinterruptor

Trata todos los archivos de la línea de órdenes como una ráfaga: alinea por el centro del disco y promedia. Genera una sola salida, con sufijo _apiladoN.

La alineación es solo traslación: corrige arrastre de seguimiento y vibraciones. La rotación de campo y la distorsión instantánea del seeing quedan fuera.

--recorteinterruptor

Recorta al disco con un margen del 15 % del radio.

Con 45 Mpx y el disco ocupando una fracción del fotograma, acelera todo lo que venga después.

--bin Ninteger · default: 1

Averages blocks of N×N pixels before anything else. With N = 2 the signal-to-noise ratio doubles and the file drops to a quarter of its size.

Worth using when the image scale lies below the resolution limit of the whole assembly, as it does in your case at 1.58 arcsec/px.

--apilarswitch

Treats every file on the command line as a single burst: aligns on the centre of the disc and averages. It produces one output, with the suffix _apiladoN.

The alignment is translation only: it corrects tracking drift and vibration. Field rotation and the instantaneous distortion of the seeing lie outside its reach.

--recorteswitch

Crops to the disc with a margin of 15 % of the radius.

With 45 Mpx and the disc occupying a fraction of the frame, it speeds up everything that follows.

Mapa tonal

Tone mapping

Definen qué valor del cociente se convierte en negro y cuál en blanco. La fotosfera, que vale 1,0 por construcción, acaba en (1 − bajo) / (alto − bajo) del rango.

These set which value of the ratio becomes black and which becomes white. The photosphere, which is 1.0 by construction, ends up at (1 − bajo) / (alto − bajo) of the range.

Banco de pruebas Test bench

Disco sintético con oscurecimiento del limbo, cinco manchas y ruido de fotones, procesado con el mismo algoritmo. Los controles actualizan las tres etapas.

A synthetic disc with limb darkening, five sunspots and photon noise, put through the same algorithm. The controls update all three stages.

1 · RAW lineal
1 · Linear RAW
2 · Cociente aplanado
2 · Flattened ratio
3 · Estirado
3 · Stretched
--bajoflotante · defecto: 0.60

Valor del cociente que se mapea a negro. Fija cuánta estructura interna conservan las umbras.

A 0,40 conserva gradiente dentro de la umbra y aplana el contraste general. Por encima de 0,70 las umbras llegan a negro puro y pierden toda su estructura.

--altoflotante · defecto: 1.04

Valor del cociente que se mapea a blanco. Determina cuánto ruido de la fotosfera se va a blanco puro y, con ello, cuán limpio queda el disco.

Primer mando a tocar. Con 1,02 el disco queda más limpio y las manchas pequeñas resaltan más; con 1,10 aparece todo el grano.

--enfoque Gflotante · defecto: 0.8
0 lo desactiva

Ganancia de la máscara de enfoque, que actúa a sigma 2 px con ganancia G y a sigma 8 px con ganancia 0,375 G.

Con tu escala de imagen, ponlo a 0. El análisis por bandas de tu archivo sitúa el pico de potencia en sigma 2 a 3 px, donde actúa esta máscara, y ahí el contenido es ruido. Sube de 0 con discos por encima de unos 1500 px de diámetro.

--bajofloat · default: 0.60

The value of the ratio that is mapped to black. It fixes how much internal structure the umbrae retain.

At 0.40 it preserves the gradient within the umbra and flattens the overall contrast. Above 0.70 the umbrae reach pure black and lose all their structure.

--altofloat · default: 1.04

The value of the ratio that is mapped to white. It determines how much of the photospheric noise goes to pure white and, with that, how clean the disc looks.

The first control to reach for. At 1.02 the disc is cleaner and the small sunspots stand out more; at 1.10 the whole grain appears.

--enfoque Gfloat · default: 0.8
0 disables it

Gain of the unsharp mask, which acts at sigma 2 px with gain G and at sigma 8 px with gain 0.375 G.

At your image scale, set it to 0. The band analysis of your file places the power peak at sigma 2 to 3 px, exactly where this mask acts, and there the content is noise. Raise it above 0 for discs beyond some 1500 px in diameter.

Apilado y bracketing

Stacking and bracketing

Apilado aplicable

El disco en luz blanca está limitado por ruido de fotones y por seeing, y ambos se promedian. Con 100 fotogramas el ruido cae un factor 10.

Bracketing solo calibración

Fotosfera y umbra se diferencian en un factor 4 o 5, poco más de 2 pasos. La Z8 da más de 12 pasos útiles en 14 bits, así que la escena cabe en una exposición. El límite está en la relación señal/ruido.

Stacking applicable

In white light the disc is limited by photon noise and by seeing, and both average out. With 100 frames the noise falls by a factor of 10.

Bracketing calibration only

Photosphere and umbra differ by a factor of 4 or 5, little more than 2 stops. The Z8 gives over 12 usable stops in 14 bits, so the scene fits within a single exposure. The limit lies in the signal-to-noise ratio.

La horquilla sirve para calibrar, no para fusionar: al empezar la sesión, tres o cuatro exposiciones separadas un paso, te quedas con la que deja la fotosfera entre el 70 y el 80 % del rango y bloqueas esos valores. Después, ráfagas idénticas. Fusionar exposiciones distintas aporta algo con corona de eclipse o protuberancias, que abarcan varios órdenes de magnitud.

The bracket is there to calibrate, not to merge: at the start of the session, three or four exposures a stop apart, and you keep the one that leaves the photosphere between 70 and 80 % of the range and lock those values in. Identical bursts thereafter. Merging different exposures earns its keep with the eclipse corona or with prominences, which span several orders of magnitude.

Protocolo

Protocol

Filtro
Filtro solar de apertura completa delante del objetivo: película Baader AstroSolar ND5 o cristal equivalente. Un ND fotográfico o un filtro montado detrás concentraría el haz sobre obturador y sensor. La cuña de Herschel es la única excepción legítima, y es otro instrumento: desvía el haz en lugar de absorberlo.
ISO
64, el nativo de la Z8. El limitante es el ruido de fotones, y el ISO base maximiza la capacidad del pozo, es decir, los electrones por píxel y con ello la relación señal/ruido.
Diafragma
f/8 de partida en un teleobjetivo de 500 a 600 mm. Más allá de f/11 la difracción empieza a costar resolución.
Obturación
1/500 s o más corta, para congelar la turbulencia. Con ND5 a ISO 64 y f/8 la exposición cae en ese entorno.
Exposición
Fotosfera entre el 70 y el 80 % del rango. El histograma de la cámara procede del JPEG incrustado, así que deja medio paso de margen hasta el recorte; el script informa del porcentaje de disco saturado en cada archivo.
Fotogramas
50 a 200 por ráfaga. La Z8 dispara a 20 fps en RAW: tres a diez segundos. Varias ráfagas separadas unos minutos permiten descartar las de peor seeing.
Enfoque
Manual, con vista en directo a máxima ampliación, sobre el borde del limbo o sobre una mancha. Repítelo cada pocas ráfagas: el objetivo se calienta al sol y la focal deriva.
Soporte
Trípode, obturador electrónico, disparo con retardo o mando. Estabilización del objetivo desactivada.
Momento
Mañana, con el Sol por encima de unos 30° y antes de que el suelo se caliente. La columna de aire sobre tejados, asfalto o cristales degrada el seeing más que una altura solar baja.
Filter
A full-aperture solar filter in front of the lens: Baader AstroSolar ND5 film or equivalent glass. A photographic ND, or a filter mounted behind the lens, would concentrate the beam on the shutter and the sensor. The Herschel wedge is the one legitimate exception, and it is a different instrument: it deflects the beam rather than absorbing it.
ISO
64, the native setting of the Z8. Photon noise is the limiting factor, and base ISO maximises well capacity, that is, the electrons per pixel and with them the signal-to-noise ratio.
Aperture
f/8 as a starting point on a 500 to 600 mm telephoto. Beyond f/11 diffraction begins to cost resolution.
Shutter
1/500 s or shorter, so as to freeze the atmospheric turbulence. With ND5 at ISO 64 and f/8 the exposure falls in that region.
Exposure
Photosphere between 70 and 80 % of the range. The camera histogram is derived from the embedded JPEG, so leave half a stop of margin before clipping; the script reports the percentage of saturated disc in each file.
Frames
50 to 200 per burst. The Z8 shoots at 20 fps in RAW: three to ten seconds. Several bursts a few minutes apart let you discard those taken in the worst seeing.
Focus
Manual, on live view at maximum magnification, on the edge of the limb or on a sunspot. Repeat it every few bursts: the lens warms in the sun and the focal length drifts.
Support
Tripod, electronic shutter, delayed release or a remote. Lens stabilisation switched off.
Time of day
Morning, with the Sun above some 30° and before the ground warms up. The column of air over roofs, asphalt or glass degrades the seeing more than a low solar altitude does.

Polvo o mancha solar

El polvo en el filtro o en el sensor produce puntos oscuros fijos con el aspecto de manchas pequeñas. La prueba es geométrica: gira el filtro 90° y repite la ráfaga. Las manchas mantienen su posición respecto al disco; el polvo se desplaza con el filtro. Segundo control: desplaza el encuadre unos cientos de píxeles y el polvo del sensor se queda quieto en el fotograma mientras el disco se mueve.

Un fotograma con la tapa puesta y los mismos ajustes localiza los píxeles calientes, que en la salida aparecen como puntos brillantes aislados.

Dust or sunspot

Dust on the filter or on the sensor produces fixed dark points with the look of small sunspots. The test is geometrical: rotate the filter by 90° and repeat the burst. The sunspots hold their position relative to the disc; the dust travels with the filter. A second check: shift the framing by a few hundred pixels and the sensor dust stays put in the frame while the disc moves.

A dark frame — cap on, same settings — locates the hot pixels, which appear in the output as isolated bright points.

Recetas

Recipes

Un solo NEF

A single NEF

python procesar_sol.py Z80_8280.NEF --recorte --bin 2 --enfoque 0 --alto 1.02

Sin amplificación de ruido, con binning que duplica la señal/ruido y el techo bajado para limpiar la fotosfera.

No noise amplification, binning that doubles the signal-to-noise ratio, and the ceiling lowered to clean up the photosphere.

Una ráfaga completa

A complete burst

python procesar_sol.py Z80_82*.NEF --apilar --bin 2 --enfoque 0 --recorte --salida ./out

Con 100 fotogramas puedes estrechar más la ventana: prueba después --alto 1.01, que sin apilado solo daría grano.

With 100 frames you can narrow the window further: try --alto 1.01 afterwards, which without stacking would give nothing but grain.

Para editar a mano

For editing by hand

python procesar_sol.py Z80_8280.NEF --formato tiff32 --lineal --enfoque 0 --recorte

Genera el cociente aplanado sin estirar, en coma flotante. Aplica tus curvas sobre _lineal.tif y usa _manchas.tif como referencia de dónde está cada estructura.

Produces the flattened ratio without any stretch, in floating point. Apply your own curves to _lineal.tif and use _manchas.tif as a reference for where each structure lies.

Límites de resolución

Limits of resolution

Granulación
no resuelta Las celdas fotosféricas miden de 1000 a 1500 km, es decir, alrededor de 1 píxel a 1149 km/px, un factor 3 a 5 por debajo de tu resolución angular. El grano visible en la imagen es ruido: el recuento de desviaciones respecto a la mediana local sale simétrico entre claras y oscuras, con razón de 0,92 a 0,98 en todos los anillos del disco, y el ruido es simétrico mientras la estructura solar no lo es.
Difracción
A 550 nm, 1,22 λ/D vale 2,77 arcsec con 50 mm de apertura libre, 1,73 con 80 mm y 1,38 con 100 mm. Añade de 2 a 5 arcsec de seeing diurno, peor que el nocturno por la convección del suelo.
Puntos brillantes
ruido En tu archivo son la cola positiva del mismo ruido: 560 grupos de área mediana 2 px con exceso superior a 20 niveles, y una población casi idéntica de grupos oscuros al mismo umbral. Las fáculas son estructuras extensas ligadas a regiones activas y se ven sobre todo cerca del limbo, donde tu razón claras/oscuras cae a 0,60, con predominio de oscuras.
Para granulación
otro montaje Escala de imagen un factor 5 mayor: unos 3000 mm de focal, o un telescopio de 100 a 150 mm con Barlow. Y vídeo de miles de fotogramas para apilar el 5 % mejor con AutoStakkert y afilar por ondículas en Registax: el flujo de la fotografía planetaria.
Para fáculas
otro montaje Banda estrecha en Ca II K o en el continuo azul, donde el contraste supera con holgura el de la luz blanca integrada.
Granulation
not resolved The photospheric cells measure 1000 to 1500 km, that is, about 1 pixel at 1149 km/px, a factor of 3 to 5 below your angular resolution. The grain visible in the image is noise: the count of departures from the local median comes out symmetrical between light and dark, with a ratio of 0.92 to 0.98 in every annulus of the disc, and noise is symmetrical where solar structure is not.
Diffraction
At 550 nm, 1.22 λ/D comes to 2.77 arcsec with 50 mm of clear aperture, 1.73 with 80 mm and 1.38 with 100 mm. Add 2 to 5 arcsec of daytime seeing, worse than the nocturnal kind because of convection from the ground.
Bright points
noise In your file they are the positive tail of that same noise: 560 groups of median area 2 px exceeding 20 levels, and an almost identical population of dark groups at the same threshold. Faculae are extended structures tied to active regions and are seen above all near the limb, where your light-to-dark ratio falls to 0.60, dark predominating.
For granulation
another setup An image scale five times finer: some 3000 mm of focal length, or a 100 to 150 mm telescope with a Barlow. And video of thousands of frames, to stack the best 5 % in AutoStakkert and apply wavelet sharpening in Registax: the lucky-imaging workflow of planetary photography.
For faculae
another setup Narrowband in Ca II K or in the blue continuum, where the contrast comfortably exceeds that of integrated white light.

Salida monocroma

Toda la cadena posterior al revelado es fotométrica: la división por el flat y el estirado operan sobre una magnitud proporcional al flujo en una banda.

El color del Sol en luz blanca procede del filtro. La película Baader da un blanco azulado y el cristal un naranja. Para un tono cálido, aplícalo al final en el editor como decisión estética.

Monochrome output

Everything in the chain after development is photometric: the division by the flat field and the stretch both operate on a quantity proportional to the flux in one band.

The colour of the Sun in white light comes from the filter. The Baader film gives a bluish white and the glass an orange. For a warm tone, apply it at the end in the editor, as an aesthetic decision — false colour, not measurement.