Exemplo n.º 1
0
void read_hv_flux(VectorScalar &lambda, VectorScalar &phy1AU, const std::string &file)
{
    std::string line;
    std::ifstream flux_1AU(file);
    getline(flux_1AU,line);
    while(!flux_1AU.eof())
    {
        Scalar wv,ir,dirr;
        flux_1AU >> wv >> ir >> dirr;
        if(!lambda.empty() && wv == lambda.back())continue;
        lambda.push_back(wv);//nm
        phy1AU.push_back(ir);//W/m2/nm
    }
    flux_1AU.close();
    return;
}
void read_temperature(VectorScalar &T0, VectorScalar &Tz, const std::string &file)
{
  T0.clear();
  Tz.clear();
  std::string line;
  std::ifstream temp(file);
  getline(temp,line);
  while(!temp.eof())
  {
     Scalar t,tz,dt,dtz;
     temp >> t >> tz >> dt >> dtz;
     T0.push_back(t);
     Tz.push_back(tz);
  }
  temp.close();
  return;
}
Exemplo n.º 3
0
void read_crossSection(VectorScalar & lambda, VectorScalar & sigma, const std::string &file, unsigned int nbr)
{
    lambda.clear();
    sigma.clear();
    std::string line;
    std::ifstream sig_f(file);
    getline(sig_f,line);
    while(!sig_f.eof())
    {
        Scalar wv,sigt,sigbr;
        sig_f >> wv >> sigt;
        for(unsigned int i = 0; i < nbr; i++)sig_f >> sigbr;
        lambda.push_back(wv/10.);//A -> nm
        sigma.push_back(sigt*10.);//cm-2/A -> m-2/nm
    }
    sig_f.close();
    return;
}