ESA.instrument.orbit_file_m
index
/home/lfeng/otool/ESA/instrument/orbit_file_m.py

Functions to read orbit file 
Authors: L. Feng, Edinburgh University
 
History: v0.9, 2012.06.28
History: v0.95, 2013.02.19
 
 
Functions
=================================================
1. get_orbit_column_name: check names of columns in orbit file 
2. open_orbit_file: set up class file_desc_cl for file access
3. read_orbit_file: read orbit data into class file_desc_cl
4. close_orbit_file: delete class file_desc_cl
 
5. get_orbit_data: get orbit at given date

 
Modules
       
ESA.util.message_m
numpy
ESA.util.otool_txtfile_io
ESA.util.otool_obj
ESA.util.time_module

 
Functions
       
close_orbit_file(fdesc)
Close fdesc file 
 
Inputs:
--------------------------------------------------
1. fdesc:<file_desc_cl>: class for file access
 
Returns:
1. None
get_orbit_column_name()
get default column name in the orbit file 
 
Returns
---------------------------------------
1. orb_colnm_lst:<list, str>: default name of columns in file
get_orbit_data(fdesc, **fio_keywords)
get orbit data
 
Inputs:
---------------------------------------------------------------
1. fdesc: <fdesc_cl>: class of desc
2. fio_keywords :<dict>: extra parameters for file access 
 
Returns:
-------------------------------------
1. fdesc.dtable:<recordarray>: table read from orbit file
open_orbit_file(flnm, datapath, viewtype, viewmode, yyyy, mm, dd, **fio_keywords)
open file to read orbit data 
 
Inputs:
-----------------------------------------------------------
1. flnm:<str>:   name of file (reserved for future use )
2. datapath:<str>: file path
3. viewtype:<str>: instrument type 
4. viewmode:<str>: nadir or glint view
5. yyyy: <int>: year
6. mm: <int>: month
7. dd:<int>: day of year
8. fio_keywords:<dict>: extra inputs. 
 
 --Reserved words:
 --->fl_colnm_lst: list of all column names in the file 
 --->sel_colnm_lst: list of the names for column to be read
 
 --->delim:<str>: dividing word
 --->header_start:<int>: header start line
 --->data_start:<int>: data start line 
 
Returns:
--------------------------------------------------------
1. fdesc:<file_desc_cl>: class for file access
read_orbit_file(fdesc, **fio_keywords)
Read orbit data into fdesc.detable
 
Inputs:
--------------------------------------------------
1. fdesc:<file_desc_cl>: class for file access
2. fio_keywords:<dict>: extra inputs for file read write
 
 --Reserved words:
 --->fl_colnm_lst: list of all column names in the file 
 --->sel_colnm_lst: list of the names for column to be read
    
 
 
 
 
Returns:
-------------------------------------
1. ndata:<int>: length of fdesc.dtable 
 
 
Notes:
-------------------------------------
1. data will be stored as recarray by fdesc.dtable

 
Data
        orb_column_lst = ['lat', 'lon', 'number', 'date', 'sza', 'effective']
orb_data_start = 4
orb_filename_format = 'XVIEWTYPEX_num_XVIEWMODEX_XDOYX.dat'
orb_header_start = 3
orb_varname_dict = {'cnt': 'number', 'lat': 'lat', 'lon': 'lon', 'sza': 'sza', 'time': 'date'}