Icare¶
pansat.download.providers.icare¶
This module providers the IcareProvider class, which implementes a data provider
class for downloading data from the
Icare datacenter.
-
class
pansat.download.providers.icare.IcareProvider(product)¶ Base class for data products available from the ICARE ftp server.
-
__init__(product)¶ Create a new product instance.
- Parameters
product (
Product) – Product class object with specific product for ICARE
-
_ftp_listing_to_list(path, item_type=<class 'int'>)¶ Retrieve directory content from ftp listing as list.
- Parameters
path (
str) – The path from which to retrieve the ftp listing.item_type (
type) – Type constructor to apply to the elements of the listing. To retrieve a list of strings use t = str.
- Returns
A list containing the content of the ftp directory.
-
download_file(filename, destination)¶ Download file from data provider.
- Parameters
filename (
str) – The name of the file to download.destination (
strorpathlib.Path) – path to directory where the downloaded files should be stored.
-
classmethod
get_available_products()¶ Return the names of products available from this data provider.
This method is used by each data product to determine whether it can use this provider to download data. The names provided here must therefore match the string representation returned by the product’s
__str__method.- Returns
A list of strings containing the names of the products that can be downloaded from this data provider.
-
get_files_by_day(year, day)¶ Return all files from given year and julian day.
- Parameters
year (
int) – The year from which to retrieve the filenames.day (
int) – Day of the year of the data from which to retrieve the the filenames.
- Returns
List of the filenames of this product on the given day.
-