cambecc / earth

a project to visualize global weather conditions
http://earth.nullschool.net
MIT License
5.99k stars 1.17k forks source link

Is there a paid version? I want a source code #120

Open aoqizhonghua opened 3 years ago

aoqizhonghua commented 3 years ago

Is there a paid version? I want a source code

mschreib28 commented 3 years ago

You mean like on the repository you're commenting on?

https://github.com/cambecc/earth/tree/master/public/libs/earth/1.0.0

aoqizhonghua commented 3 years ago

yes

mschreib28 commented 3 years ago

That's the javascript source code. The other libraries in libs are utilized in order to do various functional things within earth.

aoqizhonghua commented 3 years ago

I want to know how to realize the function of HTSGW ( Significant Wave Height ), but I don't know much about it

karelvancamp commented 2 years ago

Look at the actual site, browser code inspector. Grep for HTSGW. You'll find createHTSGWPalette in HTSGW.js based on generic buildScaleFromSegments.

import {buildScaleFromSegments} from "./palette.js";
export function createHTSGWPalette(resolution = 1000) {
    const bounds = [0, 15];  // units: m
    const segments = [
        [ 0, [  8,  29,  88]],
        [ 1, [ 37,  52, 148]],
        [ 2, [ 34,  94, 168]],
        [ 3, [ 29, 145, 192]],
        [ 4, [ 65, 182, 196]],
        [ 5, [127, 205, 187]],
        [ 6, [199, 233, 180]],
        [ 7, [237, 248, 177]],
        [ 8, [254, 204,  92]],
        [10, [253, 141,  60]],
        [12, [240,  59,  32]],
        [14, [189,   0,  38]],
    ];
    return buildScaleFromSegments(bounds, segments, resolution);

}