Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WeatherStation

Hierarchy

  • WeatherStation

Index

Constructors

constructor

Properties

Private _id

_id: string

The name of the weather station. The name must be unique amongst a weather station collection.

comments

comments: string = ""

User comments about the weather station (optional).

elevation

elevation: number = 0

The elevation of the weather station (required).

location

location: LatLon

The location of the weather station (required).

streams

streams: WeatherStream[] = new Array<WeatherStream>()

The weather streams from this weather station.

Static Private Readonly PARAM_WEATHERSTATION

PARAM_WEATHERSTATION: "weatherstation" = "weatherstation"

Static Protected counter

counter: number = 0

Accessors

id

  • get id(): string
  • set id(value: string): void
  • Get the name of the weather station.

    throws

    If SocketMsg.inlineThrowOnError is set a RangeError will be thrown if value is not valid.

    Returns string

  • Set the name of the weather station. Must be unique amongst the weather station collection. Cannot be null or empty.

    throws

    If SocketMsg.inlineThrowOnError is set a RangeError will be thrown if value is not valid.

    Parameters

    • value: string

    Returns void

Methods

addWeatherStream

  • addWeatherStream(filename: string, hffmc_value: number, hffmc_hour: number, hffmc_method: HFFMCMethod, starting_ffmc: number, starting_dmc: number, starting_dc: number, starting_precip: number, start_time: string | DateTime, end_time: string | DateTime, comments?: string): WeatherStream
  • Add a weather stream to the station.

    throws

    If SocketMsg.inlineThrowOnError is set and SocketMsg.skipFileTests is not set a RangeError will be thrown if the file doesn't exist.

    Parameters

    • filename: string

      The file location for the streams data. Can either be the actual file path or the attachment URL returned from {@link WISE#addAttachment}

    • hffmc_value: number

      The HFFMC value.

    • hffmc_hour: number

      The hour the HFFMC value was measured. Must be between -1 and 23 inclusive.

    • hffmc_method: HFFMCMethod

      The method to calculate HFFMC.

    • starting_ffmc: number

      The starting FFMC value.

    • starting_dmc: number

      The starting DMC value.

    • starting_dc: number

      The starting DC value.

    • starting_precip: number

      The starting amount of precipitation.

    • start_time: string | DateTime

      The starting time of the weather stream. If a string is used it must be formatted as "YYYY-MM-DD".

    • end_time: string | DateTime

      The ending time of the weather stream. If a string is used it must be formatted as "YYYY-MM-DD".

    • Optional comments: string

      An optional user comment to attach to the weather stream.

    Returns WeatherStream

    WeatherStream

addWeatherStreamWithDiurnalParameters

  • addWeatherStreamWithDiurnalParameters(filename: string, hffmc_value: number, hffmc_hour: number, hffmc_method: HFFMCMethod, starting_ffmc: number, starting_dmc: number, starting_dc: number, starting_precip: number, start_time: string | DateTime, end_time: string | DateTime, talpha: number, tbeta: number, tgamma: number, wsalpha: number, wsbeta: number, wsgamma: number, comments?: string): WeatherStream
  • Add a weather stream to the station with specified diurnal parameters.

    throws

    If SocketMsg.inlineThrowOnError is set and SocketMsg.skipFileTests is not set a RangeError will be thrown if the file doesn't exist.

    Parameters

    • filename: string

      The file location for the streams data. Can either be the actual file path or the attachment URL returned from {@link WISE#addAttachment}

    • hffmc_value: number

      The HFFMC value.

    • hffmc_hour: number

      The hour the HFFMC value was measured. Must be between -1 and 23 inclusive.

    • hffmc_method: HFFMCMethod

      The method to calculate HFFMC.

    • starting_ffmc: number

      The starting FFMC value.

    • starting_dmc: number

      The starting DMC value.

    • starting_dc: number

      The starting DC value.

    • starting_precip: number

      The starting amount of precipitation.

    • start_time: string | DateTime

      The starting time of the weather stream. Must be formatted as "YYYY-MM-DD"

    • end_time: string | DateTime

      The ending time of the weather stream. Must be formatted as "YYYY-MM-DD"

    • talpha: number

      The diurnal alpha temperature parameter.

    • tbeta: number

      The diurnal alpha temperature parameter.

    • tgamma: number

      The diurnal gamma temperature parameter.

    • wsalpha: number

      The diurnal alpha wind speed parameter.

    • wsbeta: number

      The diurnal beta wind speed parameter.

    • wsgamma: number

      The diurnal gamma wind speed parameter.

    • Optional comments: string

      An optional user comment to attach to the weather stream.

    Returns WeatherStream

    WeatherStream

checkValid

  • Look for errors in the weather station.

    Returns Array<ValidationError>

    A list of all errors found in the weather station.

getId

  • getId(): string
  • Returns string

isValid

  • isValid(): boolean
  • Checks to see if all required values are specified.

    Returns boolean

removeWeatherStream

  • Remove a WeatherStream object from the weather grid.

    Parameters

    • weatherStream: WeatherStream

      The WeatherStream object to remove

    Returns boolean

    A boolean indicating if the object was found and removed

setName

  • setName(name: string): void
  • Set the name of the weather station. This name must be unique within the simulation. The name will get a default value when the weather station is constructed but can be overriden with this method.

    Parameters

    • name: string

    Returns void

stream

  • stream(builder: Socket): void
  • Streams the weather station to a socket.

    Parameters

    • builder: Socket

    Returns void