Package: gilmenel
GilmenelSindarin.noun. meaningStar of the Heavens(Sindarin Elvish as created byJ. R. R. Tolkien)A framework for selecting stars in a target field that meet complex criteria defined by a telescope or instrument.Given coordinates on-sky and a basic definition of a science instrument (basic instruments, along with some from the Southern African Large Telescope are included) stars can be selected for a specific purpose. The example is the output of thesalt_guidestars.pyscript when pointed at the Jewel Box and with the--pngflag enabled.Installationpip install gilmenelDependenciesFor Ubuntu 18.04 and Python3:# apt-get install python3-dev

$ sudo -H pip install -U pipenvLibraries that might be required are:# apt-get install default-libmysqlclient-dev
# apt-get install libssl-devPrimary Python packages:astropyastroquerysqlalchemymatplotlibInstall DS9 for additional debugging:# apt-get install saods9Setup$ make installPlace the config file 'docs/config.py' into the main project directory.
Edit the file as required.Removal$ make uninstallTestingTo run unit tests, execute:$ make checkTo run unit tests on source code change, execute:$ make watch-checkTo run coverage test, execute:$ make coverageExamplesMinimal example:from astropy import units as u
from astropy.coordinates import SkyCoord

from gilmenel import gilmenel
from gilmenel import salt

gilmenel.init()

tarantula = SkyCoord(
    '05h 38m 38s', '−69:05.7', unit=(u.hourangle, u.deg)
)  # Tarantula Nebula

instr = salt.fif
instr.point_to(tarantula, pa=0 * u.deg)

stars = gilmenel.view_sky(instr)
guide_stars = gilmenel.find_best_stars(instr, stars)

print(guide_stars)A full usage example can be found in salt_guidestars.pyUsage:salt_guidestars.py field [OPTIONS] [jewel_box|near_jewel|somewhere|bootes_void|
unittest|regular|centre|offset|null|mbxgpS201906130009|mbxgpP201906130039|tarantula|
sunflower|m83] PA [pfgs|fif]eg:$ ./salt_guidestars.py field jewel_box 0 pfgsDS9When using ds9 for debugging, there appears to be two different versions that interpret
the command string differently.ds9 -dsseso "00:42:44.404 +41:16:08.78"Versusds9 -dsseso coord "00:42:44.404 +41:16:08.78"The code might need to be changed to reflect the version locally installed.CatalogueAsteria is designed to be run for a local or remote catalogue.To download the whole-sky catalogue for SALT, run the command below. Please note that this is not recommended as A LOT of data (we're talking gigabytes here) will be downloaded.$ ./catalogue/drop_db.sky
$ ./catalogue/create_db.py
$ ./catalogue/download_sky.py
$ ./catalogue/prepare_db.pyShould the catalogue download fail part-way through, inspect the filessucceeded.tsvandfailed.tsvfor more details. Additional arguments can be passed todownload_sky.pyto begin in the correct place. Note that since data is downloaded and only committed to the database every 30 000 sources, a simple select query WHICH MUST INCLUDE THELIMITKEYWORD will show the last sources committed.To view an image of the local catalogue, run:$ ./catalogue/view_sky.pyTo run the view command on remote machines without displays:$ export MPLBACKEND="agg"Database OperationsTo see a summary of duplicatesselect dup_count, count(dup_count) as row_count from (select count(source_id) as dup_count from Sources group by source) t group by dup_count order by dup_count;To delete duplicate rowsdelete from Sources where source_id not in (select min(source_id) from Sources group by source);CommitsAs of v0.4.0, this project will use the git commit message format outlined below:[optional breaking ]<type>[ optional (<scope>)]: <description>

[optional body]<type>is recommended to be one of:fix
feat
build
chore
ci
docs
style
refactor
perf
test<scope>is recommended to be a module, file, or folder name as appropiate.This is a simpler version ofhttps://www.conventionalcommits.org/VersionsThis project uses Semantic Versioning, for more details seehttps://semver.org/