Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

daymet-single-pixel-client

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

daymet-single-pixel-client

Client API to DAYMET's Single Pixel Extraction web service

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

daymet-single-pixel-client

Client API to DAYMET's Single Pixel Extraction Tool web service

https://daymet.ornl.gov/single-pixel-tool-guide

Example usage

var Daymet = require("daymet-single-pixel-client");

// Depending on your environment:
require("es6-promise").polyfill();
require("cross-fetch/polyfill");

// Daymet does not allow cross-origin requests. If your code runs in a
// browser, then you can use this to use a CORS proxy:
// Daymet.Gateway.init({ url: 'https://your-proxy-here.com/single-pixel' });

var options = {
  end: new Date(946904400000), // 2000-01-03
  start: new Date(946731600000), // 2000-01-01
  vars: ["tmin", "tmax", "dayl", "prcp", "swe"]
};
var format = "json";
var lat = 47; // In WGS84 datum.
var lon = -122;

Daymet.Api.getApiData(lat, lon, format, options).then(response => {
  console.log(JSON.stringify(response.data, null, 2));
});

Example output

Output from the demo code above:

{
  "loc": [
    47,
    -122
  ],
  "Elevation": "476 m",
  "citation": "Thornton; P.E.; M.M. Thornton; B.W. Mayer; Y. Wei; R. Devarakonda; R.S. Vose; and R.B. Cook. 2016. Daymet: Daily Surface Weather Data on a 1-km Grid for North America; Version 3. ORNL DAAC; Oak Ridge; Tennessee; USA. http://dx.doi.org/10.3334/ORNLDAAC/1328",
  "LCC": [
    -1580107.11,
    686640.75
  ],
  "Tile": "12269",
  "data": {
    "tmin (deg c)": [
      0,
      -0.5,
      -1.5
    ],
    "prcp (mm/day)": [
      11,
      4,
      11
    ],
    "dayl (s)": [
      30067.19921875,
      30412.80078125,
      30412.80078125
    ],
    "tmax (deg c)": [
      4,
      3,
      3.5
    ],
    "year": [
      2000,
      2000,
      2000
    ],
    "yday": [
      1,
      2,
      3
    ],
    "swe (kg/m^2)": [
      0,
      0,
      0
    ]
  }
}

Keywords

FAQs

Package last updated on 23 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc