Skip to content
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

MAINT: Fixing HEASARC and IMCCE docs issue #2652

Merged
merged 2 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 23 additions & 13 deletions docs/heasarc/heasarc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ It is also possible to select time range:
NAME RA DEC ... ISSUE_FLAG SEARCH_OFFSET_
deg deg ...
-------------------------------------------------- -------- ------ ... ---------- -------------------------------------
3C273 187.2473 2.0362 ... 0 2.077 (187.2779220931,2.0523864229)\n
3C273 187.2473 2.0362 ... 0 2.077 (187.2779220936,2.0523864234)\n
nkphysics marked this conversation as resolved.
Show resolved Hide resolved


Getting list of available missions
Expand Down Expand Up @@ -241,9 +241,9 @@ mission table.
Using alternative HEASARC servers
---------------------------------

It is possible to set alternative locations for HEASARC server. One such location
It is possible to set alternative locations for HEASARC servers. One such location
is hosted by `INTEGRAL Science Data Center <https://www.isdc.unige.ch/>`_, and has further
tables listing most recent INTEGRAL data.
tables listing the most recent INTEGRAL data.

.. doctest-remote-data::

Expand All @@ -261,18 +261,28 @@ tables listing most recent INTEGRAL data.
INTEGRAL-REV3 integral_rev3_scw SCW - Science Window Data
>>>
>>> table = heasarc.query_object('Crab', mission='integral_rev3_scw',
... radius='361 degree', time="2021-02-01 .. 2030-12-01",
... radius='361 degree', time="2022-12-01 .. 2022-12-31",
... sortvar='START_DATE', resultmax=100000)
>>> table.pprint()
SCW_ID SCW_VER SCW_TYPE RA_X ... GOOD_OMC DSIZE _SEARCH_OFFSET
...
------------ ------- -------- ---------- ... -------- --------- --------------
232600870020 001 POINTING 48.302208 ... 370 20242432 2004.207
232600870031 001 SLEW 47.182667 ... 0 1380352 2328.123
232600880010 001 POINTING 46.372791 ... 0 1572864 2730.070
232600880021 001 SLEW 46.357828 ... 0 917504 2729.667
232600890010 001 POINTING 46.323544 ... 0 2244608 2728.770
...
SCW_ID SCW_VER SCW_TYPE ... GOOD_OMC DSIZE SEARCH_OFFSET_
------------ ------- -------- ... -------- --------- -----------------
258300400010 001 POINTING ... 0 123494400 5199.027 (CRAB)\n
258400320021 001 SLEW ... 0 5799936 5082.095 (CRAB)\n
258400260021 001 SLEW ... 0 5791744 5104.388 (CRAB)\n
258400350010 001 POINTING ... 0 123146240 5167.027 (CRAB)\n
258700350021 001 SLEW ... 0 5750784 5120.836 (CRAB)\n
258400330010 001 POINTING ... 0 123179008 5067.991 (CRAB)\n
258400260010 001 POINTING ... 0 123371520 5093.007 (CRAB)\n
... ... ... ... ... ... ...
258400270021 001 SLEW ... 0 126386176 5114.308 (CRAB)\n
258400270010 001 POINTING ... 0 1200128 5113.839 (CRAB)\n
258700360010 001 POINTING ... 0 122130432 5136.165 (CRAB)\n
258200770010 001 POINTING ... 0 1490944 4184.684 (CRAB)\n
258200770021 001 SLEW ... 0 962560 4184.587 (CRAB)\n
258200780010 001 POINTING ... 0 1585152 4184.378 (CRAB)\n
258700340021 001 SLEW ... 0 5779456 5181.635 (CRAB)\n
Length = 1601 rows


Reference/API
=============
Expand Down
61 changes: 26 additions & 35 deletions docs/imcce/imcce.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,11 @@ looks like this:
>>> import astropy.units as u
>>> field = SkyCoord(0*u.deg, 0*u.deg)
>>> epoch = Time('2019-05-29 21:42', format='iso')
>>> Skybot.cone_search(field, 5*u.arcmin, epoch)
<QTable length=12>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example seems to be very dependent on the versions (e.g. np 1.23 vs 1.24), so a bit more robust solution will be needed here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be worth an IGNORE_INPUT then?
Like with HEASARC I just got too used to having broken up tests and just spotted 1 issue in the action logs so just handled the one.
I have fixes I can commit for imccre using np 1.24, but I'll need to mess with 1.23 if necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the cone search with np 1.23 and 1.24 versions, so I'll commit and keep working through the failures with imcce.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so after looking at a few of the other docs, a common trend I'm seeing to workaround this is using pprint.
So in this specific case it might look something like this...

>>> search = Skybot.cone_search(field, 5*u.arcmin, epoch)
>>> search.pprint(max_width=100)
Number    Name             RA                   DEC          ...      vy          vz       epoch  
                          deg                   deg          ...    AU / d      AU / d       d    
------ ---------- -------------------- --------------------- ... ----------- ----------- ---------
    --  2012 BO42 0.019414999999999998            -0.0128425 ... 0.009345668 0.005003011 2458630.0
516566  2007 DH36 0.005546249999999999  0.023103333333333333 ...  0.00855646 0.002875928 2458630.0
    --  2019 SS82    359.9931945833333 -0.028837777777777778 ... 0.009809784 0.004636687 2458630.0
163149 2002 CV106   359.98692374999996  -0.06923777777777777 ... 0.009078104  0.00267749 2458630.0

Probably not the best workaround, but just an idea for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using pprint sounds OK to me, but if I can nitpick call it results, not search. (And I would still expect it may be version sensitive given the primary issue was with the number of rows returned)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output can just be restricted with say...

>>> results  = Skybot.cone_search(field, 5*u.arcmin, epoch)
>>> results[:4]pprint(max_width=100)

I only use 4 here out of convenience.
Similar row output restrictions will need to be made with the other examples for imcce.
For example with Miride the example could be changed so that it will query ephemerides for asteroid
Pallas over an entire month, or maybe week (rather than year) with a time step of 1 day.
And the output can be restricted to the corresponding scale.

Although the version sensitivity seems to be a broader issue with the docs.
For example from the docs for eso:

eso.ROW_LIMIT = -1   # Return all results
table = eso.query_main(column_filters={'instrument': 'APICAM', 'filter_path': 'LUMINANCE',
                                       'stime':'2019-04-26', 'etime':'2019-04-27'}, cache=False)
print(len(table))
207
print(table.columns)
<TableColumns names=('OBJECT','RA','DEC','Program_ID','Instrument','Category','Type','Mode','Dataset ID','Release_Date','TPL ID','TPL START','Exptime','Exposure','filter_lambda_min','filter_lambda_max','MJD-OBS','Airmass','DIMM Seeing at Start')>
table.pprint(max_width=100)
 OBJECT      RA         DEC      Program_ID  ...   MJD-OBS    Airmass DIMM Seeing at Start
------- ----------- ----------- ------------ ... ------------ ------- --------------------
ALL SKY 09:18:37.39 -24:32:32.7 60.A-9008(A) ... 58599.987766     1.0                  N/A
ALL SKY 09:21:07.68 -24:32:30.1 60.A-9008(A) ... 58599.989502     1.0                  N/A
ALL SKY 09:23:38.98 -24:32:27.5 60.A-9008(A) ...  58599.99125     1.0                  N/A
ALL SKY 09:26:10.28 -24:32:24.9 60.A-9008(A) ... 58599.992998     1.0                  N/A
ALL SKY 09:28:40.58 -24:32:22.4 60.A-9008(A) ... 58599.994734     1.0                  N/A
ALL SKY 09:31:43.93 -24:32:19.4 60.A-9008(A) ... 58599.996852     1.0                  N/A
ALL SKY 09:34:15.23 -24:32:17.0 60.A-9008(A) ...   58599.9986     1.0                  N/A
ALL SKY 09:36:47.53 -24:32:14.5 60.A-9008(A) ... 58600.000359     1.0                  N/A
ALL SKY 09:39:18.82 -24:32:12.2 60.A-9008(A) ... 58600.002106     1.0                  N/A
ALL SKY 09:41:49.11 -24:32:09.9 60.A-9008(A) ... 58600.003843     1.0                  N/A
    ...         ...         ...          ... ...          ...     ...                  ...
ALL SKY 19:07:39.21 -24:39:35.1 60.A-9008(A) ... 58600.395914     1.0                  N/A
ALL SKY 19:10:11.68 -24:39:39.1 60.A-9008(A) ... 58600.397674     1.0                  N/A
ALL SKY 19:12:44.15 -24:39:43.2 60.A-9008(A) ... 58600.399433     1.0                  N/A
ALL SKY 19:15:15.62 -24:39:47.1 60.A-9008(A) ... 58600.401181     1.0                  N/A
ALL SKY 19:17:46.09 -24:39:51.1 60.A-9008(A) ... 58600.402917     1.0                  N/A
ALL SKY 19:20:46.65 -24:39:55.8 60.A-9008(A) ...    58600.405     1.0                  N/A
ALL SKY 19:23:18.12 -24:39:59.7 60.A-9008(A) ... 58600.406748     1.0                  N/A
ALL SKY 19:25:51.60 -24:40:03.7 60.A-9008(A) ... 58600.408519     1.0                  N/A
ALL SKY 19:28:22.08 -24:40:07.6 60.A-9008(A) ... 58600.410255     1.0                  N/A
ALL SKY 19:30:52.55 -24:40:11.4 60.A-9008(A) ... 58600.411991     1.0                  N/A
Length = 207 rows

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cut the outputs with ellipsis rather than in the command itself. We tend to keep 3-5 first and last lines.

As for version-dependent stuff, I would just avoid changing the outputs for now, and would rather try to find the underlying reason for the changes.

Number Name RA ... vy vz epoch
deg ... AU / d AU / d d
int64 str10 float64 ... float64 float64 float64
>>> results = Skybot.cone_search(field, 5*u.arcmin, epoch)
>>> results.pprint(max_width=80)
Number Name RA ... vy vz epoch
deg ... AU / d AU / d d
------ ---------- -------------------- ... ----------- ----------- ---------
-- -- 0.0 ... 0.002324846 0.000311389 2458630.0
-- -- 0.0 ... ——— ——— 2458630.0
-- -- 0.0 ... ——— ——— 2458630.0
-- -- 0.0 ... ——— ——— 2458630.0
-- -- 0.0 ... ——— ——— 2458630.0
-- -- 0.0 ... ——— ——— 2458630.0
-- -- 0.0 ... ——— ——— 2458630.0
-- -- 0.0 ... ——— ——— 2458630.0
-- 2012 BO42 0.019414999999999998 ... 0.009345668 0.005003011 2458630.0
516566 2007 DH36 0.005546249999999999 ... 0.00855646 0.002875928 2458630.0
-- 2019 SS82 359.9931945833333 ... 0.009809784 0.004636687 2458630.0
Expand Down Expand Up @@ -194,30 +185,30 @@ Pallas over an entire year with a time step of 1 day:
>>> Miriade.get_ephemerides('Pallas', epoch='2019-01-01',
... epoch_step='1d', epoch_nsteps=365)
<Table length=365>
target epoch RA ... DEC_rate delta_rate
d deg ... arcsec / min km / s
str20 float64 float64 ... float64 float64
target epoch RA ... DEC_rate delta_rate
d deg ... arcsec / min km / s
str20 float64 float64 ... float64 float64
------ -------------------- ------------------ ... ------------ ------------
Pallas 2458484.5 200.58650791666665 ... 0.15854 -19.3678463
Pallas 2458485.5 200.92693791666662 ... 0.16727 -19.4137948
Pallas 2458486.5 201.26410874999996 ... 0.17613 -19.455269
Pallas 2458487.5 201.59795291666666 ... 0.18511 -19.4921153
Pallas 2458488.5 201.92840374999994 ... 0.19421 -19.5242013
Pallas 2458489.5 202.25539416666663 ... 0.20344 -19.5514142
Pallas 2458490.5 202.57885791666664 ... 0.21278 -19.5736602
Pallas 2458491.5 202.8987283333333 ... 0.22224 -19.5908624
Pallas 2458492.5 203.21493999999996 ... 0.23181 -19.6029579
Pallas 2458484.5 200.58650874999998 ... 0.15854 -19.3678463
Pallas 2458485.5 200.92693874999998 ... 0.16727 -19.4137948
Pallas 2458486.5 201.2641095833333 ... 0.17613 -19.4552689
Pallas 2458487.5 201.59795375 ... 0.18511 -19.4921153
Pallas 2458488.5 201.9284045833333 ... 0.19421 -19.5242013
Pallas 2458489.5 202.25539499999996 ... 0.20344 -19.5514142
Pallas 2458490.5 202.57885874999997 ... 0.21278 -19.5736602
Pallas 2458491.5 202.89872916666664 ... 0.22224 -19.5908624
Pallas 2458492.5 203.21494124999998 ... 0.23181 -19.6029579
... ... ... ... ... ...
Pallas 2458839.5 259.61455249999995 ... 0.0069182 -1.4120216
Pallas 2458840.5 259.994445 ... 0.011429 -1.632143
Pallas 2458841.5 260.373805 ... 0.015948 -1.8522401
Pallas 2458842.5 260.75260374999993 ... 0.020475 -2.0721425
Pallas 2458843.5 261.13081041666663 ... 0.025007 -2.2916831
Pallas 2458844.5 261.50839541666664 ... 0.029542 -2.5107109
Pallas 2458845.5 261.8853291666666 ... 0.034077 -2.7290991
Pallas 2458846.5 262.2615820833333 ... 0.038612 -2.9467491
Pallas 2458847.5 262.63712666666663 ... 0.043144 -3.1635884
Pallas 2458848.5 263.0119345833333 ... 0.047672 -3.3795666
Pallas 2458839.5 259.6145529166667 ... 0.0069182 -1.4120214
Pallas 2458840.5 259.9944454166666 ... 0.011429 -1.6321428
Pallas 2458841.5 260.37380541666664 ... 0.015948 -1.85224
Pallas 2458842.5 260.75260416666663 ... 0.020475 -2.0721423
Pallas 2458843.5 261.13081083333327 ... 0.025007 -2.2916829
Pallas 2458844.5 261.5083958333333 ... 0.029542 -2.5107107
Pallas 2458845.5 261.88532958333326 ... 0.034077 -2.729099
Pallas 2458846.5 262.2615825 ... 0.038612 -2.946749
Pallas 2458847.5 262.63712708333327 ... 0.043144 -3.1635882
Pallas 2458848.5 263.011935 ... 0.047672 -3.3795665


The observer location is defined through the ``location`` keyword,
Expand Down