Observation
|
00001 /* HiRISE Observation 00002 00003 PIRL CVS ID: Observation.hh,v 1.50 2020/02/14 01:17:18 schaller Exp 00004 00005 Copyright (C) 2004-2020 Arizona Board of Regents on behalf of the Lunar and 00006 Planetary Laboratory at the University of Arizona. 00007 00008 Licensed under the Apache License, Version 2.0 (the "License"); you may not use 00009 this file except in compliance with the License. You may obtain a copy of the 00010 License at 00011 00012 http://www.apache.org/licenses/LICENSE-2.0 00013 00014 Unless required by applicable law or agreed to in writing, software distributed 00015 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 00016 CONDITIONS OF ANY KIND, either express or implied. See the License for the 00017 specific language governing permissions and limitations under the License. 00018 */ 00019 #ifndef _HiRISE_Observation_ 00020 #define _HiRISE_Observation_ 00021 00022 // UA::HiRISE 00023 #include "Data_Component.hh" 00024 #include "MROSP_Header.hh" 00025 #include "Science_Channel_Header.hh" 00026 #include "LUT.hh" 00027 #include "Engineering_Header.hh" 00028 #include "Image_Line.hh" 00029 #include "Gap_Map.hh" 00030 00031 #if defined (INCLUDE_PVL) 00032 // idaeim::PVL 00033 #include "PVL.hh" 00034 #endif 00035 00036 #include <iosfwd> 00037 #include <vector> 00038 00039 00040 namespace UA 00041 { 00042 namespace HiRISE 00043 { 00066 class Observation 00067 : public Instrument 00068 { 00069 public: 00070 /*============================================================================== 00071 Constants: 00072 */ 00074 static const char* const 00075 ID; 00076 00078 static const char 00079 * const PDS_VERSION_ID, 00080 * const RECORD_TYPE, 00081 * const DATA_SET_ID, 00082 * const DATA_SET_NAME, 00083 * const PRODUCER_INSTITUTION_NAME, 00084 * const PRODUCER_ID, 00085 * const PRODUCER_FULL_NAME, 00086 * const INSTRUMENT_HOST_NAME, 00087 * const INSTRUMENT_HOST_ID, 00088 * const INSTRUMENT_NAME, 00089 * const INSTRUMENT_ID, 00090 * const TARGET_NAME, 00091 * const FLIGHT_SOFTWARE_ID_PREFIX, 00092 * const PDS_NAMESPACE_PARAMETER_PREFIX; 00093 00095 static const char 00096 * const DEFAULT_DATA_SET_VERSION; 00097 00099 static const char 00100 * const DEFAULT_PRODUCT_VERSION; 00101 00113 static const char 00114 * const NON_PDS_NAMESPACE_PARAMETERS[]; 00115 00117 static const int 00118 MINIMUM_MICROSECONDS_PRECISION; 00119 00121 static const int 00122 PVL_PDS_BYTES; 00123 00124 /*============================================================================== 00125 Constructors 00126 */ 00128 Observation (); 00129 00149 explicit Observation (std::istream& stream); 00150 00151 /*============================================================================== 00152 Accessors 00153 */ 00167 std::string data_ID () const; 00168 00204 std::vector<Data_Component*>& data_components () 00205 {return Components;} 00206 00216 unsigned int line_count () const 00217 {return Line.count ();} 00218 00219 /*============================================================================== 00220 I/O 00221 */ 00232 std::istream& source () const; 00233 00252 Observation& source (std::istream& stream) 00253 {Source = &stream; Bytes_Read = 0; return *this;} 00254 00308 bool components (); 00309 00324 unsigned long components (std::ostream& stream) const; 00325 00343 Observation& line (); 00344 00358 std::ostream& line (std::ostream& stream) const; 00359 00399 void reset_line (); 00400 00430 Observation& mirror_channel_1 (bool enable) 00431 {Mirror_Channel_1 = enable; return *this;} 00432 00439 bool mirror_channel_1 () const 00440 {return Mirror_Channel_1;} 00441 00452 static void mirror_channel_1_default (bool enable) 00453 {Mirror_Channel_1_Default = enable;} 00454 00465 static bool mirror_channel_1_default () 00466 {return Mirror_Channel_1_Default;} 00467 00482 unsigned long long bytes_read () const 00483 {return Bytes_Read;} 00484 00498 std::ostream& print 00499 (std::ostream& stream = std::cout, bool verbose = false) const; 00500 00506 std::string data_set_version () const 00507 {return Data_Set_Version;} 00508 00521 Observation& data_set_version (const char* version); 00522 00527 std::string product_version () const 00528 {return Product_Version;} 00529 00542 Observation& product_version (const char* version); 00543 00544 #if defined (INCLUDE_PVL) 00545 /*============================================================================== 00546 PVL 00547 */ 00564 idaeim::PVL::Aggregate* PVL () const; 00565 00620 idaeim::PVL::Aggregate* PVL_PDS () const 00621 {return PVL_PDS (Line);} 00622 00623 idaeim::PVL::Aggregate* PVL_PDS (const Image_Line& image_line) const; 00624 00649 static void gap_map_shift (idaeim::PVL::Parameter* gap_map, int shift); 00650 00651 #endif // defined (INCLUDE_PVL) 00652 00653 /*------------------------------------------------------------------------------ 00654 Data 00655 */ 00656 // Data_Component blocks: 00657 00659 MROSP_Header 00660 MROSP; 00661 00663 Science_Channel_Header 00664 Science; 00665 00667 LUT 00668 Lookup_Table; 00669 00671 Engineering_Header 00672 Engineering; 00673 00675 Image_Line 00676 Line; 00677 00679 Gap_Map 00680 Gaps; 00681 00683 std::vector<Data_Component*> 00684 Components; 00685 00686 /*.............................................................................. 00687 Object management data memembers 00688 */ 00689 private: 00690 00692 std::istream 00693 *Source; 00694 00696 unsigned long long 00697 Bytes_Read; 00698 00700 static bool 00701 Mirror_Channel_1_Default; 00702 00704 bool 00705 Mirror_Channel_1; 00706 00708 std::string 00709 Data_Set_Version; 00710 00712 std::string 00713 Product_Version; 00714 00715 }; // class Observation 00716 00717 /*============================================================================== 00718 Helper functions 00719 */ 00727 std::ostream& operator<< 00728 (std::ostream& stream, const Observation& observation); 00729 00730 } // namespace HiRISE 00731 } // namespace UA 00732 #endif