-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First Companion Table Ingest First ingest into Companions table [ ] ingest reference not in Simple [ ] ingest source not in Simple [ ] import google sheets [ ] write ingest function * Start of the companions_first_ingest file * start of file * ingest CWISE source and reference * Add other names function I can only find in the utils_deprecated file * Code to ingest a single row itereating through the google sheet * Code to ingest a single row itereating through the google sheet * removing files * added companion function to injest utils with doc string * fixed angle * FIXED ANGLE ERROR FROM FILIP 15 * Add other names function to ingest_utils and replaced code in ingest source * fix angle * syntax * test for Companion Relationship * created test_names_uniqueness and separtate test_companion_relationship_uniqueness * syntax changes * test ingest names code * small changes syntax * fixed test * added some checks for ingest in tests and corrected projected_separation_arcsec naming * adding schema changes * adding doc changes * Revert "adding schema changes" This reverts commit 4cc3b10. * Revert "adding doc changes" This reverts commit 08b0aaa. * Small changes/debugging * fixing names of functions and variables * adjusted names * add negative tests for modeled parameters * small syntax * moved tests * constrain relatioships * add doc for CompanionRelationships table * Update tests/test_utils.py Co-authored-by: Kelle Cruz <[email protected]> * small updates * tests fixed * add other companion name list as csv. Not sure if discription is clear enough * updates to make compatable with other comapanion names columns + other companion names injested in injest file * small syntax * small changes * updated doc * added checks here to get helpful errors * small changes * changes to fix error * SAVE_DB = True * data files * test fixes * documentation typo --------- Co-authored-by: kelle <[email protected]>
- Loading branch information
Showing
21 changed files
with
562 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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,31 @@ | ||
{ | ||
"Sources": [ | ||
{ | ||
"source": "CWISE J210640.16+250729.0", | ||
"ra": 316.66736, | ||
"dec": 25.124719444444445, | ||
"epoch": null, | ||
"equinox": null, | ||
"shortname": null, | ||
"reference": "Roth", | ||
"other_references": null, | ||
"comments": null | ||
} | ||
], | ||
"CompanionRelationships": [ | ||
{ | ||
"companion_name": "BD+24 4329", | ||
"projected_separation_arcsec": 1124.0, | ||
"projected_separation_error": null, | ||
"relationship": "Child", | ||
"comments": null, | ||
"reference": "Roth", | ||
"other_companion_names": "2MASS J21080190+2510346, BD+24 4329" | ||
} | ||
], | ||
"Names": [ | ||
{ | ||
"other_name": "CWISE J210640.16+250729.0" | ||
} | ||
] | ||
} |
This file contains 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 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 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 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 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 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,23 @@ | ||
# CompanionRelationships | ||
|
||
The CompanionRelationships table contains companions to sources listed in the Sources table. | ||
The combination of *source* and *companion_name* is expected to be unique. | ||
Columns marked with an asterisk (*) may not be empty. | ||
|
||
| Column Name | Description | Unit | Data Type | Key Type | | ||
|---|---|---|---|---| | ||
| *source | Unique identifier for the source | | String(100) | primary and foreign: Sources.source | | ||
| *companion_name | SIMBAD resovable name of companion object | | String(100) | primary | | ||
| projected_separation_arcsec | Projected separation between the source and companion | arcsec | Float | | | ||
| projected_separation_error | Uncertainty of projected separation | arcsec | Float | | | ||
| relationship | Relationship of source to companion. See Notes below. | | String(100) | | | ||
| comments | Free form comments | | String(1000) | | | ||
| reference | Reference | | String(30) | foreign: Publications.name | | ||
| other_companion_names | Comma separated names | | String(1000) | | | ||
|
||
## Notes | ||
Relationships are constrained but should be one of the following: | ||
- *Child*: The source is lower mass/fainter than the companion | ||
- *Sibling*: The source is similar to the companion | ||
- *Parent*: The source is higher mass/brighter than the companion | ||
- *Unresolved Parent*: The source is the unresolved, combined light source of an unresolved multiple system which includes the companion |
This file contains 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,66 @@ | ||
# script ingest first data into companion tables | ||
|
||
from scripts.ingests.ingest_utils import * | ||
from scripts.ingests.utils import * | ||
from astropy.table import Table | ||
import astropy.units as u | ||
from astropy.coordinates import Angle | ||
|
||
|
||
SAVE_DB = True # save the data files in addition to modifying the .db file | ||
RECREATE_DB = True # recreates the .db file from the data files | ||
VERBOSE = False | ||
# LOAD THE DATABASE | ||
db = load_simpledb('SIMPLE.db', recreatedb=RECREATE_DB) | ||
|
||
|
||
# Ingest CWISE J210640.16+250729.0 and its reference | ||
ingest_publication(db, doi = None, bibcode = None, publication = "Roth", | ||
description = "Rothermich in prep.", ignore_ads = True) | ||
|
||
|
||
ra_2106= Angle("21 06 40.1664", u.hour).degree | ||
dec_2507=Angle("+25 07 28.99", u.degree).degree | ||
|
||
ingest_sources(db, ["CWISE J210640.16+250729.0"], references="Roth", | ||
ras= [ra_2106], | ||
decs=[dec_2507], | ||
search_db=False) | ||
|
||
# Ingest other name for NLTT 1011B (one used in SIMBAD) | ||
# code from deprecated utils does not work | ||
ingest_names(db, 'NLTT 1011B', '2MASS J00193275+4018576') | ||
|
||
|
||
# start of ingest | ||
# link to live google sheet | ||
link = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQEOZ56agEsAAd6SHVrwXc4hIrTtlCnCNWMefGuKkAXBjius1LgKFbj8fgbL7e8bmLTJbbBIZgwPQrz/pub?gid=0&single=true&output=csv' | ||
# | ||
columns = ['source', 'companion_name', 'projected_separation', 'projected_separation_error', 'relationship', 'comment', 'ref', 'other_companion_names'] | ||
companions = Table.read(link, format='ascii', data_start=2, data_end=14, names=columns, guess=False, | ||
fast_reader=False, delimiter=',') | ||
|
||
|
||
for row in companions: | ||
# collecting variables | ||
source, companion_name, projected_separation_arcsec, relationship = row['source', 'companion_name', 'projected_separation','relationship'] | ||
|
||
# getting reference if there is one | ||
ref = None | ||
if row['ref'] != '': | ||
ref = row['ref'] | ||
# getting other name if there is one | ||
other_companion_names = None | ||
if row['other_companion_names'] != '': | ||
other_companion_names = row['other_companion_names'] | ||
|
||
# adding row | ||
ingest_companion_relationships(db, source, companion_name, projected_separation_arcsec =projected_separation_arcsec, | ||
relationship = relationship, ref = ref, other_companion_names= other_companion_names) | ||
|
||
|
||
|
||
|
||
# WRITE THE JSON FILES | ||
if SAVE_DB: | ||
db.save_database(directory='data/') |
This file contains 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.