Skip to content
Snippets Groups Projects
Commit 7c2d25ef authored by Carsten Hinz's avatar Carsten Hinz
Browse files

changed time interval to only three days

added additional tests for type_of_area
and comment different out
parent 66757d55
No related branches found
No related tags found
1 merge request!11Creation of first beta release version
%% Cell type:code id: tags:
``` python
from datetime import datetime, timedelta
from toargridding.metadata import TimeSample, Metadata
sampling = "daily" # FIXME check monthly !!!
start = datetime(2010, 1, 1)
end = datetime(2010, 2, 1)
end = datetime(2010, 1, 3)
statistics_endpoint = "https://toar-data.fz-juelich.de/api/v2/analysis/statistics/"
statistic = "mean"
time = TimeSample(start, end, sampling=sampling)
# { "station_type_of_area" : "urban" } category is not known
#metadata = Metadata.construct("mole_fraction_of_ozone_in_air", time, statistic, { "toar1_category" : "RuralLowElevation"})#
metadata = Metadata.construct("mole_fraction_of_ozone_in_air", time, statistic, { "type_of_area" : "Urban" })#also test Rural, Suburban,
#metadata = Metadata.construct("mole_fraction_of_ozone_in_air", time, statistic, { "type_of_area" : "Urban" })#also test Rural, Suburban,
metadata = Metadata.construct("mole_fraction_of_ozone_in_air", time, statistic, { "type_of_area" : "Rural" })#also test Rural, Suburban,
start_time = datetime.now()
print(start_time)
```
%% Cell type:code id: tags:
``` python
from pathlib import Path
from toargridding.toar_rest_client import AnalysisServiceDownload
#creation of output directories
toargridding_base_path = Path(".")
cache_dir = toargridding_base_path / "results"
download_dir = toargridding_base_path / "data"
cache_dir.mkdir(parents=True, exist_ok=True)
download_dir.mkdir(parents=True, exist_ok=True)
analysis_service = AnalysisServiceDownload(statistics_endpoint, cache_dir, download_dir)
results = analysis_service.get_data(metadata)
end_time = datetime.now()
print(end_time-start_time)
```
%% Cell type:code id: tags:
``` python
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment