Comments (2)
I think I found an issue with the parsing of the MPC ephemeris results.
The
This is the result for comet 113P produced today and where my error happens today.
Date UT R.A. (J2000) Decl. Delta r El. Ph. m1 Sky Motion Object Sun Moon
h m s "/hr "/hr Azi. Alt. Alt. Phase Dist. Alt.
2024 06 06 195900 12 34 22.7 -10 03 31 3.997 4.527 115.5 11.7 23.1 -0.13 +2.96 204 +31 -10 0.00 112 -04
2024 06 06 202900 12 34 22.7 -10 03 29 3.998 4.527 115.4 11.7 23.1 -0.099 +2.97 212 +29 -13 0.00 112 -07
2024 06 06 205900 12 34 22.7 -10 03 28 3.998 4.527 115.4 11.7 23.1 -0.060 +2.97 220 +26 -16 0.00 111 -10
2024 06 06 212900 12 34 22.7 -10 03 26 3.998 4.527 115.4 11.7 23.1 -0.016 +2.97 227 +22 -18 0.00 111 -12
2024 06 06 215900 12 34 22.7 -10 03 25 3.999 4.527 115.4 11.7 23.1 +0.033 +2.98 234 +18 -20 0.00 111 -14
2024 06 06 222900 12 34 22.7 -10 03 23 3.999 4.528 115.4 11.7 23.1 +0.087 +2.98 240 +13 -21 0.00 111 -15
2024 06 06 225900 12 34 22.7 -10 03 22 3.999 4.528 115.3 11.7 23.1 +0.14 +2.98 246 +09 -22 0.00 110 -16
As can be seen the SkyMotion columns sometimes have the precision of 3 decimals arcsec/h.
So I looked at the _parse_result(self, result, **kwargs) function in the MPCClass and tried to print out the table of parsed results just after
tab = ascii.read(text_table, format='fixed_width_no_header',
names=names, col_starts=col_starts,
col_ends=col_ends, data_start=data_start,
fill_values=(('N/A', np.nan),), fast_reader=False)
for col, unit in zip(names, units):
tab[col].unit = unit
print(tab)
And here is what I get:
113P/Spitaler
Date RA Dec Delta r Elongation Phase V dRA cos(Dec) dDec Azimuth Altitude Sun altitude Moon phase Moon distance Moon altitude
AU AU deg deg mag arcsec / h arcsec / h deg deg deg deg deg
----------------- ---------- --------- ----- ----- ---------- ----- ---- ------------ ---------- ------- -------- ------------ ---------- ------------- -------------
2024 06 06 200000 12 34 22.7 -10 03 31 3.997 4.527 115.5 11.7 23.1 -0.13 +2.96 205 31 -10 0.0 112 -4
2024 06 06 203000 12 34 22.7 -10 03 29 3.998 4.527 115.4 11.7 23.1 -0.09 8 +2.97 213 29 -13 0.0 112 -7
2024 06 06 210000 12 34 22.7 -10 03 28 3.998 4.527 115.4 11.7 23.1 -0.05 9 +2.97 220 25 -16 0.0 111 -10
2024 06 06 213000 12 34 22.7 -10 03 26 3.998 4.527 115.4 11.7 23.1 -0.01 4 +2.97 227 22 -18 0.0 111 -12
2024 06 06 220000 12 34 22.7 -10 03 25 3.999 4.527 115.4 11.7 23.1 0.03 5 +2.98 234 18 -20 0.0 111 -14
2024 06 06 223000 12 34 22.7 -10 03 23 3.999 4.528 115.4 11.7 23.1 0.08 9 +2.98 240 13 -21 0.0 111 -15
As can be seen the dRA cos(Dec) and dDec are parsed inccorectlly where the precision fo dRA cos(Dec) is 3 decimals. The last digit is already parsed to the dDec column making it a string instead of a float column and the conversion to arcsec/min later fails.
The issue comes from setting the col_start and col_ends for Sky Motion in the _parse_result()
Current code:
elif 's=s' in result.request.body: # sky Motion
names += ('dRA cos(Dec)', 'dDec')
units += ('arcsec/h', 'arcsec/h')
col_starts += (73, 81)
col_ends += (80, 89)
if 'Moon' in columns:
# table includes Alt, Az, Sun and Moon geometry
names += ('Azimuth', 'Altitude', 'Sun altitude', 'Moon phase',
'Moon distance', 'Moon altitude')
col_starts += tuple((col_ends[-1] + offset for offset in
(2, 9, 14, 20, 27, 33)))
col_ends += tuple((col_ends[-1] + offset for offset in
(8, 13, 19, 26, 32, 37)))
units += ('deg', 'deg', 'deg', None, 'deg', 'deg')
To fix this we need to parse one character more so the end of dRA cos(Dec) column is shifted one character to the right. But also the dDec column can have 3 decimals precision so the end of the column must also be shifted to the right now for 2 characters to column 91.
But changing the col_ends has the effect on all remaining columns, so we need to adjust the next part and all the starts and ands must be moved now one character to the left.
Corrected code
elif 's=s' in result.request.body: # sky Motion
names += ('dRA cos(Dec)', 'dDec')
units += ('arcsec/h', 'arcsec/h')
col_starts += (73, 82)
col_ends += (81, 91)
if 'Moon' in columns:
# table includes Alt, Az, Sun and Moon geometry
names += ('Azimuth', 'Altitude', 'Sun altitude', 'Moon phase',
'Moon distance', 'Moon altitude')
col_starts += tuple((col_ends[-1] + offset for offset in
(1, 8, 13, 19, 26, 32)))
col_ends += tuple((col_ends[-1] + offset for offset in
(7, 12, 18, 25, 31, 36)))
units += ('deg', 'deg', 'deg', None, 'deg', 'deg')
This way I get the results parsed as expected and conversion to arcsec/min works:
113P/Spitaler
Date RA Dec Delta r Elongation Phase V dRA cos(Dec) dDec Azimuth Altitude Sun altitude Moon phase Moon distance Moon altitude
AU AU deg deg mag arcsec / h arcsec / h deg deg deg deg deg
----------------- ---------- --------- ----- ----- ---------- ----- ---- ------------ ---------- ------- -------- ------------ ---------- ------------- -------------
2024 06 06 200000 12 34 22.7 -10 03 31 3.997 4.527 115.5 11.7 23.1 -0.13 2.96 205 31 -10 0.0 112 -4
2024 06 06 203000 12 34 22.7 -10 03 29 3.998 4.527 115.4 11.7 23.1 -0.098 2.97 213 29 -13 0.0 112 -7
2024 06 06 210000 12 34 22.7 -10 03 28 3.998 4.527 115.4 11.7 23.1 -0.059 2.97 220 25 -16 0.0 111 -10
2024 06 06 213000 12 34 22.7 -10 03 26 3.998 4.527 115.4 11.7 23.1 -0.014 2.97 227 22 -18 0.0 111 -12
2024 06 06 220000 12 34 22.7 -10 03 25 3.999 4.527 115.4 11.7 23.1 0.035 2.98 234 18 -20 0.0 111 -14
2024 06 06 223000 12 34 22.7 -10 03 23 3.999 4.528 115.4 11.7 23.1 0.089 2.98 240 13 -21 0.0 111 -15
from astroquery.
cc @mkelley
from astroquery.
Related Issues (20)
- Switch to dict instead of ordered dict in Vizier find_catalogs HOT 3
- Splatalogue.query_lines() seems to be broken? HOT 2
- Slow Simbad.query_objects & IRSA.query_region searches HOT 6
- Use plot directive to generate figures
- modulate verbosity of astroquery.mast.Observations.download_products() HOT 1
- Add support for upload tables for queries in ALMA
- BUG: CI -- no space left on device HOT 2
- ESA Herschel download_data connection error HOT 2
- MAINT: retire/rename exceptions.TimeoutError in favour of requests
- TST: esasky tests take too long time and donwload too much data HOT 8
- BUG: alma test downloads 850+Mb of data HOT 8
- How to download Level 1 ancillary (*cbcd.fits and *cbunc.fits) from IRSA?
- Vizier.query_region() returns incorrect index for some catalog HOT 3
- CI: rerun failing tests at the end
- Bug in rows limitation in module vizier HOT 2
- Unexpected behavior when passing `obj_names` to `SDSS.query_region()`
- Handling No astronomical object found response HOT 5
- IRSA: adding SSA method
- Astroquery.gaia API Error: RA cannot be converted to hour or hourangle. HOT 2
- MAST cloud dataset doesn't show level 3 data products
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astroquery.