|
26 | 26 |
|
27 | 27 |
|
28 | 28 | class EuclidClass(TapPlus):
|
29 |
| - ERROR_MSG_REQUESTED_OBSERVATION_ID = "Missing required argument: 'observation_id'" |
30 |
| - ERROR_MSG_REQUESTED_TILE_ID = "Missing required argument: 'tile_id'" |
31 |
| - ERROR_MSG_REQUESTED_OBSERVATION_ID_AND_TILE_ID = "Incompatible: 'observation_id' and 'tile_id'. Use only one." |
32 |
| - ERROR_MSG_REQUESTED_PRODUCT_TYPE = "Missing required argument: 'product_type'" |
33 |
| - ERROR_MSG_REQUESTED_GENERIC = "Missing required argument" |
34 |
| - ERROR_MSG_REQUESTED_RADIUS = "Radius cannot be greater than 30 arcminutes" |
| 29 | + |
| 30 | + __ERROR_MSG_REQUESTED_OBSERVATION_ID = "Missing required argument: 'observation_id'" |
| 31 | + __ERROR_MSG_REQUESTED_TILE_ID = "Missing required argument: 'tile_id'" |
| 32 | + __ERROR_MSG_REQUESTED_OBSERVATION_ID_AND_TILE_ID = "Incompatible: 'observation_id' and 'tile_id'. Use only one." |
| 33 | + __ERROR_MSG_REQUESTED_PRODUCT_TYPE = "Missing required argument: 'product_type'" |
| 34 | + __ERROR_MSG_REQUESTED_GENERIC = "Missing required argument" |
| 35 | + __ERROR_MSG_REQUESTED_RADIUS = "Radius cannot be greater than 30 arcminutes" |
35 | 36 | EUCLID_MESSAGES = "notification?action=GetNotifications"
|
36 | 37 |
|
37 | 38 | """
|
@@ -672,9 +673,9 @@ def get_observation_products(self, *, id=None, schema="sedm", product_type=None,
|
672 | 673 | """
|
673 | 674 |
|
674 | 675 | if id is None:
|
675 |
| - raise ValueError(self.ERROR_MSG_REQUESTED_OBSERVATION_ID) |
| 676 | + raise ValueError(self.__ERROR_MSG_REQUESTED_OBSERVATION_ID) |
676 | 677 | if product_type is None:
|
677 |
| - raise ValueError(self.ERROR_MSG_REQUESTED_PRODUCT_TYPE) |
| 678 | + raise ValueError(self.__ERROR_MSG_REQUESTED_PRODUCT_TYPE) |
678 | 679 | if product_type not in conf.PRODUCT_TYPES:
|
679 | 680 | raise ValueError(f"Invalid product type {product_type}. Valid values: {conf.PRODUCT_TYPES}")
|
680 | 681 |
|
@@ -764,9 +765,9 @@ def __get_tile_catalogue_list(self, *, tile_index, product_type, verbose=False):
|
764 | 765 | """
|
765 | 766 |
|
766 | 767 | if tile_index is None:
|
767 |
| - raise ValueError(self.ERROR_MSG_REQUESTED_TILE_ID) |
| 768 | + raise ValueError(self.__ERROR_MSG_REQUESTED_TILE_ID) |
768 | 769 | if product_type is None:
|
769 |
| - raise ValueError(self.ERROR_MSG_REQUESTED_PRODUCT_TYPE) |
| 770 | + raise ValueError(self.__ERROR_MSG_REQUESTED_PRODUCT_TYPE) |
770 | 771 |
|
771 | 772 | query = None
|
772 | 773 |
|
@@ -906,13 +907,13 @@ def get_product_list(self, *, observation_id=None, tile_index=None, product_type
|
906 | 907 | The list of products (astropy.table)
|
907 | 908 | """
|
908 | 909 | if product_type is None:
|
909 |
| - raise ValueError(self.ERROR_MSG_REQUESTED_PRODUCT_TYPE) |
| 910 | + raise ValueError(self.__ERROR_MSG_REQUESTED_PRODUCT_TYPE) |
910 | 911 |
|
911 | 912 | if observation_id is not None and tile_index is not None:
|
912 |
| - raise ValueError(self.ERROR_MSG_REQUESTED_OBSERVATION_ID_AND_TILE_ID) |
| 913 | + raise ValueError(self.__ERROR_MSG_REQUESTED_OBSERVATION_ID_AND_TILE_ID) |
913 | 914 |
|
914 | 915 | if observation_id is None and tile_index is None:
|
915 |
| - raise ValueError(self.ERROR_MSG_REQUESTED_OBSERVATION_ID + "; " + self.ERROR_MSG_REQUESTED_TILE_ID) |
| 916 | + raise ValueError(self.__ERROR_MSG_REQUESTED_OBSERVATION_ID + "; " + self.__ERROR_MSG_REQUESTED_TILE_ID) |
916 | 917 |
|
917 | 918 | if tile_index is not None:
|
918 | 919 | return self.__get_tile_catalogue_list(tile_index=tile_index, product_type=product_type, verbose=verbose)
|
@@ -1098,12 +1099,12 @@ def get_cutout(self, *, file_path=None, instrument=None, id=None, coordinate, ra
|
1098 | 1099 | """
|
1099 | 1100 |
|
1100 | 1101 | if file_path is None or instrument is None or id is None or coordinate is None or radius is None:
|
1101 |
| - raise ValueError(self.ERROR_MSG_REQUESTED_GENERIC) |
| 1102 | + raise ValueError(self.__ERROR_MSG_REQUESTED_GENERIC) |
1102 | 1103 |
|
1103 | 1104 | # Parse POS
|
1104 | 1105 | radius_deg = Angle(self.__get_quantity_input(radius, "radius")).to_value(u.deg)
|
1105 | 1106 | if radius_deg > 0.5:
|
1106 |
| - raise ValueError(self.ERROR_MSG_REQUESTED_RADIUS) |
| 1107 | + raise ValueError(self.__ERROR_MSG_REQUESTED_RADIUS) |
1107 | 1108 | coord = commons.parse_coordinates(coordinate)
|
1108 | 1109 | ra_hours, dec = commons.coord_to_radec(coord)
|
1109 | 1110 | ra = ra_hours * 15.0 # Converts to degrees
|
@@ -1159,7 +1160,7 @@ def get_spectrum(self, *, source_id=None, schema='sedm', output_file=None, verbo
|
1159 | 1160 | """
|
1160 | 1161 |
|
1161 | 1162 | if source_id is None or schema is None:
|
1162 |
| - raise ValueError(self.ERROR_MSG_REQUESTED_GENERIC) |
| 1163 | + raise ValueError(self.__ERROR_MSG_REQUESTED_GENERIC) |
1163 | 1164 |
|
1164 | 1165 | params_dict = {'TAPCLIENT': 'ASTROQUERY', 'RETRIEVAL_TYPE': 'SPECTRA'}
|
1165 | 1166 | id_value = """{schema} {source_id}""".format(**{'schema': schema, 'source_id': source_id})
|
|
0 commit comments