How to use the meteomatics.api.query_station_timeseries function in meteomatics

To help you get started, we’ve selected a few meteomatics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github meteomatics / python-connector-api / examples / example.py View on Github external
password, model=model_grads_ts, area=area_grads_ts)
            print("prefix = {}".format(prefixpath_grads_ts))
        except Exception as e:
            print("Failed, the exception is {}".format(e))

        print("\nfind stations:")
        try:
            met = api.query_station_list(username, password, startdate=startdate_station_ts, enddate=enddate_station_ts,
                                         parameters=parameters_station_ts)
            print(met.head())
        except Exception as e:
            print("Failed, the exception is {}".format(e))

        print("\nstation coordinates timeseries:")
        try:
            df_sd_coord = api.query_station_timeseries(startdate_station_ts, enddate_station_ts, interval_station_ts,
                                                       parameters_station_ts, username, password,
                                                       model=model_station_ts,
                                                       latlon_tuple_list=coordinates_station_ts,
                                                       on_invalid='fill_with_invalid', request_type="POST",
                                                       temporal_interpolation='none')
            print(df_sd_coord.head())
        except Exception as e:
            print("Failed, the exception is {}".format(e))

        print("\nstation wmo + metar ids timeseries:")
        try:
            df_sd_ids = api.query_station_timeseries(startdate_station_ts, enddate_station_ts, interval_station_ts,
                                                     parameters_station_ts, username, password, model=model_station_ts,
                                                     wmo_ids=wmo_stations, metar_ids=metar_stations,
                                                     mch_ids=mch_stations, on_invalid='fill_with_invalid',
                                                     request_type="POST", temporal_interpolation='none')
github meteomatics / python-connector-api / examples / example.py View on Github external
print("\nstation coordinates timeseries:")
        try:
            df_sd_coord = api.query_station_timeseries(startdate_station_ts, enddate_station_ts, interval_station_ts,
                                                       parameters_station_ts, username, password,
                                                       model=model_station_ts,
                                                       latlon_tuple_list=coordinates_station_ts,
                                                       on_invalid='fill_with_invalid', request_type="POST",
                                                       temporal_interpolation='none')
            print(df_sd_coord.head())
        except Exception as e:
            print("Failed, the exception is {}".format(e))

        print("\nstation wmo + metar ids timeseries:")
        try:
            df_sd_ids = api.query_station_timeseries(startdate_station_ts, enddate_station_ts, interval_station_ts,
                                                     parameters_station_ts, username, password, model=model_station_ts,
                                                     wmo_ids=wmo_stations, metar_ids=metar_stations,
                                                     mch_ids=mch_stations, on_invalid='fill_with_invalid',
                                                     request_type="POST", temporal_interpolation='none')
            print(df_sd_ids.head())
        except Exception as e:
            print("Failed, the exception is {}".format(e))

        print("\nget init dates:")
        try:
            df_init_dates = api.query_init_date(now, now + dt.timedelta(days=2), dt.timedelta(hours=3), 't_2m:C',
                                                username,
                                                password, 'ecmwf-ens')
            print(df_init_dates.head())
        except Exception as e:
            print("Failed, the exception is {}".format(e))