Giter VIP home page Giter VIP logo

Comments (4)

clampr avatar clampr commented on June 13, 2024

Hi,

What's your value for lat, lon and radius? It might well be that the weather stations in this area don't provide wpgt data.

from meteostat-python.

saltymaverick avatar saltymaverick commented on June 13, 2024
 from meteostat import Stations, Daily, Point
 def get_latitude_longitude(address):
     geolocator = Nominatim(user_agent="geoapiExercises")
     try:
        location = geolocator.geocode(address)
        if location:
            return location.latitude, location.longitude
        else:
            return None, None
    except GeocoderTimedOut:
        return get_latitude_longitude(address)

if __name__ == "__main__":
    address = input("Enter the address: ")
    latitude, longitude = get_latitude_longitude(address)
    if latitude and longitude:
        print(f"Latitude: {latitude}, Longitude: {longitude}")
    else:
        print("Location not found.")

lat = latitude
lon = longitude
radius = 100000  # meters
num_stations = 5
start = datetime(2022, 9, 11)
end = datetime(2022, 11, 9)

for index, station in stations.iterrows():
    station_id = station['icao'] 
    station_name = station['name']
    station_lat = station['latitude']
    station_lon = station['longitude']
    station_ele = station.elevation

point = Point(station_lat, station_lon, station_ele)
data = Daily(point, start, end)
data = data.fetch()

for index, row in data.iterrows():
    station_info = {
        "station": [station_id],
        "staion name": [station_name],
        "time": [index.strftime("%Y-%m-%d")],
        "tavg": [(row.tavg * 9/5 + 32)],
        "tmin": [(row.tmin * 9/5 + 32)],
        "tmax": [(row.tmax* 9/5 + 32)],
        "prcp": [row.prcp * 0.0393701],
        "wdir": [row.wdir],
        "wspd": [row.wspd * 0.621371192],
        "wpgt": [row.wpgt * 0.621371192],
        "pres": [round(row.pres* 0.0145037738)],
        "distance": [haversine(lat, lon, station_lat, station_lon)]
    }

from meteostat-python.

clampr avatar clampr commented on June 13, 2024

Can you share the result of print(f"Latitude: {latitude}, Longitude: {longitude}") or the address?

from meteostat-python.

saltymaverick avatar saltymaverick commented on June 13, 2024

-lat/lon of structure;
structure_lat = 27.929571
structure_lon = -82.747118

-for the date range, September 9, 2022 thru September 27, 2022;
start = datetime(2022, 9, 27)
end = datetime(2022, 9, 29)

-This brings up weather stations;
KCLW, KPIE, KTPA, KSPG, KMCF

However, it is not localized to only this lat/lon, all wpgt value for any station for any date range does not return values. When I use the UI on meteostat, the results also do not return wind gust as a visible output. Do you experience the same?

from meteostat-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.