-
Notifications
You must be signed in to change notification settings - Fork 395
Added units for Astronomy. #680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
85d8c16
Added units for Astronomy.
74663b8
Added units for Astronomy.
a846f9a
Merged with remote origin.
4b9a40e
Put computed value instead of equation for conversion ratios.
6778b39
Added Luminosity Quantity.
ea27c15
Merge pull request #1 from angularsen/master
ebfortin 467ccbb
WIP for having custom unit change between Solar and Earth mass.
b7a05c3
Merge branch 'master' of https://github.com/ebfortin/UnitsNet
430f943
All Astronomical units added along with a new Luminosity unit.
bac7b78
Mass.json: Fix BaseUnits
angularsen c31f955
Ran generate-code.bat for latest changes incorporation.
1423b8d
Merge branch 'master' of https://github.com/ebfortin/UnitsNet
cc2c680
Changed source for SolarLuminosity value.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"Name": "Luminosity", | ||
"BaseUnit": "Watt", | ||
"BaseType": "double", | ||
"XmlDoc": "Luminosity is an absolute measure of radiated electromagnetic power (light), the radiant power emitted by a light-emitting object.", | ||
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Luminosity", | ||
"BaseDimensions": { | ||
"L": 2, | ||
"M": 1, | ||
"T": -3 | ||
}, | ||
"Units": [ | ||
{ | ||
"SingularName": "Watt", | ||
"PluralName": "Watts", | ||
"FromUnitToBaseFunc": "x", | ||
"FromBaseToUnitFunc": "x", | ||
"Prefixes": [ "Femto", "Pico", "Nano", "Micro", "Milli", "Deci", "Deca", "Kilo", "Mega", "Giga", "Tera", "Peta" ], | ||
"Localization": [ | ||
{ | ||
"Culture": "en-US", | ||
"Abbreviations": [ "W" ] | ||
} | ||
] | ||
}, | ||
{ | ||
"SingularName": "SolarLuminosity", | ||
"PluralName": "SolarLuminosities", | ||
"FromUnitToBaseFunc": "x * 3.846e26", | ||
"FromBaseToUnitFunc": "x / 3.846e26", | ||
"XmlDocRemarks": "https://www.britannica.com/science/luminosity", | ||
"Localization": [ | ||
{ | ||
"Culture": "en-US", | ||
"Abbreviations": [ "L⊙" ] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by \generate-code.bat. | ||
// | ||
// Changes to this file will be lost when the code is regenerated. | ||
// The build server regenerates the code before each build and a pre-build | ||
// step will regenerate the code on each local build. | ||
// | ||
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units. | ||
// | ||
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities. | ||
// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities. | ||
// | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
// Licensed under MIT No Attribution, see LICENSE file at the root. | ||
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet. | ||
|
||
using System; | ||
|
||
namespace UnitsNet.Tests.CustomCode | ||
{ | ||
public class LuminosityTests : LuminosityTestsBase | ||
{ | ||
// Override properties in base class here | ||
protected override double FemtowattsInOneWatt => 1e15; | ||
|
||
protected override double PicowattsInOneWatt => 1e12; | ||
|
||
protected override double NanowattsInOneWatt => 1e9; | ||
|
||
protected override double MicrowattsInOneWatt => 1e6; | ||
|
||
protected override double MilliwattsInOneWatt => 1e3; | ||
|
||
protected override double DeciwattsInOneWatt => 1e1; | ||
|
||
protected override double WattsInOneWatt => 1; | ||
|
||
protected override double DecawattsInOneWatt => 1e-1; | ||
|
||
protected override double KilowattsInOneWatt => 1e-3; | ||
|
||
protected override double MegawattsInOneWatt => 1e-6; | ||
|
||
protected override double GigawattsInOneWatt => 1e-9; | ||
|
||
protected override double TerawattsInOneWatt => 1e-12; | ||
|
||
protected override double PetawattsInOneWatt => 1e-15; | ||
|
||
protected override double SolarLuminositiesInOneWatt => 2.6001040041601700000000000E-27; | ||
|
||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.