Astro-Constants
view release on metacpan or search on metacpan
lib/Astro/Constants.pm6 view on Meta::CPAN
our constant RADIUS_JUPITER is export(:planetary) = 69_911_000;
=head3 MASS_JUPITER
1.89819e27 MKS
mass of Jupiter
=end pod
our constant MASS_JUPITER is export(:planetary) = 1.89819e27;
=begin pod
=head3 pretty
This is a helper function that rounds a value or list of values to 5 significant figures.
=head3 precision
Give this method the string of the constant and it returns the precision or uncertainty
listed.
$rel_precision = precision('GRAVITATIONAL');
$abs_precision = precision('MASS_EARTH');
At the moment you need to know whether the uncertainty is relative or absolute.
Looking to fix this in future versions.
=head2 Deprecated functions
I've gotten rid of C<list_constants> and C<describe_constants> because they are now in
the documentation. Use C<perldoc Astro::Constants> for that information.
=head1 SEE ALSO
=item L<Astro::Cosmology>
=item L<Perl Data Language|PDL>
=item L<NIST|http://physics.nist.gov>
=item L<Astronomical Almanac|http://asa.usno.navy.mil>
=item L<IAU 2015 Resolution B3|http://iopscience.iop.org/article/10.3847/0004-6256/152/2/41/meta>
=item L<Neil Bower's review on providing read-only values|http://neilb.org/reviews/constants.html>
=item L<Test::Number::Delta>
=item L<Test::Deep::NumberTolerant> for testing values within objects
Reference Documents:
=item L<IAU 2009 system of astronomical constants|http://aa.usno.navy.mil/publications/reports/Luzumetal2011.pdf>
=item L<Astronomical Constants 2016.pdf|http://asa.usno.navy.mil/static/files/2016/Astronomical_Constants_2016.pdf>
=item L<IAU recommendations concerning units|https://www.iau.org/publications/proceedings_rules/units>
=item L<Re-definition of the Astronomical Unit|http://syrte.obspm.fr/IAU_resolutions/Res_IAU2012_B2.pdf>
=head1 REPOSITORY
* L<https://github.com/duffee/Astro-Constants>
=head1 ISSUES
File issues/suggestions at the Github repository L<https://github.com/duffee/Astro-Constants>.
The venerable L<RT|https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=Astro-Constants>
is the canonical bug tracker that is clocked by L<meta::cpan|https://metacpan.org/pod/Astro::Constants>.
Using C<strict> is a must with this code. Any constants you forgot to import will
evaluate to 0 and silently introduce errors in your code. Caveat Programmer.
If you are using this module, drop me a line using any available means at your
disposal, including
*gasp* email (address in the Author section), to let me know how you're using it.
What new features would you like to see?
If you've had an experience with using the module, let other people know what you
think, good or bad, by rating it at
L<cpanratings|http://cpanratings.perl.org/rate/?distribution=Astro-Constants>.
=head2 Extending the data set
If you want to add in your own constants or override the factory defaults,
run make, edit the F<PhysicalConstants.xml> file and then run C<dzil build> again.
If you have a pre-existing F<PhysicalConstants.xml> file, drop it in place
before running C<dzil build>.
=head2 Availability
the original astroconst sites have disappeared
=head1 ROADMAP
I plan to deprecate the short names and change the order in which
long names are constructed, moving to a I<noun_adjective> format.
LIGHT_SPEED and SOLAR_MASS become SPEED_LIGHT and MASS_SOLAR.
This principle should make the code easier to read with the most
important information coming at the beginning of the name.
=head1 ASTROCONST X<ASTROCONST>
(Gleaned from the Astroconst home page -
L<astroconst.org|http://web.astroconst.org> )
Astroconst is a set of header files in various languages (currently C,
Fortran, Perl, Java, IDL and Gnuplot) that provide a variety of useful
astrophysical constants without constantly needing to look them up.
The generation of the header files from one data file is automated, so you
can add new constants to the data file and generate new header files in all
the appropriate languages without needing to fiddle with each header file
individually.
This package was created and is maintained by Jeremy Bailin. It's license
states that it I<is completely free, both as in speech and as in beer>.
=head1 DISCLAIMER
No warranty expressed or implied. This is free software. If you
want someone to assume the risk of an incorrect value, you better
be paying them.
(What would you want me to test in order for you to depend on this module?)
I<from Jeremy Bailin's astroconst header files>
The Astroconst values have been gleaned from a variety of sources,
and have quite different precisions depending both on the known
( run in 0.866 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )