Documentation

edit

User:Robertinventor/CelestialRef creates

  • Name or internal link to the celestial object in Wikipedia
  • Footnote with links to the SIMBAD entry
  • Optionally, extra links to other entries for the object in online databases. These are added to the footnote.

It is especially useful if you have a table of celestial objects and want to add footnotes to each one, and maybe add extra entries in the footnotes such as pre-expanded SIMBAD bibliography, star plot, or link to a photograph of the object, as appropriate.

Alternative to this template: you can use: {{cite simbad}} if you just want to add the SIMBAD footnote, without these extra options.

Parameter Example Usage
First unnamed parameter M 31 Name to pass to Simbad basic search
Second unnamed parameter Andromeda Galaxy Alternative name for internal link
if absent uses first param
If set blank, name is not shown.
plot 10 Radius of star plot (if omitted, no star plot link added)
units arcsec Measurement unit for radius, arcsec, arcmin or deg acceptable, default arcmin
ids show set to show to add link to ids section of SIMBAD page
bib show set to show to add link to pre-expanded bibliography section
siblings show set to show to add link to siblings search
cds short set to short to display as "CDS" instead of "Centre de données astronomiques de Strasbourg"
image show set to show to add link to aladin preview image, colour
bwimage show set to show to add link to aladin preview image, B&w
sep , Separator for the extra entries. Default currently is to separate with dashes
inline yes Does everything inline, not as a footnote

Examples

edit

Any identifier recognized by Simbad for its sim-basic will do.

So, these are all possible: {{User:Robertinventor/CelestialRef | M 31}}, {{User:Robertinventor/CelestialRef | Crab Nebula}}, {{User:Robertinventor/CelestialRef | HD 189733b}} etc.

Displayed as: M 31[1]

-->, Crab Nebula[2]

-->, HD 189733b[3]

-->.

This shows all the features in use: Example: {{User:Robertinventor/CelestialRef| Crab Nebula | cds=short | ids=show | bib=show | plot=10 |units=arcsec | image=show | bwimage=show }}

yields Crab Nebula [4]

-->

Same example with commas instead of dashes : {{User:Robertinventor/CelestialRef| Crab Nebula | sep=, |cds=short | ids=show | bib=show | plot=10 |units=arcsec | image=show | bwimage=show }}

yields Crab Nebula [5]

-->

That might be useful in an article for a single celestial object, for instance, to add all those links in a footnote for the object which is the subject of the article.

edit

You can use a different name for the internal link and the SIMBAD lookup.

{{ User:Robertinventor/CelestialRef | M 31 |Andromeda Galaxy }}

yields: Andromeda Galaxy [6]

-->

Ref only

edit

If you just want the ref without the name, use the same approach, but make the different name for the internal link blank, as in

{{ User:Robertinventor/CelestialRef | M 42 | }}
Yields:
[7]

-->

You can miix with other named parameters in any order, e.g.:

{{ User:Robertinventor/CelestialRef | M 42 | | bib=show }} (same idea but added an extra named parameter at the end)
Yields:
[8]

-->

Which you could then add to some text as Test {{ User:Robertinventor/CelestialRef | M 42 | | bib=show }}

Test [9]

-->

It doesn't matter where you put this blank field amongst the other parameters, so long as it goes after the object name.

Techy details - the template recognizes your blank field as parameter 2, the second unnamed parameter.

edit

If you just want the name without an internal link, add link=no as: {{ User:Robertinventor/CelestialRef | M 31 |Andromeda Galaxy | link=no}}

yields: Andromeda Galaxy[10]

-->

{{ User:Robertinventor/CelestialRef | M 31 | link=no}}

yields: M 31[11]

-->

Siblings

edit

You can add a link for siblings e.g. {{ User:Robertinventor/CelestialRef | GL 146 |siblings = show}}

This may be useful if the object is part of a larger group and this is relevant to the article citing it, in this case the Hyades super cluster.

Gliese 146 [12]

-->

Star plot

edit

The advantage of the star plot extra link is that it lets the author of the page preset the radius for the plot. For some objects this needs to be large, e.g. 20 arcmins or more. For others, that shows far too many objects and a smaller radius in arcsecs is appropriate.

Example: {{ User:Robertinventor/CelestialRef | HD 189733b | plot = 5 }}

yields HD 189733b [13]

--> to plot stars within 5 arcmins of HD 189733b

Example: {{ User:Robertinventor/CelestialRef | Alpha Centauri | plot = 50 | units = arcsec }}

yields Alpha Centauri [14]

--> to plot stars within 50 arcsecs of Alpha Centauri

Use in tables

edit

The template can be used in tables. This was the original motivation for this template - to have an easy way to add footnotes anad add extra links to the footnotes, for every entry in a table.

Here is an example to test it.

Confirmed Giant Planets around Mid- and Late-K-type Dwarf Stars

edit

All entries are set to add the extra Bibliography link to the refs.

Example: {{ User:Robertinventor/CelestialRef | bib=show | WASP-80b }}

Planet Mass (MJ) Period (d) SpT B - V Te?
WASP-43b[15]

-->||2.03||0.813||K7||1.0||4400d

HAT-P-20b[16]

-->||7.25||2.88||K3||—||4619

GJ 439 c[17]

-->||0.41e||32.0||K4||1.11||4640

GJ 439 d[18]

-->||0.53e||431.7||-||-||-

WASP-59b[19]

-->||0.0.86||7.92||K5||0.92||4650h

HD 113538b[20]

-->||0.27e||263.3||K9f||-||-

HD 113538c[21]

-->||0.71e||1657||-||-||-

BD-17 63b[22]

-->||5.12e||655.6||K4||1.14||4714

WASP-10b[23]

-->||3.06||3.09||K5||—||-

BD-08 2823b[24]

-->||0.33||237.6||K3||1.07||4746

HD 20868b[25]

-->||1.99||380.85||K3/4||1.04||4795

HD 63454b[26]

-->||0.38e||2.82||K4||1.06||4840

Qatar 1b[27]

-->||1.09||1.42||N/A||1.06||4861

CD-23 395b[28]

-->||1.44e||345.6||K5||1.08||4962

Data from Giant Planets around Late K Dwarf Stars - Table 1

References

edit
  1. ^ " M 31",SIMBAD,Centre de données astronomiques de Strasbourg .
  2. ^ " Crab Nebula",SIMBAD,Centre de données astronomiques de Strasbourg .
  3. ^ " HD 189733b",SIMBAD,Centre de données astronomiques de Strasbourg .
  4. ^ " Crab Nebula ",SIMBAD,CDS- Ids - Bibliography- Star plot - Image- B&W Image.
  5. ^ " Crab Nebula ",SIMBAD,CDS, Ids , Bibliography, Star plot , Image, B&W Image.
  6. ^ " M 31 ",SIMBAD,Centre de données astronomiques de Strasbourg .
  7. ^ " M 42 ",SIMBAD,Centre de données astronomiques de Strasbourg .
  8. ^ " M 42 ",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  9. ^ " M 42 ",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  10. ^ " M 31 ",SIMBAD,Centre de données astronomiques de Strasbourg .
  11. ^ " M 31 ",SIMBAD,Centre de données astronomiques de Strasbourg .
  12. ^ " Gliese 146 ",SIMBAD,Centre de données astronomiques de Strasbourg - Siblings .
  13. ^ " HD 189733b ",SIMBAD,Centre de données astronomiques de Strasbourg - Star plot .
  14. ^ " Alpha Centauri ",SIMBAD,Centre de données astronomiques de Strasbourg - Star plot .
  15. ^ "WASP-43b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  16. ^ "HAT-P-20b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  17. ^ "GJ 439 c",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  18. ^ "GJ 439 d",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  19. ^ "WASP-59b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  20. ^ "HD 113538b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  21. ^ "HD 113538c",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  22. ^ "BD-17 63b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  23. ^ "WASP-10b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  24. ^ "BD-08 2823b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  25. ^ "HD 20868b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  26. ^ "HD 63454b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  27. ^ "Qatar 1b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  28. ^ "CD-23 395b",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .

See also

edit

Use in tables

edit

The template can be used in tables. Here is an example to test it. Data from Giant Planets around Late K Dwarf Stars - Table 1:

Confirmed Giant Planets around Mid- and Late-K-type Dwarf Stars

edit

All entries are set to add the extra Bibliography link to the refs

Example: {{User:Robertinventor/CelestialRef|CelestialRef|bib=show||WASP-80b}}

Planet Mass (MJ) Period (d) SpT B - V Te?
[1]

--> ||0.55|| 3.068|| K7-M0 ||0.94|| ~4000

HIP 70849b[2]

-->|| > 3 ||> 5 yr|| K7 ||1.42 ||4100c (2011)

WASP-43b[3]

-->||2.03||0.813||K7||1.0||4400d

HAT-P-20b[4]

-->||7.25||2.88||K3||—||4619

HIP 57274c[5]

-->||0.41e||32.0||K4||1.11||4640

HIP 57274d[6]

-->||0.53e||431.7||-||-||-

WASP-59b[7]

-->||0.0.86||7.92||K5||0.92||4650h

HID 113538b[8]

-->||0.27e||263.3||K9f||-||-

HID 113585c[9]

-->||0.71e||1657||-||-||-

BD-17 63b[10]

-->||5.12e||655.6||K4||1.14||4714

WASP-10b[11]

-->||3.06||3.09||K5||—||-

BD-08 2823b[12]

-->||0.33||237.6||K3||1.07||4746

HID 20868b[13]

-->||1.99||380.85||K3/4||1.04||4795

HID 63454b[14]

-->||0.38e||2.82||K4||1.06||4840

Qatar-1b[15]

-->||1.09||1.42||N/A||1.06||4861

HIP 5158bg[16]

-->||1.44e||345.6||K5||1.08||4962

Code Documentation

edit

The code for the displayed name section is complex and may be difficult for future coders to update. It also needs to be done all as a single line since otherwise it breaks table formatting when including in tables.

So, here is a commented version. Sadly, there doesn't seem to be any way to include comments inside of a wikipedia template but hopefully this will make it clear how it works.

I use a c like convention here // for comments.

Everything from the /// to end of line ignored, also though, any preceding and following white space also ignored including previous and following returns

// ***Displayed object name section***
{{#ifeq:{{{2|NoName}}}|NoName// Has user entered second parameter?
// Here NoName as preset value for param 2 makes the test possible
// if it remains at preset value then they didn't enter a second parameter at all. 
// Preset value here can be anything that's not suitable for a SIMBAD id.

| // Case: no second param 

|{{#ifeq:{{{link}}}|no| // link=no?
{{{1}}} // link = no, param 1 as name only
|[[{{{1}}}]] //  link=anything else, or not set, param 1 as internal link
}}// end of link = no?

| // Case: second param
{{#ifeq:{{{2|}}}|
| // Second param is blank, e.g. {{CelestialRef|Object Name|}} 
// no name section at all just bare ref.

| // Second param entered by user, and not blank
// 
|{{#ifeq:{{{link}}}|no
|{{{2}}} // // link=no, param 2 as name only
|[[{{{2}}}]] // link=yes or not set, param 2 as internal link
}}// end of link=?
}}// end of test that param 2 is blank
}}// end of test to see if user entered param 2 at all

Test cases

edit

Included mainly to check all the features are working correctly, check this after editing the code and add more test cases if nec if you add new features.

Example: {{ User:Robertinventor/CelestialRef | Barnard's star }}

yields Barnard's star [17]

-->

Example: {{ User:Robertinventor/CelestialRef | Barnard's star |link=no}}

yields Barnard's star[18]

-->

Example: {{ User:Robertinventor/CelestialRef | Barnard's star | }} for ref only

yields [19]

-->

Example: {{ User:Robertinventor/CelestialRef | M 31 | Andromeda Galaxy }} to display as Andromeda Galaxy but look up as M 31

yields Andromeda Galaxy [20]

-->

Same example, name only, no internal link: {{ User:Robertinventor/CelestialRef | M 31 | Andromeda Galaxy |link=no}}

yields Andromeda Galaxy[21]

-->

Final example shows all the features in one ref

Example: {{User:Robertinventor/CelestialRef| M 31 | cds=short | ids=show | bib=show | plot = 10 |units = arcsec | image=show | bwimage=show }}

yields M 31 [22]

-->

References

edit
  1. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  2. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  3. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  4. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  5. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  6. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  7. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  8. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  9. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  10. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  11. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  12. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  13. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  14. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  15. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  16. ^ "CelestialRef",SIMBAD,Centre de données astronomiques de Strasbourg - Bibliography .
  17. ^ " Barnard's star ",SIMBAD,Centre de données astronomiques de Strasbourg .
  18. ^ " Barnard's star ",SIMBAD,Centre de données astronomiques de Strasbourg .
  19. ^ " Barnard's star ",SIMBAD,Centre de données astronomiques de Strasbourg .
  20. ^ " M 31 ",SIMBAD,Centre de données astronomiques de Strasbourg .
  21. ^ " M 31 ",SIMBAD,Centre de données astronomiques de Strasbourg .
  22. ^ " M 31 ",SIMBAD,CDS- Ids - Bibliography- Star plot - Image- B&W Image.

References

edit