SETI / rms-opus

PDS OPUS - Outer Planets Data Search Tool
Apache License 2.0
10 stars 7 forks source link

Implement unit indicators/selectors for numerical input widgets #46

Closed basilleaf closed 4 years ago

basilleaf commented 10 years ago

Originally reported by: lisa ballard (Bitbucket: basilleaf, GitHub: basilleaf)



rfrenchseti commented 6 years ago

Implementation ideas:

rfrenchseti commented 6 years ago

We also need to show the units when displaying metadata, like "observation duration (secs)" or perhaps "observation duration: 45.0 secs".

rfrenchseti commented 5 years ago

The initial implementation of this is just going to consist of:

1) Choosing which units we support in the database 2) Putting the proper units in the tableschemas JSON files for all RANGE entries in all obs* tables 3) Creating a dictionary that converts between the internal database unit abbreviations and the "pretty" versions we want users to see (such as "s" -> "seconds") 3) Modifying api_get_widget() to put the unit type in the widget title 4) Modifying get_metadata() to put the unit type in the metadata name

Later we will allow the user to select the specific units they want to use.

rfrenchseti commented 5 years ago

In the table_schemas JSON files, the "data_source" field tells you where the data comes from, and thus where to look to figure out the proper units.

juzen2003 commented 5 years ago

Modifications:

obs_wavelength.json

obs_type_image.json

obs_general.json

obs_instrument_coiss.json

obs_instrument_couvis.json

obs_instrument_covims.json

obs_instrument_vgiss.json

obs_mission_hubble.json

obs_ring_geometry.json

obs_surface_geometry_target.json

api_get_widget

get_metadata

rfrenchseti commented 5 years ago
rfrenchseti commented 5 years ago

The first version of this has been fixed (displaying the internal units to the user). The second part (allowing the selection of new units) is yet to be done.

rfrenchseti commented 5 years ago

Current to do list:

Here are the units we currently use:

cm^-1 (wave number) cm^-1/pixel (wave number resolution) microns (wavelength) microns/pixel (wavelength resolution)

degrees (RA, dec, various ring/surface geo latitude, longitude, lighting angles)

km (ring radius, ring edge on altitude, ring distance, surface geo distance) km/pixel (ring/surface geo resolution)

seconds (all types of image/exposure duration)

milliseconds (COVIMS IR/VIS pixel/line exposure - should we have made these seconds to begin with?)

For each default unit, we can have a set of other units that can be selected by the user.

I think the immediately obvious ones are:

microns => microns, nm, angstroms

degrees => degrees, radians

km => km, Saturn radii, Jupiter radii, Neptune radii, Uranus radii (m? feet? miles?)

seconds => seconds, milliseconds, maybe microseconds milliseconds => milliseconds, seconds

rfrenchseti commented 5 years ago

/meta/range/endpoints now takes a units parameter and adjusts the return format accordingly:

http://127.0.0.1:8000/api/meta/range/endpoints/observationduration.json?units=milliseconds`
{"min": "0.0", "max": "50000000.0", "nulls": 11, "units": "milliseconds"}

http://127.0.0.1:8000/api/meta/range/endpoints/observationduration.json?units=seconds
{"min": "0.0000", "max": "50000.0000", "nulls": 11, "units": "seconds"}

http://127.0.0.1:8000/api/meta/range/endpoints/observationduration.json?units=minutes
{"min": "0.000000", "max": "833.333333", "nulls": 11, "units": "minutes"}

http://127.0.0.1:8000/api/meta/range/endpoints/observationduration.json?units=hours
{"min": "0.00000000", "max": "13.88888889", "nulls": 11, "units": "hours"}

http://127.0.0.1:8000/api/meta/range/endpoints/observationduration.json?units=days
{"min": "0.000000000", "max": "0.578703704", "nulls": 11, "units": "days"}