Classes | |
class | FetchCholeError |
class | MetaFile |
Class representing metadata of a file. 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 fetch_level. 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 coronal hole filename, according to its fetch_type and version. More... | |
def | set_datetime |
Recompose the filename of a coronal hole file for a datetime.datime, according to fetch_type and version. More... | |
def | set_name_np1 |
For a given filename of fetch level n, build the corresponding name of fetch level n+1. More... | |
def | connect_remote_server |
Connect to the 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 fetchchole.interface_fetch_chole.close_remote_server | ( | fetch_type, | |
server | |||
) |
Close connection to the remote remote server.
def fetchchole.interface_fetch_chole.connect_remote_server | ( | fetch_type | ) |
Connect to the remote server.
def fetchchole.interface_fetch_chole.find_fetch_level | ( | fetch_type, | |
filename | |||
) |
For a given fetch type, return the fetch level of the filename.
def fetchchole.interface_fetch_chole.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 fetchchole.interface_fetch_chole.get_datetime | ( | fetch_type, | |
version, | |||
filename | |||
) |
Extract date from a coronal hole filename, according to its fetch_type and version.
def fetchchole.interface_fetch_chole.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 fetchchole.interface_fetch_chole.read_remote_server | ( | fetch_type, | |
server, | |||
date_min = None , |
|||
date_max = None |
|||
) |
Find all files listed on the remote server associated with the given fetch_type.
[in] | fetch_type | One of interface_fetch_map2D_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 NSO_DATE, NSOZ_DATE and ADAPT*_DATE) |
[in] | date_max | Datetime.datetime object. Maximum date you want to get (only for NSO_DATE, NSOZ_DATE and ADAPT*_DATE) |
def fetchchole.interface_fetch_chole.set_datetime | ( | fetch_type, | |
version, | |||
date_in | |||
) |
Recompose the filename of a coronal hole file for a datetime.datime, according to fetch_type and version.
For version == 0, recomposed filename may be miswritten because original name has some additionnal information. For version > 0, should be fine.
def fetchchole.interface_fetch_chole.set_name_np1 | ( | fetch_type, | |
name_n, | |||
flevel_n, | |||
local_dir = None |
|||
) |
For a given filename of fetch level n, build the corresponding name of fetch level n+1.
[in] | fetch_type | |
[in] | name_n | name in flevel n |
[in] | flevel_n | Fetch level number n |
[in] | local_dir | (Only for SOLARMONITOR_CHIMERA flevel 0 -> 1) Folder path of the file in flevel n |
[out] | name_np1 | name in fetch level n+1 |
def fetchchole.interface_fetch_chole.total_fetch_level | ( | fetch_type | ) |
For a given fetch type, return the number of available fetch_level.
def fetchchole.interface_fetch_chole.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 fetchchole.interface_fetch_chole.fetch_info = {} |