Weather API: Difference between revisions
No edit summary |
No edit summary |
||
| Line 43: | Line 43: | ||
}, | }, | ||
"average": { | "average": { | ||
"avgHum": | "avgHum": <average_humidity>, | ||
"avgWind": | "avgWind": <average_wind_speed>, | ||
"avgTemp": | "avgTemp": <average_temperature>, | ||
"monitoringStart": "<monitoring_start_date>" | "monitoringStart": "<monitoring_start_date>" | ||
} | } | ||
| Line 136: | Line 136: | ||
}, | }, | ||
"average": { | "average": { | ||
"avgHum": | "avgHum": 26.43, | ||
"avgWind": | "avgWind": 6.81, | ||
"avgTemp": | "avgTemp": 19.21, | ||
"monitoringStart": "2023-01-03 22:41:01" | "monitoringStart": "2023-01-03 22:41:01" | ||
} | } | ||
Revision as of 14:29, 15 November 2024
Deep Sky Chile Weather API User Manual
The Deep Sky Chile Weather API provides real-time weather and astronomical data, including cloud cover, temperature, wind speed, rain, light levels, and key astronomical measurements.
Base URL
The base URL for accessing the API is: http://api.deepskychile.com/weather
Endpoint
- GET /weather: Retrieves the current weather and astronomical data, including cloud, rain, light states, and important astronomical metrics.
Response Format
The API returns the data in JSON format with the following structure: {
"weather": {
"cloudwatcher": {
"clouds": <clouds_value>,
"temp": <temperature_value>,
"wind": <wind_speed>,
"gust": <wind_gust>,
"rain": <rain_value>,
"light": <light_level>,
"switch": <switch_state>,
"safe": <safe_state>,
"hum": <humidity>,
"dewp": <dew_point>,
"cloudsState": "<clouds_state>",
"rainState": "<rain_state>",
"lightState": "<light_state>"
},
"ninox": {
"UTC": "<utc_time>",
"NSBNow": <current_NSB_value>,
"SunAltitude": <sun_altitude>,
"MoonAltitude": <moon_altitude>,
"MoonPhase": <moon_phase>,
"ZenithGalacticLatitude": <galactic_latitude>,
"NightBestNSB": <best_NSB_value>,
"NightBestNSBTime": "<night_best_NSB_time>",
"NightBestNSBZGL": <night_best_ZGL>,
"OverallBestNSB": <overall_best_NSB_value>,
"OverallBestNSBTime": "<overall_best_NSB_time>",
"OverallBestNSBZGL": <overall_best_ZGL>
},
"average": {
"avgHum": <average_humidity>,
"avgWind": <average_wind_speed>,
"avgTemp": <average_temperature>,
"monitoringStart": "<monitoring_start_date>"
}
}
}
Fields
weather The main object containing weather data from three sources: cloudwatcher, ninox, and average.
cloudwatcher (General Weather Data)
- clouds (float): The current sky temperature in degrees Celsius.
- temp (float): The current temperature in degrees Celsius.
- wind (float): The current wind speed in kilometer per hour (km/h).
- gust (float): The current wind gust speed in kilometer per hour (km/h).
- rain (float): The amount of rain, no unit.
- light (float): The ambient light level, no unit.
- switch (integer): Lock switch status value. Possible values:
* 1: Observatories are unlocked. * 0: Observatories are locked.
- safe (integer): Safety status value. Possible values:
* 1: Safe. * 0: Unsafe.
- hum (float): The relative humidity in percentage.
- dewp (float): The dew point temperature in degrees Celsius.
- cloudsState (string): Determined based on the clouds value. Possible values:
* "Clear": Cloud coverage is low. * "Cloudy": Moderate cloud cover. * "Overcast": High cloud cover or fully covered skies.
- rainState (string): Determined based on the rain value. Possible values:
* "Dry": No significant rain detected (rain value greater than 2000). * "Wet": Light rain (rain value between 1700 and 2000). * "Raining": Moderate to heavy rain (rain value less than 1700).
- lightState (string): Determined based on the light value. Possible values:
* "Dark": Light intensity above 8000. * "Bright": Light intensity between 6 and 8000. * "Sunny": Light intensity below 6.
ninox (Astronomical Data)
- UTC (string): The current UTC time, formatted as yy-mm-dd hh:mm:ss.
- NSBNow (float): The current NSB (Sky Brightness) value. It represents the visibility of the night sky. Lower values indicate better observing conditions.
- SunAltitude (float): The altitude of the Sun in degrees. Negative values indicate the Sun is below the horizon.
- MoonAltitude (float): The altitude of the Moon in degrees. Negative values indicate the Moon is below the horizon.
- MoonPhase (float): The phase of the Moon, measured as a percentage (0-100%).
- ZenithGalacticLatitude (float): The galactic latitude at the zenith, used to describe the position relative to the galactic plane.
- NightBestNSB (float): The best NSB value for the night.
- NightBestNSBTime (string): The timestamp of when the best NSB conditions occur during the night.
- NightBestNSBZGL (float): The Zenith Galactic Latitude associated with the best NSB value.
- OverallBestNSB (float): The overall best NSB value over a longer period, representing the best observing conditions overall.
- OverallBestNSBTime (string): The timestamp of when the overall best NSB conditions occur.
- OverallBestNSBZGL (float): The Zenith Galactic Latitude associated with the overall best NSB value.
average (Averaged Historical Data)
- avgHum (float): The average relative humidity in percentage since monitoring began.
- avgWind (float): The average wind speed in kilometer per hour (km/h) since monitoring began.
- avgTemp (float): The average temperature in degrees Celsius since monitoring began.
- monitoringStart (string): The timestamp marking the start of monitoring, formatted as yyyy-mm-dd hh:mm:ss.
Example Response
{
"weather": {
"cloudwatcher": {
"clouds": -17.18,
"temp": 36.33,
"wind": 3,
"gust": 5,
"rain": 5094,
"light": 2,
"switch": 1,
"safe": 1,
"hum": 14,
"dewp": 4.6,
"cloudsState": "Clear",
"rainState": "Dry",
"lightState": "Sunny"
},
"ninox": {
"UTC": "24-11-15 09:05:52",
"NSBNow": 15.96,
"SunAltitude": -8,
"MoonAltitude": 0.3,
"MoonPhase": 99.5,
"ZenithGalacticLatitude": -0.9,
"NightBestNSB": 19.43,
"NightBestNSBTime": "24-11-15 08:28:44",
"NightBestNSBZGL": -7,
"OverallBestNSB": 24.1,
"OverallBestNSBTime": "24-05-07 23:17:28",
"OverallBestNSBZGL": 16.2
},
"average": {
"avgHum": 26.43,
"avgWind": 6.81,
"avgTemp": 19.21,
"monitoringStart": "2023-01-03 22:41:01"
}
}
}
Error Handling
If an error occurs while fetching the data, the API will return a generic HTTP error response (e.g., 500 Internal Server Error).
Example Request
To retrieve the current weather and astronomical data, make a simple GET request to the following endpoint: GET http://api.deepskychile.com/weather
Authentication
Currently, the API does not require authentication. Any future authentication requirements will be detailed here.
Conclusion
This API provides both weather and astronomical data to help with sky observations and general weather monitoring at Deep Sky Chile. It allows users to track cloud coverage, temperature, rain, light levels, and other important factors for stargazing, as well as obtain detailed astronomical conditions such as NSB, Sun and Moon altitudes, and phase data.
If you need further assistance or have additional questions about using the API, feel free to reach out.