davidson16807 / tectonics.js

3d plate tectonics in your web browser
http://davidson16807.github.io/tectonics.js/
Creative Commons Attribution 4.0 International
204 stars 28 forks source link

Log or console record of univariate stats #14

Closed astrographer closed 6 years ago

astrographer commented 6 years ago

I've been having trouble reconnecting the temperature model to altitude. I'm thinking this might be due to some problems with the values coming out of the altitude model itself. To test this, if it's not possible to export higher-order rasters(16-bit integer with at least min and max recorded, or optimally 32-bit floats…😌), it would be a real boon to have access to minimum, maximum, mean, median, possibly mode, and standard deviation to somewhere accessible(console output, a log record, an exported text file, or just as temporary text labels on the screen). This could perhaps be toggled at startup with a "univar" flag in the url…

I'm thinking of this mainly for altitude, but I'm sure it would be useful for precipitation, temperature, biomass or any other quantitative values(again, toggled perhaps by "alt.univar," "prec.univar," etc.

My preference would simply be an onscreen button menu to export a text file with the univariate stats for the selected parameter, but I'm flexible and overjoyed if you just decide to add this.

Thank you, Colin

davidson16807 commented 6 years ago

If you know the name of the raster, you can do this in the developer console right now:

 Float32Dataset.average(world.displacement) - world.SEALEVEL

Most browser consoles have some sort of autocomplete, so you can see a full list of functions provided by the Float32Dataset namespace, not to mention a full list of rasters provided by world.

For a while now I've wanted to implement better ways to view data in a nonspatial way: histograms, time series charts, min/max/average statistics, etc. Never got to it because there was no demand and I had other ways to do it, so I'll prioritize this.

davidson16807 commented 6 years ago

I've implemented a chart display with statistics on an experimental branch. I didn't implement mode because it wound up not making a lot of sense for floating point numbers. I'm hoping to move this to prod later this evening.

screen shot 2017-12-13 at 9 33 21 am

You mention having an "export" functionality. What sort of export do you have in mind? I'm picturing a csv with columns for lat, long, the currently displayed field, and any other major attributes that are relevant to the user, namely elevation, temperature, precip, and npp. There are other things we could include and it wouldn't be hard to add them, but I'm not sure how useful they'll be to the user - things like plate id, crust age, density, thickness, sima/sial fraction, etc.

There can be a single button for export functionality. We can leverage this for other export functionality - the 3d object export ( issue #4, which I still have yet to get to :\ ) comes to mind. I also think it'd be really cool to export to video game world files, but unless I get help this is really far future stuff (elder scrolls .esp files, KSP mods, minecraft save games, dwarf fortress worlds, etc.)

davidson16807 commented 6 years ago

Charts now out in prod. Should be visible on any non-satellite based display

astrographer commented 6 years ago

Generally looking pretty darn good. I'm assuming horizontal axis is value and vertical axis is count. As to export… your csv sounds good. What I would love to see would be a full float(32-bit) export to Virtual Terrains .bt, .hf2/hfz, or geotiff. That might not be well-received by the wider audience, but for gis dweebs like me, it would be a godsend! PlateID would definitely be useful.

Game files might be of pretty limited value, except for things like KSP or flight simulator-type apps. The scale is just too small, I think.

Now that I'm seeing the raw elevation values, I understand why the altitude-based aspect of temperature generation is failing so badly. But that's a whole other issue…

astrographer commented 6 years ago

It also might be nice to have the option to limit stats and charting to land areas. Perhaps when the ocean is displayed, stats and charts are created based on land area; when the ocean is hidden, stats and charts cover the full surface.

davidson16807 commented 6 years ago

I'm going to refocus priority on this issue now that #18 is in test. I figure this one is so close to done anyways.

Remaining work to close out the story:

A separate issue will be created for geospatial export formats, #26.

davidson16807 commented 6 years ago

I've implemented a rudimentary csv export and filter based on ocean visibility. Columns for precip, temp, npp etc should be added to the csv after work on #9. Issue #9 will be my next focus.

Going to call it done, if there's no objections