MERIS IDL General Purpose Tools

Issue 2.1

August 2001

 

Reading data from Level 1 intermediate/breakpoint files

Reading data from Level 1 intermediate/breakpoint files

Last modified: Thu Nov 29 18:34:02 2001.


List of Routines


Routine Descriptions

RD_RWMAP

[List of Routines]
 NAME:
     RD_RWMAP

 PURPOSE:
     retrieves data from MEGS L1 intermediate data files
     and stores the content (header and optionaly data)
     in a structure.
     It accepts all types of MEGS L1b intermediate files:
     tmp_rad1.meg, tmp_rad2.meg: calibrated & stray light corrected radiances resp.
     tmp_fla1.meg, tmp_fla2.meg: pixel flags associated to above radiances resp.
     tmp_buf.meg: geo-location and meteo annotations at tie points
     tmp_pcd.meg: internal PCDs at both frame and product level
     see OUTPUTS for more details on each file content

 CATEGORY:
     I/O

 CALLING SEQUENCE:
     map=RD_RWMAP(FILENAME=filename,/HEADER,/VERBOSE,/LAMBDA,/PIXEL, $
                   PARAM=param, ZONE=[X0,Y0,X1,Y1,DX,DY])

 INPUTS:
     All input parameters are passed with keywords (see below).

 OPTIONAL INPUTS:
     None

 KEYWORD PARAMETERS:
       FILENAME - data filename (need not be a MEGS file name, if not
                                 the user will be asked for a type)
       HEADER   - when set only the header of the file is retrieved
       DATA     - when set only the data of the file is retrieved
       VERBOSE  - when set then produces additional diagnostic outputs
                  during the reading of the data file.
       LAMBDA   - when set then one field is created for each wavelength
                  (applicable to intermediate radiance files only:
                   tmp_rad1.meg or tmp_rad2.meg)
       ZONE     - integer array of 4,5 or 6 values defining area to retrieve
                  ZONE=[X0,Y0,X1,Y1,DX,DY] DX and DY are subsampling
                  factors in X/Y directions
       PARAM    - string array specifying the fields to retrieve
       PIXEL    - when set then annotations are interpolated to pixel product
 OUTPUTS:
       Structure with tags "header" and "data" the content of which vary
       with the file type.
       Note that data tag may be omitted if HEADER keyword is set.
         1) radiance files:
           "header" is a structure with tags :
              filename      - full path to the file (syntax is platform dependant)
              common_hdr    - file common header (for format identification only)
	           simulator_id  - name of simulator that generated the file (MEGS or MERSS)
	           fld_03        - info field (software name and version, MEGS only)
	           fld_04        - info field (resolution in MEGS)
	           fld_05        - info field, not used
	           fld_06        - info field, not used
	           fld_07        - date array [yy,mm,dd,hh,mn,ss,ms] not used in MEGS
	           n_frames      - number of frames in file (=AL dimension)
	           JD_first      - UTC time of first frame (processing format)
	           JD_last       - UTC time of last frame (processing format)
	           fld_11        - unused
	           fld_12        - index of first extracted module (starts at 1)
	           n_modules     - number of extracted modules
	           n_columns     - total number of columns (all modules, =AC dimension)
	           fld_15        - unused
	           n_bands       - number of bands (=15)
	           wavelengths   - array of band central wavelengths (nm)
	           band_widths   - array of band widths (FWHM, nm)
           "data" is a structure with tags :
              l1masks - array of dimensions [n_columns,n_frames]
                      holding mask registers contained in file.
                      NOTE: those masks are not set within MEGS, they
                      are included for compatibility with MERSS format
              and either a global array (default):
                values - array of dimensions [n_bands,n_columns,n_frames] holding
                       radiance data for all bands
              or per band arrays (optional keyword LAMBDA set):
                rad1_xxx or rad2_xxx (depending on file type) - arrays of dimensions
                       [n_columns,n_frames] holding radiance data for
                       each band separately. xxx is the wavelength as extracted from
                       the header and rounded to nearest integer

         2) flag files:
           "header" is a structure with tags :
              filename      - full path to the file (syntax is platform dependant)
              common_hdr    - file common header (for format identification only)
              n_frames      - number of frames in file (=AL dimension)
              n_columns     - total number of columns (all modules, =AC dimension)
           "data" is a structure with tags :
              frame_index   - vector of frame indices (length n_frames)
              JD            - vector of frame times in processing format (length n_frames)
              valid_frame_f - vector of frame validity flags (1=valid, length n_frames)
              l1saturated_f - array of saturated samples per band flags register, size [n_columns,n_frames]
              l1dubious_f   - array of dubious samples per band flags register, size [n_columns,n_frames]
              l1cosmetic_f  - array of cosmetic samples per band flags register, size [n_columns,n_frames]
                         Note: for the 3 per band flag registers above: flags for band b is coded on bit b
                         of given register (band and bit indices start at 0, bit 0 is least significant)
              l1others_f    - array of size [n_columns,n_frames] holding various per pixel flags,
                              bits meaning are (if set):
                                0:land, (not set means water, from Atlas only: no radiometry)
                                1:not used
                                2:coastline,
                                3:bright,
                                4:duplicate,
                                5:glint risk,
                                6:stray light risk,
                                7:invalid.

         3) annotation file:
           "header" is a structure with tags :
              filename      - full path to the file (syntax is platform dependant)
              common_hdr    - file common header (for format identification only)
              n_tie_frames  - number of Tie Frames in file (=AL dimension)
              n_tie_columns - number of Tie Points (=AC dimension)
           "data" is a structure with tags :
              frame_index   - vector of frame indices (length n_frames)
              JD            - vector of frame times in processing format (length n_frames)
              pointing      - array of pointing angles at Tie Points (TP), size [n_tie_columns,n_tie_frames]
              latitude      - array of latitudes at TP, size [n_tie_columns,n_tie_frames]
              longitude     - array of longitudes at TP, size [n_tie_columns,n_tie_frames]
              altitude      - array of altitudes at TP, size [n_tie_columns,n_tie_frames]
              roughness     - array of surface roughness at TP, size [n_tie_columns,n_tie_frames]
              VAA           - array of View Aziumth Angle at TP, size [n_tie_columns,n_tie_frames]
              VZA           - array of View Zenith Angle at TP, size [n_tie_columns,n_tie_frames]
              SAA           - array of Sun Aziumth Angle at TP, size [n_tie_columns,n_tie_frames]
              SZA           - array of Sun Zenith Angle at TP, size [n_tie_columns,n_tie_frames]
              lat_corr      - array of latitude correction at TP (due to altitude), size [n_tie_columns,n_tie_frames]
              lon_corr      - array of longitude correction at TP (due to altitude), size [n_tie_columns,n_tie_frames]
              msl_press     - array of mean sea level pressure at TP, size [n_tie_columns,n_tie_frames]
              ozone         - array of total column ozone at TP, size [n_tie_columns,n_tie_frames]
              zonal_w       - array of zonal wind at 10m height at TP, size [n_tie_columns,n_tie_frames]
              merid_w       - array of meridional wind at 10m height at TP, size [n_tie_columns,n_tie_frames]
              humidity      - array of relative humidity at TP, size [n_tie_columns,n_tie_frames]

         4) PCD file:
           "header" is a structure with tags :
              filename      - full path to the file (syntax is platform dependant)
              common_hdr    - file common header (for format identification only)
              n_frames      - number of frames in file (=AL dimension)
              n_modules     - number of modules in file (=AC dimension)
           "data" is a structure with tags :
              frame_index   - vector of frame indices (length n_frames)
              JD            - vector of frame times in processing format (length n_frames)
              OutRgPCD      - array of image pixels Out Of Range PCD, size [16,n_modules,n_frames]
              BlankPCD      - array of Blank Pixels PCD, size [16,n_modules,n_frames]
              TRANS_ERR     - Transmission Error PCD (product wide, scalar)
              FORMAT_ERR    - Format Error PCD (product wide, scalar)
              COARSE_ERR    - Coarse Offsets Error PCD (product wide, scalar)
              DATABASE_ERR  - Auxiliary Database Error PCD (product wide, scalar)
              ECMWF_TYPE    - ECMWF Data Type PCD (product wide, scalar)
              ECMWF_LAG     - ECMWF Validity Time PCD (product wide, scalar)

 OPTIONAL OUTPUTS:
     When HEADER keyword is set then only the header is retrieved
     from the rwmap data file and the "DATA" tag is not present in
     the structure that is retrieved with this function.

 COMMON BLOCKS:
     None

 SIDE EFFECTS:
     Unknown

 RESTRICTIONS:
     None

 PROCEDURE:
     If filename is not passed as argument, a file browser is submitted to the user,
     when the filename is retrieved, either its type is recognised from the name or
     it is requested from the user. File is then checked for existence, readability and
     format. If everything is OK, the file is read record after record, each header
     and data tag is dimensioned according to its own record ID and header sizing
      parameters. Some field dimension and content are checked to confirm that the
     file is of rwmap format.

 EXAMPLES:
       struct=rd_rwmap()
       FILENAME='/megs/megs.4.3/folders/sat_l1/RR_Geoloc/files/tmp_rad1.meg'
       struct=RD_RWMAP(FILENAME=filename,/HEADER,/VERBOSE)
       struct=RD_RWMAP(FILENAME=filename,/VERBOSE)
       struct=RD_RWMAP(FILENAME=filename)
       struct=RD_RWMAP(FILENAME=filename,/LAMBDA)
       filename='/megs_test/validation/Level1b/Perfo/limub_pacific_45_stray.mer_RR'
       struct=rd_rwmap(FILENAME=filename)
 MODIFICATION HISTORY:
       Created Friday February 18 2000 by Vincent Fournier-Sicre - vfs@acri.fr
       modified 22/11/00 by lb@acri.fr (added read of 'tmp_buf.meg', L1B annotations
       intermediate file, see rd_rwmap_data)
       modified 03/12/00 by lb@acri.fr (replaced str_sep by strsplit)
       modified 20/11/01 by lb@acri.fr (added read of 'tmp_fla?.meg', 'tmp_pcd.meg',
       L1B flags and PCDs intermediate files, see rd_rwmap_data)
       modified 20/11/01 by lb@acri.fr: uniformisation of interfaces, documentation update,
                                        new keywords.

(See $IDL_LOCAL\Meris\rd_rwmap.pro)


HOME|Index|Work in Progress