Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
74e1423
init commit of extract_wind_data
Mar 19, 2025
456fddf
Added forecast step and forecast end hour to request; renamed x and y…
Mar 21, 2025
8448982
Changed forecast hour start and end metadata type from string to number
Mar 21, 2025
cbe4bd0
removed GEPS and RDWPS cases
gdecourval Mar 26, 2025
7633ac4
Removed geps case, merged rdwps case with hrdps and reps now only ser…
gdecourval Mar 26, 2025
869421c
Initial extract quartile process commit
gdecourval Apr 3, 2025
d5daca3
Merge pull request #1 from gdecourval/extract_quartile
gdecourval Apr 3, 2025
b332795
Removed unused comment
gdecourval Apr 4, 2025
9616a90
Merge pull request #3 from gdecourval/extract_quartile
gdecourval Apr 4, 2025
0bb0be6
lowered model case
gdecourval Apr 4, 2025
2e5416e
Merge pull request #4 from gdecourval/extract_wind_data
gdecourval Apr 4, 2025
baff946
Added rewps match to reps
gdecourval Apr 7, 2025
30387db
Merge pull request #5 from gdecourval/extract_wind_data
gdecourval Apr 7, 2025
4323d9c
Merge pull request #2 from gdecourval/dev
gdecourval Apr 8, 2025
ad9de62
lowered model case
gdecourval Apr 4, 2025
70635d7
Removed main and unimplemented function
gdecourval Apr 9, 2025
fc80730
Merge pull request #6 from gdecourval/extract_quartile
gdecourval Apr 9, 2025
b94a6e8
Merge pull request #7 from gdecourval/dev
gdecourval Apr 9, 2025
eceb41e
cansip 100km, time logic implemented (#398)
RousseauLambertLP Mar 29, 2025
2c45574
update cansips 100km collection title (#401)
RousseauLambertLP Apr 2, 2025
cb35e4b
serve swob station for surface, partner and marine (#355)
BrunoFang Apr 3, 2025
e662266
update cansips data path s/datasan/data/ (#402)
RousseauLambertLP Apr 4, 2025
b2c4d1e
fix bulletins sr3 config (do not save to disk) (#392)
tomkralidis Apr 7, 2025
174fc39
update bulletins url (#400)
RousseauLambertLP Apr 7, 2025
4d18410
update hydrometric station url (#399)
RousseauLambertLP Apr 7, 2025
ab92fd5
add missing properties to hydrometric stations docs (#389)
Dukestep Apr 7, 2025
d3c0668
initial implementation of provider for cansips 1-degree probabilistic…
Dukestep Apr 7, 2025
604649f
update openapi doc (#403)
RousseauLambertLP Apr 7, 2025
f8a4fde
fix OpenAPI ref
tomkralidis Apr 8, 2025
b2652fb
fix data path for cansips products collections (#404)
Dukestep Apr 8, 2025
2575f46
Update Dockerfile to use pygeoapi 0.20
Apr 9, 2025
6585ce3
update DEV URL (#406)
tomkralidis Apr 9, 2025
6e9f4e0
Added error logging
gdecourval Apr 10, 2025
f0ac17d
Flake8 fixes
gdecourval Apr 10, 2025
e34dbd0
Split and concatenated strings that were over flake8 length limit
gdecourval Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUN apt-get update && \
RUN apt-get install -y python3 python3-setuptools python3-pip git curl unzip python3-click python3-fiona python3-gdal python3-lxml python3-parse python3-pyproj python3-rasterio python3-requests python3-slugify python3-sqlalchemy python3-xarray python3-yaml

# install pygeoapi
RUN git clone $PYGEOAPI_GITREPO -b 0.19.0 && \
RUN git clone $PYGEOAPI_GITREPO -b 0.20.0 && \
cd pygeoapi && \
pip3 install -r requirements.txt && \
pip3 install flask_cors gunicorn gevent greenlet && \
Expand Down
2 changes: 1 addition & 1 deletion debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
export MSC_PYGEOAPI_ES_TIMEOUT=90
export MSC_PYGEOAPI_ES_URL=http://localhost:9200
export MSC_PYGEOAPI_CACHEDIR=/tmp
export MSC_PYGEOAPI_OGC_API_URL=https://api.wxod-dev.cmc.ec.gc.ca
export MSC_PYGEOAPI_OGC_API_URL=https://api.wxod-dev.edc-mtl.ec.gc.ca
export MSC_PYGEOAPI_OGC_API_URL_BASEPATH=/
export MSC_PYGEOAPI_METPX_EVENT_FILE_PY=msc_pygeoapi.event.EventAfterWork
export MSC_PYGEOAPI_METPX_EVENT_MESSAGE_PY=msc_pygeoapi.event.EventAfterAccept
Expand Down
235 changes: 230 additions & 5 deletions deploy/default/msc-pygeoapi-config.yml

Large diffs are not rendered by default.

17,785 changes: 9,321 additions & 8,464 deletions deploy/default/msc-pygeoapi-openapi.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deploy/default/msc-pygeoapi.wsgi
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import os
os.environ['PYGEOAPI_CONFIG'] = '/opt/msc-pygeoapi/conf/msc-pygeoapi-config.yml'
os.environ['PYGEOAPI_OPENAPI'] = '/opt/msc-pygeoapi/conf/msc-pygeoapi-openapi.yml'
os.environ['MSC_PYGEOAPI_ES_URL'] = 'http://localhost:9200'
os.environ['MSC_PYGEOAPI_OGC_API_URL'] = 'https://api.wxod-dev.cmc.ec.gc.ca'
os.environ['MSC_PYGEOAPI_OGC_API_URL'] = 'https://api.wxod-dev.edc-mtl.ec.gc.ca'
os.environ['MSC_PYGEOAPI_OGC_API_URL_BASEPATH'] = '/'
os.environ['MSC_PYGEOAPI_LOCALE'] = '/opt/msc-pygeoapi/locale'
os.environ['MSC_PYGEOAPI_TEMPLATES'] = '/opt/msc-pygeoapi/theme/templates'
Expand Down
3 changes: 2 additions & 1 deletion deploy/default/sarracenia/bulletins-realtime.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ instances 4
subtopic *.WXO-DD.bulletins.alphanumeric.#

mirror True
directory /tmp/bulletins
download off
directory /dev/null
callback ${MSC_PYGEOAPI_METPX_EVENT_MESSAGE_PY}
logLevel ${MSC_PYGEOAPI_LOGGING_LOGLEVEL}
report False
1 change: 1 addition & 0 deletions docker/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ MSC_PYGEOAPI_LOCALE=${BASEDIR}/msc-pygeoapi/locale

GEOMET_HPFX_BASEPATH=/data/geomet/feeds/hpfx
GEOMET_SCIENCE_BASEPATH=/data/geomet/feeds/cmoi-science
GEOMET_LOCAL_BASEPATH=/data/geomet/local

XDG_CACHE_HOME=/tmp/msc-pygeoapi-sarra-logs

Expand Down
3 changes: 2 additions & 1 deletion msc-pygeoapi.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export MSC_PYGEOAPI_ES_TIMEOUT=90
#export MSC_PYGEOAPI_ES_PASSWORD=bar
export MSC_PYGEOAPI_ES_URL=http://${MSC_PYGEOAPI_ES_USERNAME}:${MSC_PYGEOAPI_ES_PASSWORD}@localhost:9200
export MSC_PYGEOAPI_CACHEDIR=/tmp
export MSC_PYGEOAPI_OGC_API_URL=https://api.wxod-dev.cmc.ec.gc.ca
export MSC_PYGEOAPI_OGC_API_URL=https://api.wxod-dev.edc-mtl.ec.gc.ca
export MSC_PYGEOAPI_OGC_API_URL_BASEPATH=/
export MSC_PYGEOAPI_METPX_EVENT_FILE_PY=msc_pygeoapi.event.EventAfterWork
export MSC_PYGEOAPI_METPX_EVENT_MESSAGE_PY=msc_pygeoapi.event.EventAfterAccept
Expand All @@ -17,6 +17,7 @@ export MSC_PYGEOAPI_DMS_API_URL=http://host/search/v2.0

export GEOMET_HPFX_BASEPATH=/data/geomet/feeds/hpfx
export GEOMET_SCIENCE_BASEPATH=/data/geomet/feeds/cmoi-science
export GEOMET_LOCAL_BASEPATH=/data/geomet/local

export XDG_CACHE_HOME=/tmp/msc-pygeoapi-sarra-logs

Expand Down
1 change: 1 addition & 0 deletions msc_pygeoapi/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@

GEOMET_HPFX_BASEPATH = os.getenv('GEOMET_HPFX_BASEPATH', None)
GEOMET_SCIENCE_BASEPATH = os.getenv('GEOMET_SCIENCE_BASEPATH', None)
GEOMET_LOCAL_BASEPATH = os.getenv('GEOMET_LOCAL_BASEPATH', None)
1 change: 1 addition & 0 deletions msc_pygeoapi/loader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def metadata():
('msc_pygeoapi.loader.swob_realtime', 'swob_realtime'),
('msc_pygeoapi.loader.aqhi_realtime', 'aqhi_realtime'),
('msc_pygeoapi.loader.aqhi_stations', 'aqhi_stations'),
('msc_pygeoapi.loader.swob_stations', 'swob_stations'),
('msc_pygeoapi.loader.ltce', 'ltce'),
('msc_pygeoapi.loader.climate_archive', 'climate_archive'),
('msc_pygeoapi.loader.metnotes', 'metnotes'),
Expand Down
5 changes: 3 additions & 2 deletions msc_pygeoapi/loader/bulletins_realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
LOGGER = logging.getLogger(__name__)

# cleanup settings
DAYS_TO_KEEP = 140
DAYS_TO_KEEP = 30

# index settings
INDEX_BASENAME = 'bulletins.'
Expand Down Expand Up @@ -122,7 +122,8 @@ def __init__(self, filepath, conn_config={}):

BaseLoader.__init__(self)

self.DD_URL = 'https://dd.weather.gc.ca/bulletins/alphanumeric'
today_date = datetime.today().strftime('%Y%m%d')
self.DD_URL = f'https://dd.weather.gc.ca/{today_date}/WXO-DD/bulletins/alphanumeric' # noqa
self.conn = ElasticsearchConnector(conn_config)
self.conn.create_template(INDEX_BASENAME, SETTINGS)

Expand Down
20 changes: 19 additions & 1 deletion msc_pygeoapi/loader/hydat.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ def create_index(self, index):
"type": "text",
"fields": {"raw": {"type": "keyword"}},
},
"REAL_TIME": {"type": "byte"},
"RHBN": {"type": "byte"},
"DRAINAGE_AREA_GROSS": {"type": "float"},
"DRAINAGE_AREA_EFFECT": {"type": "float"},
}
},
"geometry": {"type": "geo_shape"},
Expand Down Expand Up @@ -682,6 +686,16 @@ def generate_stations(self, station_table, annual_peaks_table,
float(station_metadata[station_keys.index('LONGITUDE')]),
float(station_metadata[station_keys.index('LATITUDE')]),
]
station_rhbn = station_metadata[station_keys.index('RHBN')]
station_real_time = station_metadata[
station_keys.index('REAL_TIME')
]
station_drainage_area_gross = station_metadata[
station_keys.index('DRAINAGE_AREA_GROSS')
]
station_draininage_area_effect = station_metadata[
station_keys.index('DRAINAGE_AREA_EFFECT')
]
agency_id = station_metadata[station_keys.index('CONTRIBUTOR_ID')]
datum_id = station_metadata[station_keys.index('DATUM_ID')]
if agency_id is not None:
Expand Down Expand Up @@ -745,7 +759,11 @@ def generate_stations(self, station_table, annual_peaks_table,
'STATUS_FR': status_fr,
'CONTRIBUTOR_EN': agency_en,
'CONTRIBUTOR_FR': agency_fr,
'VERTICAL_DATUM': datum_en
'VERTICAL_DATUM': datum_en,
'REAL_TIME': station_real_time,
'RHBN': station_rhbn,
'DRAINAGE_AREA_GROSS': station_drainage_area_gross,
'DRAINAGE_AREA_EFFECT': station_draininage_area_effect,
},
'links': [
{
Expand Down
3 changes: 2 additions & 1 deletion msc_pygeoapi/loader/hydrometric_realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
LOGGER = logging.getLogger(__name__)

STATIONS_LIST_NAME = 'hydrometric_StationList.csv'
STATIONS_LIST_URL = f'https://dd.weather.gc.ca/hydrometric/doc/{STATIONS_LIST_NAME}' # noqa
TODAY_DATE = datetime.today().strftime('%Y%m%d')
STATIONS_LIST_URL = f'https://dd.weather.gc.ca/{TODAY_DATE}/WXO-DD/hydrometric/doc/{STATIONS_LIST_NAME}' # noqa

STATIONS_CACHE = os.path.join(MSC_PYGEOAPI_CACHEDIR, STATIONS_LIST_NAME)

Expand Down
Loading