Read the SciHub login information (read_scihub_login()
),
save new username and password (write_scihub_login()
)
or check their validity (check_scihub_login()
).
Login information is stored in a file apihub.txt
inside the
".sen2r" subfolder of the home directory. This functions allow to read
or write this file, and to edit them from inside the GUI.
read_scihub_login(apihub_path = NA) check_scihub_login(username, password) check_scihub_connection() write_scihub_login( username, password, apihub_path = NA, check = TRUE, append = FALSE )
apihub_path | Path of the file in which login information is saved. If NA (default) it is automatically read from the package default location. |
---|---|
username | SciHub username. |
password | SciHub password. |
check | Logical: if TRUE (default), new credentials are checked
before writing them on |
append | Logical: if TRUE, new credentials are added
to the ones existing within |
read_scihub_login
returns a matrix of credentials,
in which username
is in the first column, password
in the second.
check_scihub_login
returns TRUE if credentials are valid,
FALSE elsewhere.
check_scihub_connection
returns TRUE if internet connection
is available and SciHub is accessible, FALSE otherwise.
write_scihub_login
returns NULL.
Notice that new/recently updated SciHub credentials are recognised by API Hub with a delay of about one week (see https://scihub.copernicus.eu/twiki/do/view/SciHubWebPortal/APIHubDescription for details).
For this reason, newly created credentials can not immediately be used by sen2r
,
and password edits on old credentials are not immediately recognised.
License: GPL 3.0
check_scihub_login("user", "user")#> [1] TRUEwrite_scihub_login("user", "user") read_scihub_login()#> [,1] [,2] #> [1,] "user" "user"check_scihub_connection()#> [1] TRUE