https://github.com/cjabradshaw/anemometer

A handy function to create a simple anemometer plot for anywhere in the world

https://github.com/cjabradshaw/anemometer

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: scholar.google
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

anemometer ansiweather atmospheric-pressure elevation humidity pressure temperature weather wind wind-app wind-compass wind-speed
Last synced: 5 months ago · JSON representation

Repository

A handy function to create a simple anemometer plot for anywhere in the world

Basic Info
  • Host: GitHub
  • Owner: cjabradshaw
  • License: mit
  • Language: R
  • Default Branch: main
  • Homepage:
  • Size: 766 KB
Statistics
  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
anemometer ansiweather atmospheric-pressure elevation humidity pressure temperature weather wind wind-app wind-compass wind-speed
Created almost 4 years ago · Last pushed almost 4 years ago
Metadata Files
Readme License

README.md

Anemometer function in R

Anemometer

A handy function to create a simple anemometer plot for anywhere in the world in R.

Installation & Set-up

  1. Install ansiweather in the command line (Terminal) via any one of following: OpenBSD, NetBSD, FreeBSD, Debian, Ubuntu, or Homebrew. I use Homebrew on my Mac via: $ brew install ansiweather

ansiweather fetches weather data from OpenWeatherMap's free API

Access ansiweather's manual for more information

  1. Install the following libraries in R:
  2. jsonlite
  3. processx
  4. lutz
  5. lubridate
  6. caroline
  7. rlang
  8. rgbif

You can do this easily with the following command:

install.packages(c("jsonlite", "processx", "lutz", "lubridate", "caroline", "rlang", "rgbif"))

  1. Pre-load the city file, which is the location JSON (Javascript Object Notation) database ansiweather uses to identify place names. You could add this to the function itself, but it slows processing down considerably, so it's best to load before running the function.

cityfile <- jsonlite::fromJSON(gzcon(url("https://bulk.openweathermap.org/sample/city.list.json.gz")))

The 2-digit ISO country code can be found here, and you can access various versions and scales of the source JSON database here.

  1. Should you wish the elevation (metres above sea level; 'm asl') of the location to be displayed on the plot, you will need to register for a free user name on the GeoNames geographical database. Once you approve your account, ensure that you enable free webservices on your 'manage account' page.

  2. Run both the functions plotCompass and AnemometerFunction in R (the former is invoked by the latter; both scripts are included together in AnemometerFunction.R), then you're ready to plot a real-time anemometer (including windspeed, wind direction temperature, humidity, air pressure, latitude, longitude, date, time, and elevation (optional) as in the example plot above).

Note: if you registered at GeoNames, you need to include your user name using the option GEONAMESUSERNAME="myuser_name"; if you do not provide a user name, the elevation will return 'no elev data' in the plot.

Some examples:

  • AnemometerFunc(Place="Adelaide,AU", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Darlington,AU", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Hobart,AU", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Perth,AU", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Port Moresby,PG", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Dunedin,NZ", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Wellington,NZ", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Sapporo,JP", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Helsinki,FI", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Paris,FR", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Kyiv,UA", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Reykjavik,IS", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Vancouver,CA", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Whitehorse,CA", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Sachs Harbour,CA", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Rimouski,CA", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Ushuaia,AR", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Punta Arenas,CL", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Agadez,NE", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Dar es Salaam,TZ", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Phalaborwa,ZA", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Kolkata,IN", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")
  • AnemometerFunc(Place="Bengaluru,IN", PlaceFile=cityfile, GEONAMESUSERNAME="myuser_name")

Thylacoleo

Note that the arrow's line width varies as a function of windspeed (thicker with higher speeds), that the colour of the temperature text (T) on the plot varies from blue to red (cold to hot), that the humidity (H) display varies from yellow to dark blue (dry to wet), and that the pressure (P) ranges from dark red, red, pink, to orange (very low, low, moderate, high).


Prof Corey J. A. Bradshaw
Global Ecology, Flinders University, Adelaide, Australia
March 2022
e-mail

Owner

  • Name: Corey Bradshaw
  • Login: cjabradshaw
  • Kind: user
  • Location: Adelaide, South Australia
  • Company: Flinders University

Matthew Flinders Professor of Global Ecology @GlobalEcologyFlinders @CABAH

GitHub Events

Total
Last Year

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 75
  • Total Committers: 1
  • Avg Commits per committer: 75.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Corey Bradshaw c****w@g****m 75

Issues and Pull Requests

Last synced: about 2 years ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels