Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends

PARASOLLeader Class Reference

#include <parasolleader.h>

Inheritance diagram for PARASOLLeader:
Inheritance graph
[legend]
Collaboration diagram for PARASOLLeader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PARASOLLeader (const string leader_filename="")
void print_leader_file_descriptor ()
 print out the leader file descriptor
void print_spatio_temp_char ()
 print out the spatio-temporal characteristics set in the leader file
void print_header ()
 print out the header set in the leader file
void print_instr_setting_param ()
 print out the instrument settings parameters set in the leader file
void print_scaling_factors ()
 print out the scaling factors set in the leader file
void print_techno_param ()
 print out the technological parameters set in the leader file

Public Attributes

LeaderFileDescriptorRecordleader_file_descriptor

Protected Member Functions

virtual const PARASOLFileFormatget_leader_file_format ()
 access to the leader file format for a given product level
const bool is_record_loaded (const Record &rec)
 check if a record has been read.
void free_record (const Record &rec)
 free the given record data
void free_records ()
 Free all records.
PARASOLFileRecordinit_record (const Record &rec)
 Initialize a record class.
const int get_record_offset (const Record &rec)
 access to ones record file offset If the record isn't in the leader leader file, it returns -1
const int get_entry_offset (const Record rec, const int entry_idx, const int group_idx=-1, const int subgroup_index=-1, const int val_index=-1)
 access to the offset of an entry, relative to the record start TODO example
vector< EntryBlockget_entry_block (const Record rec, const int entry_idx) const
 access to the offset of an entry, relative to the record start TODO example
const RecordFormat * get_record_format (const Record &rec)
 access to the RecordFormat object that describes the name, type, offset and length of each record entry
PARASOLFileRecordget_record (const Record &rec)
 access to one record entry

Protected Attributes

string filename
PARASOLLeaderFormatleader_file_format
HeaderRecordheader
SpatioTemporalCharacteristicsRecordspatio_temp_char
InstrumentSettingParametersRecordinstrument_setting_param
TechnologicalParametersRecordtechno_param
DataProcessingParametersRecorddata_processing_param
ScalingFactorsRecordscaling_factors
AnnotationsRecordannotations

Friends

class PARASOLFileData

Detailed Description

manages the reading of a PARASOL leader file.

Warning:
this class is designed to be general and treat all PARASOL leader files BUT it only has been fully implemented and tested for -> Level 2 products -> only the records "leader file descriptor", "header" and "scaling factors" have been tested because of the developper proper needs (and time)
Author:
Nicolas PASCAL

Member Function Documentation

void PARASOLLeader::free_record ( const Record &  rec  )  [protected]

free the given record data

Parameters:
rec the record code

Referenced by free_records(), and PARASOLFileData::load_viewing_directions_data().

vector< EntryBlock > PARASOLLeader::get_entry_block ( const Record  rec,
const int  entry_idx 
) const [protected, virtual]

access to the offset of an entry, relative to the record start TODO example

Parameters:
rec the concerned record
entry_idx index of the entry, start at 0, record_number is index 0
i_val indices of the value, for parametres repeated many times in a record
Returns:
the offset, from the record start returns the size (ni bytes) an a group that contains the given entry. If the entry is not repeated in a record, returns 0
Exceptions:
bad_parametre_idx if the entry idx is invalid for the current product
Parameters:
rec the considered record
entry_idx index of the entry (product specific)
Returns:
the size of the container group, in bytes. O if the entry is not in a group returns the number of times an entry group is repeated in the data record. If the entry is not repeated in a record, returns 1
Exceptions:
bad_parametre_idx if the entry idx is invalid for the current product
Parameters:
entry_idx index of the entry (product specific)
Returns:
the number of times the group is repeated return the block describing the given entry : the number of times the entry is repeated and the size in bytes of the group
Parameters:
rec current record
entry_idx indice of the entry
Returns:
the block(s) of the entry. If the entry is composed of a unique value, returns an empty vector

Implements PARASOLFileReader.

References PARASOLFileFormat::get_level(), and ScalingFactorsRecord::nb_pix_param.

const int PARASOLLeader::get_entry_offset ( const Record  rec,
const int  entry_idx,
const int  group_idx = -1,
const int  subgroup_index = -1,
const int  val_index = -1 
) [protected]

access to the offset of an entry, relative to the record start TODO example

Parameters:
rec the concerned record
entry_idx index of the entry, start at 0, record_number is index 0
group_idx index of an entry that is repeated in a record. Ex : In the spatio-temporal characteristic of L1 products, the sequence number of the entry : the "line number of pixel at nadir for 670"
subgroup_index unused at this time. Should be useful for technological param that has seq_nb and im_nb imbricated
val_index unused
Returns:
the offset, from the record start
virtual const PARASOLFileFormat* PARASOLLeader::get_leader_file_format (  )  [inline, protected, virtual]

access to the leader file format for a given product level

Returns:
the leader file format

Referenced by get_record_format(), print_header(), print_leader_file_descriptor(), print_scaling_factors(), print_spatio_temp_char(), and print_techno_param().

PARASOLFileRecord * PARASOLLeader::get_record ( const Record &  rec  )  [protected, virtual]

access to one record entry

Parameters:
rec the record code
Returns:
the entry corresponding to record code

Implements PARASOLFileReader.

Referenced by is_record_loaded().

const RecordFormat * PARASOLLeader::get_record_format ( const Record &  rec  )  [protected, virtual]

access to the RecordFormat object that describes the name, type, offset and length of each record entry

Parameters:
rec the record code
Returns:
the RecordFormat corresponding to record code

Implements PARASOLFileReader.

References get_leader_file_format().

const int PARASOLLeader::get_record_offset ( const Record &  rec  )  [protected, virtual]

access to ones record file offset If the record isn't in the leader leader file, it returns -1

Parameters:
rec the record code
Returns:
the record's offset in the leader file

Implements PARASOLFileReader.

References LeaderFileDescriptorRecord::get_record_size(), init_record(), is_record_loaded(), PARASOLFileReader::read_record(), and PARASOLFileRecord::rec_len.

PARASOLFileRecord * PARASOLLeader::init_record ( const Record &  rec  )  [protected, virtual]

Initialize a record class.

Parameters:
rec the record code
Returns:
the initialized object (or NULL in case of problem)

Implements PARASOLFileReader.

Referenced by get_record_offset().

const bool PARASOLLeader::is_record_loaded ( const Record &  rec  )  [protected, virtual]

check if a record has been read.

Returns:
true if the record has already been read

Implements PARASOLFileReader.

References get_record().

Referenced by get_record_offset(), and PARASOLFileData::get_record_time().


The documentation for this class was generated from the following files: