@@ -787,7 +787,8 @@ def test_tesscut_get_sectors(self, product):
787
787
788
788
def test_tesscut_get_sectors_mt (self ):
789
789
790
- # Moving target functionality testing (defaults to SPOC)
790
+ # Moving target functionality testing
791
+
791
792
coord = SkyCoord (349.62609 , - 47.12424 , unit = "deg" )
792
793
moving_target_name = 'Eleonora'
793
794
@@ -806,6 +807,7 @@ def test_tesscut_get_sectors_mt(self):
806
807
error_nameresolve = f"Could not resolve { moving_target_name } to a sky position."
807
808
error_mt_coord = "Only one of moving_target and coordinates may be specified."
808
809
error_name_coord = "Only one of objectname and coordinates may be specified."
810
+ error_tica_mt = "Only SPOC is available for moving targets queries."
809
811
810
812
with pytest .raises (InvalidQueryError ) as error_msg :
811
813
mast .Tesscut .get_sectors (moving_target = True )
@@ -830,25 +832,19 @@ def test_tesscut_get_sectors_mt(self):
830
832
moving_target = True )
831
833
assert error_mt_coord in str (error_msg .value )
832
834
833
- # The TICA product option is not available for moving targets. This should default to SPOC.
834
-
835
- moving_target_name = 'Eleonora'
835
+ # The TICA product option is not available for moving targets
836
836
837
- with pytest .warns ( InputWarning ) :
837
+ with pytest .raises ( InvalidQueryError ) as error_msg :
838
838
sector_table = mast .Tesscut .get_sectors (objectname = moving_target_name , product = 'tica' ,
839
839
moving_target = True )
840
- assert isinstance (sector_table , Table )
841
- assert len (sector_table ) >= 1
842
- assert "tess-s00" in sector_table ['sectorName' ][0 ]
843
- assert sector_table ['sector' ][0 ] > 0
844
- assert sector_table ['camera' ][0 ] > 0
845
- assert sector_table ['ccd' ][0 ] > 0
840
+ assert error_msg in str (error_msg .value )
846
841
847
- def test_tesscut_download_cutouts (self , tmpdir ):
842
+ @pytest .mark .parametrize ("product" , ["tica" , "spoc" ])
843
+ def test_tesscut_download_cutouts (self , tmpdir , product ):
848
844
849
845
coord = SkyCoord (349.62609 , - 47.12424 , unit = "deg" )
850
846
851
- manifest = mast .Tesscut .download_cutouts (coordinates = coord , size = 5 , path = str (tmpdir ))
847
+ manifest = mast .Tesscut .download_cutouts (product = product , coordinates = coord , size = 5 , path = str (tmpdir ))
852
848
assert isinstance (manifest , Table )
853
849
assert len (manifest ) >= 1
854
850
assert manifest ["Local Path" ][0 ][- 4 :] == "fits"
@@ -857,34 +853,38 @@ def test_tesscut_download_cutouts(self, tmpdir):
857
853
858
854
coord = SkyCoord (107.18696 , - 70.50919 , unit = "deg" )
859
855
860
- manifest = mast .Tesscut .download_cutouts (coordinates = coord , size = 5 , sector = 1 , path = str (tmpdir ))
856
+ manifest = mast .Tesscut .download_cutouts (product = product , coordinates = coord , size = 5 , sector = 27 , path = str (tmpdir ))
861
857
assert isinstance (manifest , Table )
862
858
assert len (manifest ) == 1
863
859
assert manifest ["Local Path" ][0 ][- 4 :] == "fits"
864
860
assert os .path .isfile (manifest [0 ]['Local Path' ])
865
861
866
- manifest = mast .Tesscut .download_cutouts (coordinates = coord , size = [5 , 7 ]* u .pix , sector = 8 , path = str (tmpdir ))
862
+ manifest = mast .Tesscut .download_cutouts (product = product , coordinates = coord , size = [5 , 7 ]* u .pix , sector = 33 ,
863
+ path = str (tmpdir ))
867
864
assert isinstance (manifest , Table )
868
865
assert len (manifest ) >= 1
869
866
assert manifest ["Local Path" ][0 ][- 4 :] == "fits"
870
867
for row in manifest :
871
868
assert os .path .isfile (row ['Local Path' ])
872
869
873
- manifest = mast .Tesscut .download_cutouts (coordinates = coord , size = 5 , sector = 8 , path = str (tmpdir ), inflate = False )
870
+ manifest = mast .Tesscut .download_cutouts (product = product , coordinates = coord , size = 5 , sector = 33 , path = str (tmpdir ),
871
+ inflate = False )
874
872
assert isinstance (manifest , Table )
875
873
assert len (manifest ) == 1
876
874
assert manifest ["Local Path" ][0 ][- 3 :] == "zip"
877
875
assert os .path .isfile (manifest [0 ]['Local Path' ])
878
876
879
- manifest = mast .Tesscut .download_cutouts (objectname = "TIC 32449963" , size = 5 , path = str (tmpdir ))
877
+ manifest = mast .Tesscut .download_cutouts (product = product , objectname = "TIC 32449963" , size = 5 , path = str (tmpdir ))
880
878
assert isinstance (manifest , Table )
881
879
assert len (manifest ) >= 1
882
880
assert manifest ["Local Path" ][0 ][- 4 :] == "fits"
883
881
for row in manifest :
884
882
assert os .path .isfile (row ['Local Path' ])
885
883
886
- # Moving target functionality testing
884
+ def test_tesscut_download_cutouts_mt ( self , tmpdir ):
887
885
886
+ # Moving target functionality testing
887
+ coord = SkyCoord (349.62609 , - 47.12424 , unit = "deg" )
888
888
moving_target_name = 'Eleonora'
889
889
890
890
manifest = mast .Tesscut .download_cutouts (objectname = moving_target_name ,
@@ -928,34 +928,44 @@ def test_tesscut_download_cutouts(self, tmpdir):
928
928
moving_target = True )
929
929
assert error_mt_coord in str (error_msg .value )
930
930
931
- def test_tesscut_get_cutouts (self , tmpdir ):
931
+ # The TICA product option is not available for moving targets
932
+
933
+ with pytest .raises (InvalidQueryError ) as error_msg :
934
+ mast .Tesscut .download_cutouts (objectname = moving_target_name , product = 'tica' ,
935
+ moving_target = True )
936
+ assert error_msg in str (error_msg .value )
937
+
938
+ @pytest .mark .parametrize ("product" , ["tica" , "spoc" ])
939
+ def test_tesscut_get_cutouts (self , product ):
932
940
933
941
coord = SkyCoord (107.18696 , - 70.50919 , unit = "deg" )
934
942
935
- cutout_hdus_list = mast .Tesscut .get_cutouts (coordinates = coord , size = 5 , sector = 8 , )
943
+ cutout_hdus_list = mast .Tesscut .get_cutouts (product = product , coordinates = coord , size = 5 , sector = 33 )
936
944
assert isinstance (cutout_hdus_list , list )
937
945
assert len (cutout_hdus_list ) >= 1
938
946
assert isinstance (cutout_hdus_list [0 ], fits .HDUList )
939
947
940
- cutout_hdus_list = mast .Tesscut .get_cutouts (coordinates = coord , size = 5 , sector = 1 )
948
+ cutout_hdus_list = mast .Tesscut .get_cutouts (product = product , coordinates = coord , size = 5 , sector = 27 )
941
949
assert isinstance (cutout_hdus_list , list )
942
950
assert len (cutout_hdus_list ) == 1
943
951
assert isinstance (cutout_hdus_list [0 ], fits .HDUList )
944
952
945
953
coord = SkyCoord (349.62609 , - 47.12424 , unit = "deg" )
946
954
947
- cutout_hdus_list = mast .Tesscut .get_cutouts (coordinates = coord , size = [2 , 4 ]* u .arcmin )
955
+ cutout_hdus_list = mast .Tesscut .get_cutouts (product = product , coordinates = coord , size = [2 , 4 ]* u .arcmin )
948
956
assert isinstance (cutout_hdus_list , list )
949
957
assert len (cutout_hdus_list ) >= 1
950
958
assert isinstance (cutout_hdus_list [0 ], fits .HDUList )
951
959
952
- cutout_hdus_list = mast .Tesscut .get_cutouts (objectname = "TIC 32449963" , size = 5 )
960
+ cutout_hdus_list = mast .Tesscut .get_cutouts (product = product , objectname = "TIC 32449963" , size = 5 )
953
961
assert isinstance (cutout_hdus_list , list )
954
962
assert len (cutout_hdus_list ) >= 1
955
963
assert isinstance (cutout_hdus_list [0 ], fits .HDUList )
956
964
957
- # Moving target functionality testing
965
+ def test_tesscut_get_cutouts_mt ( self ):
958
966
967
+ # Moving target functionality testing
968
+ coord = SkyCoord (349.62609 , - 47.12424 , unit = "deg" )
959
969
moving_target_name = 'Eleonora'
960
970
961
971
cutout_hdus_list = mast .Tesscut .get_cutouts (objectname = moving_target_name ,
@@ -974,28 +984,35 @@ def test_tesscut_get_cutouts(self, tmpdir):
974
984
error_name_coord = "Only one of objectname and coordinates may be specified."
975
985
976
986
with pytest .raises (InvalidQueryError ) as error_msg :
977
- mast .Tesscut .download_cutouts (moving_target = True )
987
+ mast .Tesscut .get_cutouts (moving_target = True )
978
988
assert error_noname in str (error_msg .value )
979
989
980
990
with pytest .raises (ResolverError ) as error_msg :
981
- mast .Tesscut .download_cutouts (objectname = moving_target_name )
991
+ mast .Tesscut .get_cutouts (objectname = moving_target_name )
982
992
assert error_nameresolve in str (error_msg .value )
983
993
984
994
with pytest .raises (InvalidQueryError ) as error_msg :
985
- mast .Tesscut .download_cutouts (coordinates = coord , moving_target = True )
995
+ mast .Tesscut .get_cutouts (coordinates = coord , moving_target = True )
986
996
assert error_mt_coord in str (error_msg .value )
987
997
988
998
with pytest .raises (InvalidQueryError ) as error_msg :
989
- mast .Tesscut .download_cutouts (objectname = moving_target_name ,
999
+ mast .Tesscut .get_cutouts (objectname = moving_target_name ,
990
1000
coordinates = coord )
991
1001
assert error_name_coord in str (error_msg .value )
992
1002
993
1003
with pytest .raises (InvalidQueryError ) as error_msg :
994
- mast .Tesscut .download_cutouts (objectname = moving_target_name ,
1004
+ mast .Tesscut .get_cutouts (objectname = moving_target_name ,
995
1005
coordinates = coord ,
996
1006
moving_target = True )
997
1007
assert error_mt_coord in str (error_msg .value )
998
1008
1009
+ # The TICA product option is not available for moving targets
1010
+
1011
+ with pytest .raises (InvalidQueryError ) as error_msg :
1012
+ mast .Tesscut .get_cutouts (objectname = moving_target_name , product = 'tica' ,
1013
+ moving_target = True )
1014
+ assert error_msg in str (error_msg .value )
1015
+
999
1016
###################
1000
1017
# ZcutClass tests #
1001
1018
###################
0 commit comments