Skip to content

Commit

Permalink
bugfix: allow single hemisph. of extinction
Browse files Browse the repository at this point in the history
  • Loading branch information
mjuric committed Jun 30, 2010
1 parent aa34423 commit 70975a7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/skygen/os_skygen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,11 @@ extern "C" void resample_texture(const std::string &outfn, const std::string &te
MLOG(verb2) << "Resampled.";
}

inline std::string prettyPrintNone(const std::string &s)
{
return s.empty() ? "<none>" : s;
}

/**
Load north and south extinction textures based on the configuration
found in econf.
Expand Down Expand Up @@ -713,7 +718,6 @@ void os_skygen::load_extinction_maps(std::vector<pencilBeam> &skypixels, const s
if(northfn.empty())
{
MLOG(verb2) << "WARNING: Extinction for northern hemisphere unspecified. Assuming zero.";
northfn = "<none>";
}
else
{
Expand All @@ -730,7 +734,6 @@ void os_skygen::load_extinction_maps(std::vector<pencilBeam> &skypixels, const s
if(southfn.empty())
{
MLOG(verb2) << "WARNING: Extinction for southern hemisphere unspecified. Assuming zero.";
southfn = "<none>";
}
else
{
Expand All @@ -749,10 +752,10 @@ void os_skygen::load_extinction_maps(std::vector<pencilBeam> &skypixels, const s
FOREACH(ext_north) { *i *= nscale; nmax = std::max(nmax, *i); nmin = std::min(nmin, *i); }
FOREACH(ext_south) { *i *= sscale; smax = std::max(smax, *i); smin = std::min(smin, *i); }

MLOG(verb1) << "Extinction maps: " << northfn << " (north), " << southfn << " (south).";
MLOG(verb1) << "Extinction maps: " << prettyPrintNone(northfn) << " (north), " << prettyPrintNone(southfn) << " (south).";
MLOG(verb2) << "Ext. scale factors: " << nscale << " " << sscale << "\n";
MLOG(verb2) << "Extinction north: " << northfn << " [ X x Y x DM = " << ext_north.width() << " x " << ext_north.height() << " x " << ext_north.depth() << "] [min, max = " << nmin << ", " << nmax << "]\n";
MLOG(verb2) << "Extinction south: " << southfn << " [ X x Y x DM = " << ext_south.width() << " x " << ext_south.height() << " x " << ext_south.depth() << "] [min, max = " << smin << ", " << smax << "]\n";
MLOG(verb2) << "Extinction north: " << prettyPrintNone(northfn) << " [ X x Y x DM = " << ext_north.width() << " x " << ext_north.height() << " x " << ext_north.depth() << "] [min, max = " << nmin << ", " << nmax << "]\n";
MLOG(verb2) << "Extinction south: " << prettyPrintNone(southfn) << " [ X x Y x DM = " << ext_south.width() << " x " << ext_south.height() << " x " << ext_south.depth() << "] [min, max = " << smin << ", " << smax << "]\n";

// prepare binned texture lookups for the pixels
// NOTE: assumes the extinction maps have already been loaded
Expand Down

0 comments on commit 70975a7

Please sign in to comment.