Observation
|
A Gap_Map contains a map of data gap ranges for the file with which it is associated. More...
#include <Gap_Map.hh>
Public Types | |
enum | End_Point { RANGE_START , RANGE_END } |
Gap range end-point value symbols. More... | |
enum | { INSIDE = -1 , OUTSIDE = 0 , OVERLAP = 1 } |
Return values for in_gap(Location, Location) method. More... | |
typedef u_int_32 | Location |
A gap range end-point offset location value. More... | |
typedef std::pair< Location, Location > | Range |
A gap range end-point pair of offset location values. More... | |
typedef std::vector< Range > | List |
A list of gap range pairs. More... | |
Public Types inherited from Data_Block | |
enum | Data_Order |
enum | Array_Index_Counts |
enum | Array_Offset_Counts |
typedef unsigned int | Index |
typedef std::vector< Index > | Value_List |
typedef void(* | Copier) (unsigned char *destination, int destination_amount, const unsigned char *source, int source_amount) |
Public Member Functions | |
Gap_Map () | |
Constructs an empty Gap_Map. More... | |
Gap_Map (std::istream &stream, unsigned int count) | |
Constructs a Gap_Map loaded from a data stream. More... | |
Gap_Map (const Gap_Map &map, bool data_duplicate=true) | |
Copy constructor. More... | |
Gap_Map & | operator= (const Gap_Map &map) |
Assigns another Gap_Map to this one. More... | |
virtual std::string | id () const |
Provides the class ID on a line followed by the base Data_Component::id. More... | |
virtual const char * | name () const |
Gets the NAME of this class. More... | |
virtual Location | get (Index range, End_Point end_point) const |
Gets a gap range end-point value. More... | |
Gap_Map::Range | gap (Index range) const |
Gets a gap Range. More... | |
Gap_Map::List | gaps () const |
Gets a List of Range pairs from the map. More... | |
unsigned int | total_gaps () const |
Gets the total number of gap segments in the map. More... | |
bool | in_gap (const Location location) const |
Tests if a location falls in a gap range. More... | |
int | in_gap (const Location start, const Location end) const |
Tests if a [start, end) range overlaps a gap range in the map. More... | |
int | in_gap (const Gap_Map::Range &range) const |
Tests if a Range overlaps a gap range in the map. More... | |
Gap_Map & | set (const Location start, const Location end) |
Sets a gap range. More... | |
Gap_Map & | set (const Gap_Map::Range &range) |
Sets a gap Range. More... | |
Gap_Map & | set (const Gap_Map::List list) |
Sets a list of gap ranges. More... | |
Gap_Map & | clear (const Location start, const Location end) |
Clears a gap range. More... | |
Gap_Map & | clear () |
Clears the entire map. More... | |
Gap_Map & | clear (const Gap_Map::Range &range) |
Clears a gap range. More... | |
Gap_Map & | clear (const Gap_Map::List list) |
Clears a list of gap ranges. More... | |
Gap_Map & | shift (int_32 amount) |
Shifts all range locations some amount. More... | |
virtual std::ostream & | print (std::ostream &stream=std::cout, bool verbose=false) const |
Prints the component structure and contents. More... | |
virtual idaeim::PVL::Aggregate * | PVL () const |
Produces a PVL rendition of the component. More... | |
idaeim::PVL::Aggregate * | PVL_description () const |
Produces a PVL description of a Gap_Map for a PDS label. More... | |
virtual bool | is_valid () const |
Tests if the component data is valid. More... | |
Public Member Functions inherited from Data_Component | |
Data_Component (const char **names=NULL, unsigned int size=0, const Index *offsets=NULL, const Index indexed_arrays[][2]=NULL, Data_Order order=Data_Block::MSB) | |
Constructs a Data_Component using component specifications. More... | |
Data_Component (const Data_Component &component, bool data_duplicate=true) | |
Copy constructor. More... | |
Data_Component & | operator= (const Data_Component &component) |
Assignment operator. More... | |
virtual | ~Data_Component () |
Destructor. More... | |
const char * | name (Index element) const |
Gets the name of a component Element. More... | |
virtual u_int_32 | get (Index element, Index index=0) const |
Gets a value from a data Element or array entry of the component. More... | |
virtual Data_Component & | put (const u_int_32 value, Index element, Index index=0) |
Puts a value into a data Element or array entry of the component. More... | |
std::ostream & | print_element (const Index element, int format=DECIMAL, std::ostream &stream=std::cout, int width=0) const |
Prints an Element description. More... | |
std::ostream & | print_element (const Index element, std::ostream &stream) const |
Prints an Element description. More... | |
std::ostream & | print_element_location (const Index element, std::ostream &stream=std::cout) const |
Prints the location of an Element in the component. More... | |
unsigned int | element_location_print_width (Index element) const |
Gets the width of the Element location printing fields. More... | |
unsigned int | name_field_width () const |
Gets the width of the Element name printing field. More... | |
Data_Component & | name_field_width (unsigned int width) |
Sets the width of the Element name field for printing. More... | |
Data_Block & | data (void *const block) |
Overrides the base Data_Block::data to reset Local_Data. More... | |
Data_Block & | attach (void *const block, unsigned int size) |
Attaches a new block of data to the component. More... | |
Data_Component & | resize (unsigned int size) |
Resizes the block of local data storage. More... | |
unsigned char * | data () const |
Gets a pointer to the current component storage. More... | |
unsigned int | local_data () |
Gets the size of the local data storage area. More... | |
u_int_16 | internet_checksum () const |
Calculates the Internet Checksum as per RFC 1071. More... | |
Public Member Functions inherited from Data_Block | |
Data_Block () | |
Data_Block (void *const data, const Index *offsets, Index total_elements=0, const Index *array_counts=NULL, bool native_order=true) | |
Data_Block (void *const data, const Value_List &offsets, const Value_List &array_counts, bool native_order=true) | |
Data_Block (void *const data, const Value_List &offsets, bool native_order=true) | |
Data_Block (void *const data, const Index *offsets, Index total_elements, const Index *array_counts, Data_Order data_order) | |
Data_Block (void *const data, const Value_List &offsets, const Value_List &array_counts, Data_Order data_order) | |
Data_Block (void *const data, const Index *offsets, Index total_elements, Data_Order data_order) | |
Data_Block (void *const data, const Index *offsets, Data_Order data_order) | |
Data_Block (void *const data, const Value_List &offsets, Data_Order data_order) | |
Data_Block (void *const data, const Index *offsets, const Index indexed_counts[][2], Data_Order data_order) | |
Data_Block (const Data_Block &data_block) | |
Data_Block & | operator= (const Data_Block &data_block) |
virtual | ~Data_Block () |
bool | native () const |
Data_Block & | native (bool native_order) |
Data_Order | data_order () const |
Data_Block & | data_order (Data_Order order) |
unsigned char * | data () const |
Index | size () const |
Value_List | element_offsets_list () const |
Index * | element_offsets () |
bool | element_offsets (const Value_List &offsets) |
bool | element_offsets (const Index *offsets, Index total_elements=NO_INDEX) |
bool | element_sizes (const Value_List &sizes) |
bool | element_sizes (const Index *sizes, Index total_elements=NO_INDEX) |
Index | offset_of (Index element) const |
bool | offset_of (Index element, Index offset) |
bool | insert_element (Index offset, Index size, Index array_count=1) |
Data_Block & | delete_element (Index element) |
Data_Block & | shift_offsets (int amount) |
Index | elements () const |
Index | size_of (Index element) const |
bool | size_of (Index element, Index size) |
Index | value_size_of (Index element) const |
Data_Block & | value_size_of (Index element, Index size) |
Index | index_of (Index offset) const |
Value_List | array_counts_list () const |
Index * | array_counts () |
Data_Block & | array_counts (const Value_List &counts, Index begin=0) |
Data_Block & | array_counts (const Index *counts, Index begin=0, Index end=NO_INDEX) |
Data_Block & | array_indexed_counts (const Index indexed_counts[][2], Index total_counts=NO_INDEX) |
Data_Block & | array_offset_counts (const Index offset_counts[][2], Index total_counts=NO_INDEX) |
Index | count_of (Index element) const |
Data_Block & | count_of (Index element, Index count) |
bool | reset_counts (bool unconditional=true, Index begin=0, Index end=NO_INDEX) |
const Data_Block & | get (T &value, const Index element, const Index index=0) const |
const Data_Block & | get (T &value, const Index element, const Index index=0) const |
T | get (const Index element, const Index index=0) const |
T | get (const Index element, const Index index=0) const |
Data_Block & | put (T &value, const Index element, const Index index=0) |
Data_Block & | put (T &value, const Index element, const Index index=0) |
const Data_Block & | get (T *array, const Index element, Index count=0) const |
const Data_Block & | get (T *array, const Index element, Index count=0) const |
Data_Block & | put (T *array, const Index element, Index count=0) |
Data_Block & | put (T *array, const Index element, Index count=0) |
std::istream & | input (std::istream &stream) |
std::ostream & | output (std::ostream &stream) const |
std::ostream & | print (std::ostream &stream=std::cout) const |
Static Public Member Functions | |
static Gap_Map::List | gaps_in (void *start, void *end, unsigned int threshold=0) |
Gets a list of gap ranges in a data block. More... | |
static unsigned int | sequence_threshold (unsigned int threshold=0) |
Gets the sequence threshold for determining a gap segment range, optionally setting a new threshold. More... | |
static Gap_Map::Range & | shift (Gap_Map::Range &range, int_32 amount) |
Shifts the end points of a Range some amount. More... | |
static Gap_Map::List & | shift (Gap_Map::List &list, int_32 amount) |
Shifts a List of Ranges some amount. More... | |
Static Public Member Functions inherited from Instrument | |
static unsigned int | calibration_lines_minimum (unsigned int TDI, unsigned int binning) |
static int | focal_plane_x_offset (unsigned int CPMM, unsigned int binning=1) |
Static Public Member Functions inherited from Data_Block | |
static Data_Order | native_order () |
static Value_List & | sizes_to_offsets (Value_List &sizes) |
static Index * | sizes_to_offsets (Index *sizes, Index total_elements=NO_INDEX) |
static Value_List & | offsets_to_sizes (Value_List &offsets) |
static Index * | offsets_to_sizes (Index *offsets, Index total_elements=NO_INDEX) |
Static Public Attributes | |
static const char *const | ID |
Class identification name with source code version and date. More... | |
static const char *const | NAME = "Gap Map" |
The component name. More... | |
static const char *const | END_POINT_NAMES [] |
Gap range end-point value names. More... | |
static const unsigned int | DEFAULT_SEQUENCE_THRESHOLD = GAP_MAP_DEFAULT_SEQUENCE_THRESHOLD |
The default sequence of gap byte values required for a gap segment. More... | |
static const u_int_8 | GAP_BYTE_VALUE = 0xFF |
The value of a "gap filled" data byte. More... | |
Static Public Attributes inherited from Data_Component | |
static const char *const | ID |
Class identification name with source code version and date. More... | |
static const int | DECIMAL = 0 |
Format specifier. More... | |
static const int | HEX = -1 |
static const int | BOOLEAN = -2 |
static const char | PATHNAME_DELIMITER = FILESYSTEM_PATHNAME_DELIMITER |
Host filesystem pathname delimiter. More... | |
static const int | UTC_SECONDS_PRECISION = SECONDS_PRECISION |
UTC seconds precision (digits after the decimal point). More... | |
static const char | SUBSECONDS_DELIMITER = ':' |
Delimits subseconds from seconds in clock count representations. More... | |
static const char *const | SPICE_METAKERNEL_VARIABLE |
The name of the environment variable for the SPICE metakernel pathname. More... | |
static const char *const | DEFAULT_SPICE_METAKERNEL |
The default SPICE metakernal pathname. More... | |
static const int | MRO_CLOCK_ID = MRO_CLOCK_NAIF_ID |
The ID used by NAIF for specifying the MRO clock to CSPICE routines. More... | |
static const char *const | INVALID_UTC_TIME = DEFAULT_INVALID_UTC_TIME |
Static Public Attributes inherited from Instrument | |
static const char *const | ID |
static const unsigned int | CCDS |
static const unsigned int | CCD_UNKNOWN |
static const char *const | CCD_NAMES [] |
static const char *const | CCD_FILTER_NAMES [] |
static const unsigned int | CCD_BY_CPMM [] |
static const unsigned int | CPMM_BY_CCD [] |
static const char *const | WAVELENGTH_UNITS |
static const unsigned int | CCD_CENTER_WAVELENGTHS [] |
static const unsigned int | CCD_BANDWIDTHS [] |
static const double | CCD_FOCAL_PLANE_X_OFFSETS_MM [] |
static const double | CCD_FOCAL_PLANE_Y_OFFSETS_MM [] |
static const double | CCD_PIXEL_SIZE_MM |
static const unsigned int | CCD_CHANNELS |
static const unsigned int | CCD_CHANNEL_UNKNOWN |
static const unsigned int | CCD_IMAGE_SENSORS |
static const unsigned int | MAX_BYTES_PER_PIXEL |
static const unsigned int | MAX_PIXEL_VALUES [] |
static const unsigned int | MAX_IMAGE_LINES |
static const unsigned int | TOTAL_TDI_STAGES |
static const unsigned int | TDI_STAGES [] |
static const unsigned int | TOTAL_BINNING_FACTORS |
static const unsigned int | BINNING_FACTORS [] |
static const unsigned int | CCD_BINNED_PIXELS [] |
static const unsigned int | STORED_LUTS |
static const unsigned int | STIMULATOR_LEDS |
static const char *const | STIMULATOR_LED_NAMES [] |
static const double | EXPOSURE_SETUP_MICROS |
static const unsigned int | DELTA_LINE_TIME_MAX |
static const double | DELTA_LINE_TIME_TICK_NANOS |
static const double | LINE_TIME_PRE_OFFSET |
static const unsigned int | TRIM_ADDITION_LINES |
static const unsigned int | REVERSE_READOUT_LINES |
static const unsigned int | MASKED_LINES |
static const unsigned int | DLL_LOCKED |
static const unsigned int | DLL_NOT_LOCKED |
static const unsigned int | SPACECRAFT_EPOCH |
static const double | MRO_CLOCK_SUBTICK_MICROS |
static const double | HIRISE_CLOCK_SUBTICK_MICROS |
static const int | SPACECRAFT_NAIF_ID |
static const unsigned int | SSR_BYTE_BOUNDARY |
static const int | UNKNOWN_NUMBER |
static const int | NOT_APPLICABLE_NUMBER |
static const char *const | UNKNOWN_STRING |
static const char *const | NOT_APPLICABLE_STRING |
Static Public Attributes inherited from Data_Block | |
static const char *const | ID |
static const Index | NO_INDEX |
Protected Member Functions | |
virtual Data_Component & | put (const Location location, Index range, End_Point end_point) |
Puts a the value of an end-point into a gap range. More... | |
Gap_Map & | insert_range (Index range, Location start, Location end) |
Inserts a new range into the map. More... | |
Gap_Map & | remove_range (Index first, Index last=(Index) -1) |
Removes ranges from the map. More... | |
Protected Member Functions inherited from Data_Block | |
void | limits_checker (const Index element, const Index index, bool getter, bool array) const |
Additional Inherited Members | |
Public Attributes inherited from Data_Block | |
MSB | |
LSB | |
ELEMENT_INDEX | |
INDEX_COUNT | |
ELEMENT_OFFSET | |
OFFSET_COUNT | |
Copier | Get |
Copier | Put |
Static Protected Member Functions inherited from Data_Block | |
static void | get_forwards (unsigned char *host, int host_amount, const unsigned char *data, int data_amount) |
static void | get_backwards (unsigned char *host, int host_amount, const unsigned char *data, int data_amount) |
static void | put_forwards (unsigned char *data, int data_amount, const unsigned char *host, int host_amount) |
static void | put_backwards (unsigned char *data, int data_amount, const unsigned char *host, int host_amount) |
A Gap_Map contains a map of data gap ranges for the file with which it is associated.
The map is composed of [start, end) Range value pairs where each pair defines the location of a gap segment in the associated file. The ranges are non-overlapping and ordered by increasing location values.
A data gap segment is defined as a contiguous sequence of {gap byte values}. The sequence threshold defines the minimum number of gap byte values that must be identified for a segment to be recognized. N.B.: The Gap_Map is implemented as a Data_Block containing a single array element of end-point values; two per range segment. Note: There is no Gap_Map component in an observation data file; one is generated for EDR product files. The Data_Component interface is provided for consistency with all other observation and EDR file components. Bradford Castalia, UA/PIRL 1.10 Data_Component
enum End_Point |
anonymous enum |
Gap_Map | ( | std::istream & | stream, |
unsigned int | count | ||
) |
Constructs a Gap_Map loaded from a data stream.
If the specified count of gap ranges can not be read from the stream the count will be adjusted to the nearest number of complete ranges actually read. Any extra bytes read are ignored. No more data is read than required for the range count specified.
stream | The istream from which to read the component data. |
count | The number of ranges in the map. |
References Data_Block::count_of(), Data_Block::input(), Data_Block::size(), and Data_Block::size_of().
Copy constructor.
map | The Gap_Map to be copied. |
data_duplicate | true if the data content of the copied component is to be duplicated in the copy; false if the data content is to be shared. |
Assigns another Gap_Map to this one.
map | The Gap_Map to be assigned. |
References Data_Component::operator=().
|
virtual |
Provides the class ID on a line followed by the base Data_Component::id.
Reimplemented from Data_Component.
References Data_Component::id(), and Gap_Map::ID.
|
virtual |
Gets the NAME of this class.
Implements Data_Component.
References Gap_Map::NAME.
Referenced by Observation::gap_map_shift().
|
virtual |
Gets a gap range end-point value.
range | The gap range to get. |
end_point | Either RANGE_START or RANGE_END. |
std::out_of_range | if the range is not in the map. |
std::invalid_argument | if an invalid end-point is specified. |
References Gap_Map::END_POINT_NAMES, Data_Component::get(), Gap_Map::ID, and Gap_Map::total_gaps().
Referenced by Gap_Map::clear(), Gap_Map::gap(), Gap_Map::in_gap(), Gap_Map::insert_range(), Gap_Map::print(), Gap_Map::PVL(), Gap_Map::set(), and Gap_Map::shift().
Gap_Map::Range gap | ( | Index | range | ) | const |
Gets a gap Range.
A gap Range has start (inclusive) and end (exclusive) end-point location values as its first and second values, respectively.
range | The gap range to get. |
std::out_of_range | if the range is not in the map. |
References Gap_Map::get(), Gap_Map::ID, Gap_Map::RANGE_END, Gap_Map::RANGE_START, and Gap_Map::total_gaps().
Referenced by Gap_Map::gaps().
Gap_Map::List gaps | ( | ) | const |
Gets a List of Range pairs from the map.
References Gap_Map::gap(), and Gap_Map::total_gaps().
|
inline |
Gets the total number of gap segments in the map.
References Data_Block::count_of().
Referenced by Gap_Map::clear(), Gap_Map::gap(), Gap_Map::gaps(), Gap_Map::get(), Gap_Map::in_gap(), Gap_Map::insert_range(), main(), Gap_Map::print(), Gap_Map::put(), Gap_Map::PVL(), Gap_Map::PVL_description(), Gap_Map::remove_range(), Gap_Map::set(), and Gap_Map::shift().
bool in_gap | ( | const Location | location | ) | const |
Tests if a location falls in a gap range.
location | The location to be tested. |
References Gap_Map::get(), Gap_Map::RANGE_END, Gap_Map::RANGE_START, and Gap_Map::total_gaps().
Referenced by Observation::components(), and Gap_Map::in_gap().
Tests if a [start, end) range overlaps a gap range in the map.
Reverse range locations - in which start > end - may be specified (see the Note for the set method).
start | The starting (inclusive) location byte (0-based) of the range. |
end | The ending (exclusive) location byte of the range. |
References Gap_Map::get(), Gap_Map::INSIDE, Gap_Map::OUTSIDE, Gap_Map::OVERLAP, Gap_Map::RANGE_END, Gap_Map::RANGE_START, and Gap_Map::total_gaps().
|
inline |
Tests if a Range overlaps a gap range in the map.
range | The Range to be tested. |
References Gap_Map::in_gap().
Sets a gap range.
The range may overlap existing ranges in the map. A range that falls totally within an existing map range results in no change to the map. A range that extends beyond existing map ranges results in coalescing overlapped ranges: all overlapped or abutted ranges will become one range - additional ranges are removed - with its start location at the lesser of the map range and specified range start locations and its end location at the greater of the map range and specified range end locations. If the range does not overlap any existing map ranges a new range will be inserted at the appropriate place in the map.
Note: The start and end locations may be specified in descending order - with start > end. The start location will still be inclusive and the end location exclusive. Thus the reverse range [n, m), where n > m, becomes [m+1, n+1). N.B.: Reverse ranges can never include 0 because, since Location values are unsigned, an end location of -1 is interpreted as the largest possible positive value.
start | The starting (inclusive) location byte (0-based) of the range. |
end | The ending (exclusive) location byte of the range. |
References Gap_Map::get(), Gap_Map::insert_range(), Gap_Map::put(), Gap_Map::RANGE_END, Gap_Map::RANGE_START, Gap_Map::remove_range(), and Gap_Map::total_gaps().
Referenced by Observation::components(), Observation::line(), and Gap_Map::set().
|
inline |
Sets a gap Range.
range | The Range to be set. |
References Gap_Map::set().
Gap_Map & set | ( | const Gap_Map::List | list | ) |
Sets a list of gap ranges.
list | The list of gap ranges to be set. |
References Gap_Map::set().
Clears a gap range.
Reverse range locations - in which start > end - may be specified (see the Note for the set method).
The range may overlap existing map ranges. Completely overlapped ranges are removed. Ranges partially overlapped at the start or end have their start or end moved to the end or start of the specified range. A range that falls totally within an existing map range results in the range end being set to the specified range start and a new range inserted in the map with its start at the specified range end and its end at the map range end. A range that does not overlap any existing map ranges results in no change to the map.
start | The starting (inclusive) location byte (0-based) of the range. |
end | The ending (exclusive) location byte of the range. |
References Gap_Map::get(), Gap_Map::insert_range(), Gap_Map::put(), Gap_Map::RANGE_END, Gap_Map::RANGE_START, Gap_Map::remove_range(), and Gap_Map::total_gaps().
Referenced by Observation::components().
|
inline |
|
inline |
Clears a gap range.
range | The Range to be cleared. |
References Gap_Map::clear().
Gap_Map & clear | ( | const Gap_Map::List | list | ) |
Clears a list of gap ranges.
list | The list of gap ranges to be cleared. |
References Gap_Map::clear().
Shifts all range locations some amount.
A negative shift that would move a range start location below 0 results in the range start being clipped to 0. If the shift would move a range end location at or below 0 the range is removed from the map.
amount | The amount of the shift (positive or negative). |
References Gap_Map::get(), Gap_Map::put(), Gap_Map::RANGE_END, Gap_Map::RANGE_START, Gap_Map::remove_range(), and Gap_Map::total_gaps().
Referenced by Observation::components(), Observation::line(), and Gap_Map::shift().
|
protectedvirtual |
Puts a the value of an end-point into a gap range.
The gap range is reset to the new range.
location | The end-point location. |
range | The gap range to modify. |
end_point | Either RANGE_START or RANGE_END. |
std::out_of_range | if the range is not in the map. |
std::invalid_argument | if an invalid end-point is specified. |
References Gap_Map::END_POINT_NAMES, Gap_Map::ID, and Gap_Map::total_gaps().
Referenced by Gap_Map::clear(), Gap_Map::insert_range(), Gap_Map::set(), and Gap_Map::shift().
Inserts a new range into the map.
The range may not overlap any existing map ranges. The new range will be inserted before the specified range.
range | The Index where the new range is to be inserted in the gap map. |
start | The starting (inclusive) location byte (0-based) of the range. |
end | The ending (exclusive) location byte of the range. |
range_error | If the range number is greater than the current number of map ranges, the start of the range is greater than or equal to the end of the preceeding map range (if there is one), or the end of the range is greater than or equal to the start of the following map range. |
References Data_Component::attach(), Data_Block::count_of(), Data_Component::data(), Gap_Map::get(), Gap_Map::ID, Gap_Map::put(), Gap_Map::RANGE_END, Gap_Map::RANGE_START, Data_Block::size(), Data_Block::size_of(), and Gap_Map::total_gaps().
Referenced by Gap_Map::clear(), and Gap_Map::set().
Removes ranges from the map.
All ranges from first to last (inclusive) are removed from the map. If only one range is specified it will be the only one removed. Ranges not in the map are silently ignored.
first | The number (0-based) of the first range to be removed. |
last | The number of the last range to be removed. This argument is optional. |
References Data_Block::count_of(), Data_Component::data(), Data_Block::size_of(), and Gap_Map::total_gaps().
Referenced by Gap_Map::clear(), Gap_Map::set(), and Gap_Map::shift().
|
virtual |
Prints the component structure and contents.
Each range of the map is printed on a separate line. Each range description line has the format:
Element@Offset:Count*Size : Start End
where:
All parts of the listing are right justified in their space padded fields. Values that are longer than the available field width will result in a larger field to accommodate the entire value. @param stream The ostream where the listing will be written. @param verbose true if the class name and ID are to be included in the listing. @return The stream that was written.
Implements Data_Component.
References Gap_Map::get(), Gap_Map::ID, Gap_Map::NAME, Data_Block::offset_of(), Gap_Map::RANGE_END, Gap_Map::RANGE_START, Gap_Map::total_gaps(), and Data_Block::value_size_of().
Referenced by list_selections(), and main().
|
virtual |
Produces a PVL rendition of the component.
The map is described as an Array of (start, end) Integer pairs.
Implements Data_Component.
References Aggregate::add(), Array::add(), Vectal< T >::clear(), Gap_Map::get(), Gap_Map::NAME, Gap_Map::RANGE_END, Gap_Map::RANGE_START, and Gap_Map::total_gaps().
Referenced by list_selections(), and main().
Aggregate * PVL_description | ( | ) | const |
Produces a PVL description of a Gap_Map for a PDS label.
The description is an OBJECT that contains the PDS parameters required to describe a data product binary data object.
References Parser::get_parameters(), Gap_Map::ID, UA::HiRISE::PVL_value(), and Gap_Map::total_gaps().
Referenced by Observation::PVL_PDS().
|
virtual |
Tests if the component data is valid.
Implements Data_Component.
|
static |
Gets a list of gap ranges in a data block.
The data block is scanned for data bytes with a value of GAP_BYTE_VALUE. The number of such contigous bytes must reach a threshold for a gap segment to be identified.
start | The address where the data block starts (inclusive). |
end | The address where the data block ends (exclusive). |
threshold | The gap sequence threshold to use. If not specified (or zero) the sequence threshold is used. |
References Gap_Map::GAP_BYTE_VALUE.
Referenced by Observation::components(), and Observation::line().
|
static |
Gets the sequence threshold for determining a gap segment range, optionally setting a new threshold.
The sequence threshold is the minimum number of contiguous data bytes with a value of GAP_BYTE_VALUE that are required to identify a gap segment. The value is intialized to the DEFAULT_SEQUENCE_THRESHOLD value.
threshold | The new sequence threshold amount. If not provided (or zero) a new value will not be set. |
Referenced by Observation::components().
|
static |
Shifts the end points of a Range some amount.
If the shift would move the range end location at or below 0 the range becomes empty in the sense that both its lower and upper bounds are zero.
range | The Range to have its end points shifted. |
amount | The amount of the shift (positive or negative). |
|
static |
Shifts a List of Ranges some amount.
list | The List containing the ranges to be shifted. |
amount | The amount of the shift (positive or negative). |
References Gap_Map::shift().
|
static |
Class identification name with source code version and date.
Referenced by Gap_Map::gap(), Gap_Map::get(), Gap_Map::id(), Gap_Map::insert_range(), Gap_Map::print(), Gap_Map::put(), and Gap_Map::PVL_description().
|
static |
The component name.
Referenced by Gap_Map::name(), Gap_Map::print(), and Gap_Map::PVL().
|
static |
Gap range end-point value names.
Referenced by Gap_Map::get(), and Gap_Map::put().
|
static |
The default sequence of gap byte values required for a gap segment.
|
static |
The value of a "gap filled" data byte.
Referenced by Observation::components(), and Gap_Map::gaps_in().