Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:15

0001 #include "sblackbody.h"
0002 #include "NP.hh"
0003 
0004 int main()
0005 {
0006     //std::vector<int> temps = {{6500,6000,5500,5000,4500}} ; 
0007     std::vector<int> temps = {{7000,6000,5000,4000,3000}} ; 
0008     int ni = temps.size(); 
0009     int nj = 1400 ; 
0010     int nk = 2 ; 
0011 
0012     NP* a = NP::Make<double>(ni, nj, nk);  
0013     double* aa = a->values<double>(); 
0014     for(int i=0 ; i < ni ; i += 1 )
0015     {
0016         int temp = temps[i] ; 
0017         a->names.push_back(std::to_string(temp)); 
0018         double temp_k = temp ; 
0019 
0020         for(int j=0 ; j < nj ; j += 1 )
0021         {
0022             double nm = double(j+100) ; 
0023             double psr = sblackbody::planck_spectral_radiance( nm, temp_k ) ;  
0024             int idx = i*nj*nk + j*nk ; 
0025             aa[idx + 0] = nm ; 
0026             aa[idx + 1] = psr ; 
0027         }
0028     }
0029     a->save("$FOLD/psr.npy"); 
0030 
0031     return 0 ; 
0032 }