Skip to content

Commit 0e47ac0

Browse files
committed
Updated documentation to include commentary on TESSCut request timeouts
1 parent c23a517 commit 0e47ac0

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

astroquery/mast/cutouts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _parse_cutout_size(size, timeout_add=None, mission=None):
8282

8383
# Based on the literature, TESS resolution is approx. 21 arcseconds per pixel.
8484
# We will convert the recommended upper limit for a dimension from pixels
85-
# to degrees.
85+
# to the unit being passed.
8686
unit = size[0].unit
8787
upper_limit = (30 * 21*u.arcsec).to(unit).value
8888
limit_reached = size[0].value > upper_limit or size[1].value > upper_limit

docs/mast/mast.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,40 @@ and because the TICA products are not available for sectors 1-26, we request cut
10421042
----------------------------------------------------------
10431043
./tica-s0027-4-2_107.186960_-70.509190_21x14_astrocut.fits
10441044

1045+
It is important to be mindful of the requested cutout size when using either `~astroquery.mast.TesscutClass.download_cutouts` or `~astroquery.mast.TesscutClass.get_cutouts`,
1046+
as it will affect the time it takes to retrieve your cutouts. By default, any request that ``astroquery.mast`` makes to an
1047+
API is capped at 600 seconds. Queries that take longer than this will yield a timeout error.
1048+
The recommended cutout size for TESSCut is no larger than 30 pixels in either the X or Y
1049+
direction, so a user will be met with a warning message if the input cutout size exceeds
1050+
those limits. Below is an example of a request using `~astroquery.mast.TesscutClass.get_cutouts` for cutouts of size 0.2 x 0.2 degrees-squared, which is
1051+
around 34 x 34 pixels-squared.
1052+
1053+
.. doctest-remote-data::
1054+
1055+
>>> import astropy.units as u
1056+
>>> from astroquery.mast import Tesscut
1057+
>>> from astropy.coordinates import SkyCoord
1058+
...
1059+
>>> cutout_coord = SkyCoord(107.18696, -70.50919, unit="deg")
1060+
>>> hdulist = Tesscut.get_cutouts(coordinates=cutout_coord, size=0.2*u.deg)
1061+
WARNING: InputWarning: You have selected a large cutout size that may result in a timeout error.
1062+
We suggest limiting the size of your requested cutout, or changing the request timeout limit from
1063+
its default 600 seconds to something higher, using the timeout_add argument. [astroquery.mast.cutouts]
1064+
1065+
At this point, users may choose to decrease their cutout size or extend the request timeout limit from
1066+
600 seconds to something longer. Using the example above, we will use the ``timeout_add`` argument to extend
1067+
the request timeout limit from 600 seconds to 2600 seconds, or approximately 43 minutes.
1068+
1069+
.. doctest-remote-data::
1070+
1071+
>>> import astropy.units as u
1072+
>>> from astroquery.mast import Tesscut
1073+
>>> from astropy.coordinates import SkyCoord
1074+
...
1075+
>>> cutout_coord = SkyCoord(107.18696, -70.50919, unit="deg")
1076+
>>> hdulist = Tesscut.get_cutouts(coordinates=cutout_coord, size=0.2*u.deg, timeout_add=2000)
1077+
INFO: Request timeout upper limit is being changed to 2600 seconds. [astroquery.mast.cutouts]
1078+
10451079
Sector information
10461080
------------------
10471081

0 commit comments

Comments
 (0)