Weather API: Difference between revisions

From Deep Sky Chile
No edit summary
No edit summary
Line 46: Line 46:
         "seeing": {
         "seeing": {
             "UTC": "<seeing_utc_time>",
             "UTC": "<seeing_utc_time>",
             "SeeingValue": <seeing_value>
             "SeeingValue": <seeing_value>,
            "avgSeeing": <average_seeing>,
            "monitoringSeeingStart": "<seeing_monitoring_start>"
         },
         },
         "average": {
         "average": {
Line 91: Line 93:


'''ninox (Astronomical Data)'''
'''ninox (Astronomical Data)'''
* '''UTC''' (string): Current UTC time, format: yy-mm-dd hh:mm:ss.   
* '''UTC''' (string): Current UTC time, format: yyyy-mm-dd hh:mm:ss.   
* '''NSBNow''' (float): Current sky brightness (NSB) value. Lower values indicate better observing conditions.   
* '''NSBNow''' (float): Current sky brightness (NSB) value. Lower values indicate better observing conditions.   
* '''SunAltitude''' (float): Altitude of the Sun in degrees.   
* '''SunAltitude''' (float): Altitude of the Sun in degrees.   
Line 105: Line 107:


'''seeing (Atmospheric Seeing Conditions)'''
'''seeing (Atmospheric Seeing Conditions)'''
* '''UTC''' (string): UTC time of the seeing measurement.   
* '''UTC''' (string): UTC time of the current seeing measurement.   
* '''SeeingValue''' (float): Seeing value in arcseconds. Lower values indicate better seeing (e.g., 1.0 is excellent, 2.5 is poor).
* '''SeeingValue''' (float): Current seeing value in arcseconds. Lower values indicate better seeing (e.g., 1.0 is excellent, 2.5 is poor). 
* '''avgSeeing''' (float): Average seeing value since monitoring began. 
* '''monitoringSeeingStart''' (string): Start timestamp for seeing monitoring (yyyy-mm-dd hh:mm:ss).


'''average (Averaged Historical Data)'''
'''average (Averaged Historical Data)'''
Line 119: Line 123:
     "weather": {
     "weather": {
         "cloudwatcher": {
         "cloudwatcher": {
             "clouds": -16.13,
             "clouds": -12.35,
             "temp": 17.38,
             "temp": 34.09,
             "wind": 4,
             "wind": 3,
             "gust": 5,
             "gust": 3,
             "rain": 5248,
             "rain": 5120,
             "light": 57232,
             "light": 2,
             "switch": 1,
             "switch": 1,
             "safe": 1,
             "safe": 1,
             "hum": 5,
             "hum": 7,
             "dewp": -22.72,
             "dewp": -6.56,
             "cloudsState": "Clear",
             "cloudsState": "Clear",
             "rainState": "Dry",
             "rainState": "Dry",
             "lightState": "Dark"
             "lightState": "Sunny"
         },
         },
         "ninox": {
         "ninox": {
             "UTC": "2025-05-10 07:04:09",
             "UTC": "2025-05-22 10:51:59",
             "NSBNow": 19.45,
             "NSBNow": 16.18,
             "SunAltitude": -55.2,
             "SunAltitude": -8.3,
             "MoonAltitude": 29,
             "MoonAltitude": 51.5,
             "MoonPhase": 94.8,
             "MoonPhase": 28.9,
             "ZenithGalacticLatitude": 1.9,
             "ZenithGalacticLatitude": -53.7,
             "NightBestNSB": 19.46,
             "NightBestNSB": 21.56,
             "NightBestNSBTime": "2025-05-10 07:02:02",
             "NightBestNSBTime": "2025-05-22 01:39:25",
             "NightBestNSBZGL": 1.9,
             "NightBestNSBZGL": 32.4,
             "OverallBestNSB": 21.15,
             "OverallBestNSB": 21.96,
             "OverallBestNSBTime": "2025-05-08 09:00:13",
             "OverallBestNSBTime": "2025-05-17 23:30:55",
             "OverallBestNSBZGL": -19.2
             "OverallBestNSBZGL": 23.2
         },
         },
         "seeing": {
         "seeing": {
             "UTC": "2025-05-10 03:16:14",
             "UTC": "2025-05-22 11:03:25",
             "SeeingValue": 1.48
             "SeeingValue": 1.37,
            "avgSeeing": 0.85,
            "monitoringSeeingStart": "2025-05-21 14:04:05"
         },
         },
         "average": {
         "average": {
             "avgHum": 26.94,
             "avgHum": 23.36,
             "avgWind": 6.8,
             "avgWind": 3.13,
             "avgTemp": 19.16,
             "avgTemp": 16.52,
             "monitoringStart": "2023-05-10 09:11:02"
             "monitoringStart": "2023-05-22 15:41:02"
         }
         }
     }
     }
Line 169: Line 175:


=== Authentication ===   
=== Authentication ===   
Currently, the API does not require authentication. Any future requirements will be documented here.
Currently, the API does not require authentication. Any future r
 
=== Conclusion === 
This API provides detailed weather, seeing, and astronomical data to support stargazing, observatory operations, and long-term monitoring at Deep Sky Chile.
 
[[Category:User manuals]]

Revision as of 15:44, 22 May 2025

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, seeing conditions, 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, seeing, and important astronomical metrics.

Response Format

The API returns 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>
        },
        "seeing": {
            "UTC": "<seeing_utc_time>",
            "SeeingValue": <seeing_value>,
            "avgSeeing": <average_seeing>,
            "monitoringSeeingStart": "<seeing_monitoring_start>"
        },
        "average": {
            "avgHum": <average_humidity>,
            "avgWind": <average_wind_speed>,
            "avgTemp": <average_temperature>,
            "monitoringStart": "<monitoring_start_date>"
        }
    }
}

Fields

weather The main object containing weather data from four sources: cloudwatcher, ninox, seeing, and average.

cloudwatcher (General Weather Data)

  • clouds (float): Current sky temperature in degrees Celsius.
  • temp (float): Current temperature in degrees Celsius.
  • wind (float): Wind speed in km/h.
  • gust (float): Wind gust speed in km/h.
  • rain (float): Rain value (unitless).
  • light (float): Ambient light level (unitless).
  • switch (integer): Lock switch status:
 * 1: Observatories are unlocked.  
 * 0: Observatories are locked.  
  • safe (integer): Safety status:
 * 1: Safe.  
 * 0: Unsafe.  
  • hum (float): Relative humidity (%).
  • dewp (float): Dew point temperature in degrees Celsius.
  • cloudsState (string):
 * "Clear": Low cloud cover.  
 * "Cloudy": Moderate cloud cover.  
 * "Overcast": High cloud cover or fully covered skies.  
  • rainState (string):
 * "Dry": Rain > 2000.  
 * "Wet": Rain between 1700 and 2000.  
 * "Raining": Rain < 1700.  
  • lightState (string):
 * "Dark": Light > 8000.  
 * "Bright": Light between 6 and 8000.  
 * "Sunny": Light <= 6.  

ninox (Astronomical Data)

  • UTC (string): Current UTC time, format: yyyy-mm-dd hh:mm:ss.
  • NSBNow (float): Current sky brightness (NSB) value. Lower values indicate better observing conditions.
  • SunAltitude (float): Altitude of the Sun in degrees.
  • MoonAltitude (float): Altitude of the Moon in degrees.
  • MoonPhase (float): Moon phase in percentage (0–100%).
  • ZenithGalacticLatitude (float): Galactic latitude at zenith.
  • NightBestNSB (float): Best NSB value for the current night.
  • NightBestNSBTime (string): Time of best NSB value.
  • NightBestNSBZGL (float): Zenith galactic latitude at best NSB time.
  • OverallBestNSB (float): Best overall NSB recorded.
  • OverallBestNSBTime (string): Time of overall best NSB.
  • OverallBestNSBZGL (float): Galactic latitude at overall best NSB.

seeing (Atmospheric Seeing Conditions)

  • UTC (string): UTC time of the current seeing measurement.
  • SeeingValue (float): Current seeing value in arcseconds. Lower values indicate better seeing (e.g., 1.0 is excellent, 2.5 is poor).
  • avgSeeing (float): Average seeing value since monitoring began.
  • monitoringSeeingStart (string): Start timestamp for seeing monitoring (yyyy-mm-dd hh:mm:ss).

average (Averaged Historical Data)

  • avgHum (float): Average humidity (%) since monitoring began.
  • avgWind (float): Average wind speed (km/h) since monitoring began.
  • avgTemp (float): Average temperature (°C) since monitoring began.
  • monitoringStart (string): Start timestamp for monitoring (yyyy-mm-dd hh:mm:ss).

Example Response

{
    "weather": {
        "cloudwatcher": {
            "clouds": -12.35,
            "temp": 34.09,
            "wind": 3,
            "gust": 3,
            "rain": 5120,
            "light": 2,
            "switch": 1,
            "safe": 1,
            "hum": 7,
            "dewp": -6.56,
            "cloudsState": "Clear",
            "rainState": "Dry",
            "lightState": "Sunny"
        },
        "ninox": {
            "UTC": "2025-05-22 10:51:59",
            "NSBNow": 16.18,
            "SunAltitude": -8.3,
            "MoonAltitude": 51.5,
            "MoonPhase": 28.9,
            "ZenithGalacticLatitude": -53.7,
            "NightBestNSB": 21.56,
            "NightBestNSBTime": "2025-05-22 01:39:25",
            "NightBestNSBZGL": 32.4,
            "OverallBestNSB": 21.96,
            "OverallBestNSBTime": "2025-05-17 23:30:55",
            "OverallBestNSBZGL": 23.2
        },
        "seeing": {
            "UTC": "2025-05-22 11:03:25",
            "SeeingValue": 1.37,
            "avgSeeing": 0.85,
            "monitoringSeeingStart": "2025-05-21 14:04:05"
        },
        "average": {
            "avgHum": 23.36,
            "avgWind": 3.13,
            "avgTemp": 16.52,
            "monitoringStart": "2023-05-22 15:41:02"
        }
    }
}

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: GET http://api.deepskychile.com/weather

Authentication

Currently, the API does not require authentication. Any future r