How to use the meteomatics.api.query_available_time_ranges 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
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))

        print("\nget available time ranges:")
        try:
            df_time_ranges = api.query_available_time_ranges(['t_2m:C', 'precip_6h:mm'], username, password,
                                                             'ukmo-euro4')
            print(df_time_ranges.head())
        except Exception as e:
            print("Failed, the exception is {}".format(e))

    else:
        print("""
Your account '{}' does not include model selection.
With the corresponding upgrade you could query data from stations and request your data in netcdf or grads format.
Please check http://shop.meteomatics.com or contact us at shop@meteomatics.com for an individual offer. 
""".format(username)
              )