OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
FormattedFile.hpp
Go to the documentation of this file.
1 
2 #ifndef FOCS_LOG_FORMATTEDFILE
3 #define FOCS_LOG_FORMATTEDFILE
4 
5 #include "focs/Log.hpp"
6 
7 #include <fstream>
8 #include <string>
9 #include <vector>
10 
11 namespace focs {
21  using named_function = std::function<std::string(const std::string& name, std::ostream& stream, const int severity, const std::string& str)>;
22  using map_of_functions = std::unordered_map<std::string, named_function>;
23 
24  using indexed_function = std::function<std::string(const size_t index, std::ostream& stream, const int severity, const std::string& str)>;
25  using vector_of_functions = std::vector<indexed_function>;
26 
27  public:
36  FormattedFileLogger(const std::string& filename, const std::string& format, map_of_functions named_functions={}, vector_of_functions numbered_functions={}) : FormattedStreamLogger(format, named_functions, numbered_functions, handle_), path_{filename}, handle_{filename, std::ios_base::out | std::ios_base::app} {}
37 
47  FormattedFileLogger(const std::string& filename, std::ios_base::openmode mode, const std::string& format, map_of_functions named_functions={}, vector_of_functions numbered_functions={}) : FormattedStreamLogger(format, named_functions, numbered_functions, handle_), path_{filename}, handle_{filename, mode} {}
48 //std::ios_base::out | std::ios_base::app)
49 
50  ~FormattedFileLogger() override {
51  handle_.close();
52  }
53  private:
54  std::string path_;
55  std::ofstream handle_;
56 };
57 }
58 
59 #endif // FOCS_LOG_FORMATTEDFILE
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
Log facility allowing text to be generated around messages.
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in out
Definition: HISTORY.txt:422
README for MOD_PR02AQUA(AQUA) Version to set to For disabling creating and output data sets when in night mode
Definition: README.txt:96
@ string
FormattedStreamLogger(const std::string &format, map_of_functions named_functions={}, vector_of_functions numbered_functions={}, std::ostream &stream=std::cout)
Create a new log facility with the given format, with optional function containers and a specific out...
char filename[FILENAME_MAX]
Definition: atrem_corl1.h:122
const char * str
Definition: l1c_msi.cpp:35
FormattedFileLogger(const std::string &filename, const std::string &format, map_of_functions named_functions={}, vector_of_functions numbered_functions={})
Create a new log facility without external function calls.
Log facility for printing to a file, allowing text to be generated around messages.
FormattedFileLogger(const std::string &filename, std::ios_base::openmode mode, const std::string &format, map_of_functions named_functions={}, vector_of_functions numbered_functions={})
Create a new log facility without external function calls.