forked from LSSTDESC/Spectractor
-
Notifications
You must be signed in to change notification settings - Fork 1
Cache star coordinates #60
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
Open
jeremyneveu
wants to merge
18
commits into
lsst-dev
Choose a base branch
from
u/jneveu/astroquery
base: lsst-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
28b7b2d
add caching mechanism for simbad coordinates + and cache HD111980 for…
jeremyneveu 27e36d1
add simbad_table in pickle
jeremyneveu 7ce55a4
new functions for cache dir
jeremyneveu d4db066
new functions for cache dir
jeremyneveu 3e3c1ce
adapt proper motion keys with versino of cached file
jeremyneveu 7aa90f7
debug prints
jeremyneveu ab09162
debug prints and table proper motion keys
jeremyneveu dd83274
debug prints
jeremyneveu 09c5ad4
exclude cache folder and pickle files
jeremyneveu a2bc058
use astropy cache functions and put HD111980 coordinates in tests/dat…
jeremyneveu 50eb447
use ecsv format
jeremyneveu a3a4bd2
debug radec labels
jeremyneveu 468e27b
add ecsv and cache
jeremyneveu 47812c7
clean imports
jeremyneveu ae6b7a1
use default astropy cache location
jeremyneveu a636045
typos
jeremyneveu 400c9cc
typos
jeremyneveu 2e3bfe3
copy cached simbad files in astropy local cache via setup.py
jeremyneveu 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,4 +28,7 @@ config.log | |
| tests/.tests/ | ||
| *__pycache__/ | ||
| _build.* | ||
| *.pickle | ||
| *.ecsv | ||
| *cache/* | ||
|
|
||
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
242 changes: 242 additions & 0 deletions
242
tests/data/cache/astropy/astroquery/Simbad/HD_111980.ecsv
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,242 @@ | ||
| # %ECSV 1.0 | ||
| # --- | ||
| # datatype: | ||
| # - name: MAIN_ID | ||
| # datatype: string | ||
| # description: Main identifier for an object | ||
| # meta: !!omap | ||
| # - {ucd: meta.id;meta.main} | ||
| # - {width: 22} | ||
| # - links: | ||
| # - {href: 'http://simbad.u-strasbg.fr/simbad/sim-id?Ident=${MAIN_ID}&NbIdent=1', value: '${MAIN_ID}'} | ||
| # - {_votable_string_dtype: char} | ||
| # subtype: json | ||
| # - name: RA | ||
| # unit: '"h:m:s"' | ||
| # datatype: string | ||
| # description: Right ascension | ||
| # meta: !!omap | ||
| # - {ucd: pos.eq.ra;meta.main} | ||
| # - {width: 13} | ||
| # - {precision: '8'} | ||
| # - {_votable_string_dtype: char} | ||
| # - name: DEC | ||
| # unit: '"d:m:s"' | ||
| # datatype: string | ||
| # description: Declination | ||
| # meta: !!omap | ||
| # - {ucd: pos.eq.dec;meta.main} | ||
| # - {width: 13} | ||
| # - {precision: '8'} | ||
| # - {_votable_string_dtype: char} | ||
| # - name: RA_PREC | ||
| # datatype: int16 | ||
| # description: Right ascension precision | ||
| # meta: !!omap | ||
| # - {width: 2} | ||
| # - name: DEC_PREC | ||
| # datatype: int16 | ||
| # description: Declination precision | ||
| # meta: !!omap | ||
| # - {width: 2} | ||
| # - name: COO_ERR_MAJA | ||
| # unit: mas | ||
| # datatype: float32 | ||
| # format: '{:6.3f}' | ||
| # description: Coordinate error major axis | ||
| # meta: !!omap | ||
| # - {ucd: phys.angSize.smajAxis;pos.errorEllipse;pos.eq} | ||
| # - {width: 6} | ||
| # - {precision: '3'} | ||
| # - name: COO_ERR_MINA | ||
| # unit: mas | ||
| # datatype: float32 | ||
| # format: '{:6.3f}' | ||
| # description: Coordinate error minor axis | ||
| # meta: !!omap | ||
| # - {ucd: phys.angSize.sminAxis;pos.errorEllipse;pos.eq} | ||
| # - {width: 6} | ||
| # - {precision: '3'} | ||
| # - name: COO_ERR_ANGLE | ||
| # unit: deg | ||
| # datatype: int16 | ||
| # description: Coordinate error angle | ||
| # meta: !!omap | ||
| # - {ucd: pos.posAng;pos.errorEllipse;pos.eq} | ||
| # - {width: 3} | ||
| # - name: COO_QUAL | ||
| # datatype: string | ||
| # description: Coordinate quality | ||
| # meta: !!omap | ||
| # - {ucd: meta.code.qual;pos.eq} | ||
| # - {width: 1} | ||
| # - {_votable_string_dtype: char} | ||
| # - name: COO_WAVELENGTH | ||
| # datatype: string | ||
| # description: Wavelength class for the origin of the coordinates (R,I,V,U,X,G) | ||
| # meta: !!omap | ||
| # - {ucd: instr.bandpass;pos.eq} | ||
| # - {width: 1} | ||
| # - {_votable_string_dtype: char} | ||
| # - name: COO_BIBCODE | ||
| # datatype: string | ||
| # description: Coordinate reference | ||
| # meta: !!omap | ||
| # - {ucd: meta.bib.bibcode;pos.eq} | ||
| # - {width: 19} | ||
| # - {_votable_string_dtype: char} | ||
| # subtype: json | ||
| # - name: FLUX_U | ||
| # unit: mag | ||
| # datatype: float32 | ||
| # description: Magnitude U | ||
| # meta: !!omap | ||
| # - {ucd: phot.mag;em.opt.U} | ||
| # - name: FLUX_B | ||
| # unit: mag | ||
| # datatype: float32 | ||
| # description: Magnitude B | ||
| # meta: !!omap | ||
| # - {ucd: phot.mag;em.opt.B} | ||
| # - name: FLUX_V | ||
| # unit: mag | ||
| # datatype: float32 | ||
| # description: Magnitude V | ||
| # meta: !!omap | ||
| # - {ucd: phot.mag;em.opt.V} | ||
| # - name: FLUX_R | ||
| # unit: mag | ||
| # datatype: float32 | ||
| # description: Magnitude R | ||
| # meta: !!omap | ||
| # - {ucd: phot.mag;em.opt.R} | ||
| # - name: FLUX_I | ||
| # unit: mag | ||
| # datatype: float32 | ||
| # description: Magnitude I | ||
| # meta: !!omap | ||
| # - {ucd: phot.mag;em.opt.I} | ||
| # - name: FLUX_J | ||
| # unit: mag | ||
| # datatype: float32 | ||
| # description: Magnitude J | ||
| # meta: !!omap | ||
| # - {ucd: phot.mag;em.IR.J} | ||
| # - name: SP_TYPE | ||
| # datatype: string | ||
| # description: MK spectral type | ||
| # meta: !!omap | ||
| # - {ucd: src.spType} | ||
| # - {width: 6} | ||
| # - {_votable_string_dtype: char} | ||
| # subtype: json | ||
| # - name: SP_QUAL | ||
| # datatype: string | ||
| # description: Spectral type quality | ||
| # meta: !!omap | ||
| # - {ucd: meta.code.qual;src.spType} | ||
| # - {width: 1} | ||
| # - {_votable_string_dtype: char} | ||
| # - name: SP_BIBCODE | ||
| # datatype: string | ||
| # description: spectral type reference | ||
| # meta: !!omap | ||
| # - {ucd: meta.bib.bibcode;src.spType} | ||
| # - {width: 19} | ||
| # - {_votable_string_dtype: char} | ||
| # subtype: json | ||
| # - name: PLX_VALUE | ||
| # unit: mas | ||
| # datatype: float64 | ||
| # format: '{:9.3f}' | ||
| # description: Parallax | ||
| # meta: !!omap | ||
| # - {ucd: pos.parallax.trig} | ||
| # - {width: 9} | ||
| # - {precision: '3'} | ||
| # - name: PLX_PREC | ||
| # datatype: int16 | ||
| # description: Parallax precision | ||
| # meta: !!omap | ||
| # - {width: 1} | ||
| # - name: PLX_ERROR | ||
| # unit: mas | ||
| # datatype: float32 | ||
| # description: Parallax error | ||
| # meta: !!omap | ||
| # - {ucd: stat.error;pos.parallax.trig} | ||
| # - name: PLX_QUAL | ||
| # datatype: string | ||
| # description: Parallax quality | ||
| # meta: !!omap | ||
| # - {ucd: meta.code.qual;pos.parallax.trig} | ||
| # - {width: 1} | ||
| # - {_votable_string_dtype: char} | ||
| # - name: PLX_BIBCODE | ||
| # datatype: string | ||
| # description: Parallax reference | ||
| # meta: !!omap | ||
| # - {ucd: meta.bib.bibcode;pos.parallax.trig} | ||
| # - {width: 19} | ||
| # - {_votable_string_dtype: char} | ||
| # subtype: json | ||
| # - name: PMRA | ||
| # unit: mas / yr | ||
| # datatype: float64 | ||
| # format: '{:9.3f}' | ||
| # description: Proper motion in RA | ||
| # meta: !!omap | ||
| # - {ucd: pos.pm;pos.eq.ra} | ||
| # - {width: 9} | ||
| # - {precision: '3'} | ||
| # - name: PMDEC | ||
| # unit: mas / yr | ||
| # datatype: float64 | ||
| # format: '{:9.3f}' | ||
| # description: Proper motion in DEC | ||
| # meta: !!omap | ||
| # - {ucd: pos.pm;pos.eq.dec} | ||
| # - {width: 9} | ||
| # - {precision: '3'} | ||
| # - name: PM_ERR_MAJA | ||
| # unit: mas / yr | ||
| # datatype: float32 | ||
| # format: '{:5.3f}' | ||
| # description: Proper motion error major axis | ||
| # meta: !!omap | ||
| # - {ucd: phys.angSize.smajAxis;pos.errorEllipse;pos.pm} | ||
| # - {width: 5} | ||
| # - {precision: '3'} | ||
| # - name: PM_ERR_MINA | ||
| # unit: mas / yr | ||
| # datatype: float32 | ||
| # format: '{:5.3f}' | ||
| # description: Proper motion error minor axis | ||
| # meta: !!omap | ||
| # - {ucd: phys.angSize.sminAxis;pos.errorEllipse;pos.pm} | ||
| # - {width: 5} | ||
| # - {precision: '3'} | ||
| # - name: PM_ERR_ANGLE | ||
| # unit: deg | ||
| # datatype: int16 | ||
| # description: Proper motion error angle | ||
| # meta: !!omap | ||
| # - {ucd: pos.posAng;pos.errorEllipse;pos.pm} | ||
| # - {width: 3} | ||
| # - name: Z_VALUE | ||
| # datatype: float64 | ||
| # format: '{:.7f}' | ||
| # description: Redshift | ||
| # meta: !!omap | ||
| # - {ucd: src.redshift} | ||
| # - {precision: '7'} | ||
| # - name: SCRIPT_NUMBER_ID | ||
| # datatype: int32 | ||
| # meta: !!omap | ||
| # - {ucd: meta.number} | ||
| # - {width: 2} | ||
| # - {precision: '1'} | ||
| # meta: {ID: SimbadScript, description: 'Simbad script executed on 2025.03.13CET16:08:13', name: default} | ||
| # schema: astropy-2.0 | ||
| MAIN_ID RA DEC RA_PREC DEC_PREC COO_ERR_MAJA COO_ERR_MINA COO_ERR_ANGLE COO_QUAL COO_WAVELENGTH COO_BIBCODE FLUX_U FLUX_B FLUX_V FLUX_R FLUX_I FLUX_J SP_TYPE SP_QUAL SP_BIBCODE PLX_VALUE PLX_PREC PLX_ERROR PLX_QUAL PLX_BIBCODE PMRA PMDEC PM_ERR_MAJA PM_ERR_MINA PM_ERR_ANGLE Z_VALUE SCRIPT_NUMBER_ID | ||
| """HD 111980""" "12 53 15.0529" "-18 31 20.013" 14 14 0.0225 0.0183 90 A O """2020yCat.1350....0G""" 8.8 8.91 8.38 "" "" 7.176 """F7V""" C """1988MSS...C04....0H""" 12.9277 4 0.0261 A """2020yCat.1350....0G""" 299.359 -795.843 0.032 0.026 90 0.000517 1 |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry. When I said "copy the file to the cache in setup" I meant in the test code just before the test runs. Not having setup.py copy the file -- For tests with unittest there is a
setUpmethod that is called that can do things that the tests need. I'm not sure what the equivalent would be for your tests since you aren't using unittest. I didn't even realize you were using the deprecatedsetup.pyto build the package. There is no guarantee that when test code runs that that cache file written during package installation would still exist.PS I saw recently that Astropy cache tooling does allow you to name the cache directory so you can call it "spectractor", just like astroquery calls it "astroquery".