--- license: apache-2.0 tags: - climate - weather - predictive models --- # Dataset Card for NC Weather Analysis Dataset This dataset card provides a detailed overview of a weather dataset focused on North Carolina, sourced from OpenWeatherMap.org. The dataset compiles various measurements intended for climate research, weather forecasting, and predictive model development. ## Dataset Details ### Dataset Description This dataset encompasses a comprehensive collection of weather data for North Carolina, including temperature, humidity, atmospheric pressure, wind speed, and precipitation. All data comes in hourly. The data has been meticulously gathered from global and local weather models, satellites, radars, and an extensive network of weather stations. - **Curated by:** [Katherine Tian] - **Shared by:** [OpenWeatherMap.org] - **Language(s) (NLP):** N/A (Non-linguistic data) - **License:** Apache-2.0 - **Period of data collection:** March 2023 to March 2024 ### Dataset Sources - **Repository:** https://openweathermap.org/ ## Uses ### Direct Use This dataset is designed to support climate research, weather forecasting, and the development of predictive models for environmental studies, urban planning, and emergency preparedness. ### Out-of-Scope Use Usage beyond academic research, weather prediction, and climate modeling—such as for commercial forecasting without proper attribution or for misinformation purposes—is considered out of scope. ## Dataset Structure This dataset provides comprehensive weather information collected from OpenWeatherMap, structured into a tabular format. Each row in the dataset represents weather data for a specific hour, including various atmospheric measurements and conditions. Below is a description of the dataset fields: - **dt:** Unix timestamp indicating the time of the weather data. - **main.temp:** The temperature at the specified hour, measured in Kelvin. - **main.feels_like:** The human-perceived temperature, taking humidity and wind into account, measured in Kelvin. - **main.pressure:** Atmospheric pressure at sea level, measured in hPa (hectopascal). - **main.humidity:** Humidity percentage at the specified hour. - **main.temp_min:** Minimum temperature within the last hour, measured in Kelvin. - **main.temp_max:** Maximum temperature within the last hour, measured in Kelvin. - **wind.speed:** Wind speed at the specified hour, measured in m/s (meters per second). - **wind.deg:** Wind direction in degrees (meteorological). - **wind.gust:** Wind gust speed at the specified hour, measured in m/s. - **clouds.all:** Cloudiness percentage at the specified hour. - **latitude and longitude:** Geographic coordinates of the location where the weather data was collected. - **date:** Date (YYYY-MM-DD) corresponding to the weather data. - **rain.1h (nullable):** Rain volume for the last hour, measured in mm (millimeters). This field is nullable to account for periods without rainfall. - **weather_id:** Weather condition ID, corresponding to OpenWeatherMap's weather condition codes. - **weather_main:** General weather condition category (e.g., Rain, Clear, Clouds). - **weather_description:** More detailed description of the weather condition. - **weather_icon:** Icon code representing the weather condition visually. - **city:** The name of the city for which the weather data is provided. - **snow.1h (nullable):** Snow volume for the last hour, measured in mm. Similar to rain.1h, this field is nullable. - **rain.3h (nullable):** Rain volume for the last three hours, provided for datasets with a wider temporal aggregation. ## Dataset Creation ### Curation Rationale The dataset was created to offer an accessible, comprehensive source of weather data for North Carolina, facilitating a wide range of scientific research and practical applications in climate studies and weather forecasting. It contains both data over a large time scale and for different locations. As many agencies, such as NOAA, do not grant access to large amounts of weather data at one time, this dataset can bring convenience to obtain hourly weather data. ### Source Data Data was collected from OpenWeatherMap.org, leveraging their access to global and local weather models, satellite data, radars, and a vast network of weather stations. #### Data Collection and Processing The `WeatherDataFetcher` class is designed to programmatically collect and process historical weather data for ten major NC cities over a defined date range. The data is sourced from the OpenWeatherMap API, which aggregates weather data from various global and local models, satellites, radars, and weather stations. #### Data Collection - **Source:** The data is fetched from OpenWeatherMap's Historical Weather Data API. - **City Selection:** Ten major cities in NC are selected. Users can specify one or more city names to collect weather data for. - **Date Range:** 2023/03/19 - 2024/03/16. Users can define a start and end date for the period over which they wish to collect weather data. The data can span multiple days, and the script fetches hourly weather data for each day in the specified range. - **Latitude and Longitude:** For each city, the script first retrieves the geographic coordinates (latitude and longitude). These coordinates are then used to request historical weather data. #### Data Processing - **Normalization:** The fetched data is in JSON format, with nested structures for different weather parameters. The script uses `pd.json_normalize` to flatten these structures into a tabular format suitable for analysis. - **Weather Column Expansion:** The nested 'weather' column, which contains detailed weather conditions (like weather ID, main weather condition, description, and icon), is expanded into separate columns for each attribute. This makes the dataset more accessible for analysis and visualization. ### Tools and Libraries Used - **Requests:** For making HTTP requests to the OpenWeatherMap API. - **Pandas:** For data manipulation and normalization. - **Datetime:** For handling dates and timestamps. ### Annotations The dataset contains columns which are not part of the initial data collection for clarity. - **Latitude and Longitude Columns:** Each row in the resultant DataFrame is appended with latitude and longitude information, tying the weather data back to its geographic location. - **Date Column:** A date column is added to each row, indicating the date for which the weather data was recorded. This facilitates time-series analysis and visualization. - **City Name Column:** For datasets involving multiple cities, a 'city' column is added to differentiate the weather data by location. #### Annotators The annotations are created by Katherine Tian, the curator of this dataset. #### Personal and Sensitive Information The data scripts contain private API keys. ## Bias, Risks, and Limitations - **API Rate Limits:** The OpenWeatherMap API has rate limits, which could restrict the volume of data that can be fetched in a given time frame. - **Historical Data Availability:** The availability of historical data might vary based on the geographic location and the specific date range requested. ### Recommendations Researchers and users are encouraged to use this dataset alongside other data sources to mitigate potential biases and limitations. OpenWeatherMap's stations do not guarantee completely accurate data. Careful consideration should be given to the dataset's scope and accuracy when drawing conclusions or making predictions.