https://github.com/sevenian3/ChromaStarPy
Raw File
Tip revision: 103d3d0df6d9574c49818f149e1cae8100455d10 authored by Ian Short on 06 July 2023, 18:09:20 UTC
Create ReadMe
Tip revision: 103d3d0
LamGrid.py
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 20 16:33:44 2017

Create the wavelength grid that samples the overall spectral energy distribution

@author: ishort
"""

import math

def lamgrid(numLams, lamSetup):
    
    lambdaScale = []
    logLambda = 0.0
    
    #// Space lambdas logarithmically:
    logLam1 = math.log10(lamSetup[0])
    logLam2 = math.log10(lamSetup[1])
    delta = ( logLam2 - logLam1 ) / numLams
    
    ii = 0.0
    
    for i in range(numLams):
        ii = float(i);
        logLambda = logLam1 + ( ii * delta );
        lambdaScale.append(math.pow(10.0, logLambda))
        
    return lambdaScale;
back to top