Classes | |
class | FetchTimeserieError |
class | MetaFile |
AMDA_EARTH info_amda_earth = { 'website': 'forecast.irap.omp.eu', 'user' : 'connecttool', 'port' : 22, 'src' : '/net/rosina1/ROSINA_B1/PROPTOOL/Speedinsitu/EARTH', EARTH_20160701_20161231.asc 'refile' : 'EARTH_[0-9]{8}_[0-9]{8}.asc', 'datadir': os.path.join(path_obs,'Insitu/EARTH'), 'obs' : 'amda', 'instr' : 'earth', 'ext' : 'txt', }. More... | |
Functions | |
def | print_metafiles |
From a MetaFile list, print file metadata in a readable way. More... | |
def | find_fetch_level |
For a given fetch type, return the fetch level of the filename. More... | |
def | total_fetch_level |
For a given fetch type, return the number of available flevel. More... | |
def | find_fetch_types |
Return all fetch_type for a given table or for all table. More... | |
def | get_datetime |
Extract date from a timeserie filename, according to its fetch_type and fetch level. More... | |
def | get_time |
Get module_timespace.Time object from the filename, according to its table name or a list of possible table names. More... | |
def | set_datetime |
Recompose the filename of a timeserie file for a datetime.datime, according to fetch_type and fetch level. More... | |
def | set_name_np1 |
For a given filename of flevel n, build the corresponding name of flevel n+1. More... | |
def | connect_remote_server |
Connect to the remote remote server. More... | |
def | close_remote_server |
Close connection to the remote remote server. More... | |
def | read_remote_server |
Find all files listed on the remote server associated with the given fetch_type. More... | |
def | vn2vnp1 |
For some Nth fetch level files, select which files need to be created in the N+1th fetch level. More... | |
Variables | |
dictionary | fetch_info = {} |
def fetchtimeserie.interface_fetch_timeserie.close_remote_server | ( | fetch_type, | |
server | |||
) |
Close connection to the remote remote server.
def fetchtimeserie.interface_fetch_timeserie.connect_remote_server | ( | fetch_type | ) |
Connect to the remote remote server.
def fetchtimeserie.interface_fetch_timeserie.find_fetch_level | ( | fetch_type, | |
filename | |||
) |
For a given fetch type, return the fetch level of the filename.
def fetchtimeserie.interface_fetch_timeserie.find_fetch_types | ( | table_names = [] | ) |
Return all fetch_type for a given table or for all table.
If table_name is given, search fetch_types for this table.
If table_name is not given, search fetch_types for all tables.
[in] | table_names | Optional, list of table name. Default: all tables. |
def fetchtimeserie.interface_fetch_timeserie.get_datetime | ( | fetch_type, | |
flevel, | |||
filename | |||
) |
Extract date from a timeserie filename, according to its fetch_type and fetch level.
def fetchtimeserie.interface_fetch_timeserie.get_time | ( | tables, | |
filename | |||
) |
Get module_timespace.Time object from the filename, according to its table name or a list of possible table names.
def fetchtimeserie.interface_fetch_timeserie.print_metafiles | ( | metafiles | ) |
From a MetaFile list, print file metadata in a readable way.
If Metafile[0].date is an integer, suppose it is a Carrington rotation number and concatenate list by year: Year: CR1 CR2 ... CRn
If Metafile[0].date is a datetime object, concatenate list by day of year: Doy: map1 map2 ... mapn
def fetchtimeserie.interface_fetch_timeserie.read_remote_server | ( | fetch_type, | |
server, | |||
date_min = module_timespace.today_midnight-datetime.timedelta(days=2) |
|||
) |
Find all files listed on the remote server associated with the given fetch_type.
[in] | fetch_type | One of interface_fetch_timeserie_fetch_types |
[in] | server | Object returned by connect_remote_server. FTP/SFTP/URL client. |
[in] | date_min | Datetime.datetime object. Minimum date you want to get. Only for DISCOVER_MAG,DISCOVER_VELOCITY,STEREOA_MAG,STEREOA_VELOCITY |
def fetchtimeserie.interface_fetch_timeserie.set_datetime | ( | fetch_type, | |
flevel, | |||
date_in | |||
) |
Recompose the filename of a timeserie file for a datetime.datime, according to fetch_type and fetch level.
For flevel == 0, recomposed filename may be miswritten because original name has some additionnal information. For flevel > 0 or 1, should be fine.
def fetchtimeserie.interface_fetch_timeserie.set_name_np1 | ( | fetch_type, | |
name_n, | |||
flevel_n | |||
) |
For a given filename of flevel n, build the corresponding name of flevel n+1.
[in] | fetch_type | |
[in] | name_n | name in flevel n |
[in] | flevel_n | Fetch level number n |
[out] | name_np1 | name in flevel n+1 |
def fetchtimeserie.interface_fetch_timeserie.total_fetch_level | ( | fetch_type | ) |
For a given fetch type, return the number of available flevel.
def fetchtimeserie.interface_fetch_timeserie.vn2vnp1 | ( | metafiles, | |
fetch_type, | |||
flevel_origin, | |||
force = False , |
|||
local_dir = None |
|||
) |
For some Nth fetch level files, select which files need to be created in the N+1th fetch level.
Select Nth file if:
Then add the Nth file to the to_be_formatted list.
Else skip the Nth file.
Fetch type = -1: file on the remote server.
[in] | metafiles | Nth fetch level files |
[in] | fetch_type | |
[in] | flevel_origin | N value |
[in] | local_dir | Default fetch_info[fetch_type][dirname]. Only for testing purpose. |
[out] | to_be_formatted | metafile list |
dictionary fetchtimeserie.interface_fetch_timeserie.fetch_info = {} |