@@ -111,7 +111,10 @@ def launch_job(self, query, name=None, output_file=None,
111111 file name where the results are saved if dumpToFile is True.
112112 If this parameter is not provided, the jobid is used instead
113113 output_format : str, optional, default 'votable'
114- results format
114+ results format. Options are:
115+ 'votable': str, binary VOTable format
116+ 'csv': str, comma-separated values format
117+ 'fits': str, FITS format
115118 verbose : bool, optional, default 'False'
116119 flag to display information about the process
117120 dump_to_file : bool, optional, default 'False'
@@ -148,7 +151,10 @@ def launch_job_async(self, query, name=None, output_file=None,
148151 file name where the results are saved if dumpToFile is True.
149152 If this parameter is not provided, the jobid is used instead
150153 output_format : str, optional, default 'votable'
151- results format
154+ results format. Options are:
155+ 'votable': str, binary VOTable format
156+ 'csv': str, comma-separated values format
157+ 'fits': str, FITS format
152158 verbose : bool, optional, default 'False'
153159 flag to display information about the process
154160 dump_to_file : bool, optional, default 'False'
@@ -227,6 +233,7 @@ def list_async_jobs(self, verbose=False):
227233 return self .__jwsttap .list_async_jobs (verbose )
228234
229235 def __query_region (self , coordinate , radius = None , width = None , height = None ,
236+ observation_id = None ,
230237 cal_level = "Top" ,
231238 prod_type = None ,
232239 instrument_name = None ,
@@ -248,6 +255,8 @@ def __query_region(self, coordinate, radius=None, width=None, height=None,
248255 box width
249256 height : astropy.units, required if no 'radius' is provided
250257 box height
258+ observation_id : str, optional, default None
259+ get the observation given by its ID.
251260 cal_level : object, optional, default 'Top'
252261 get the planes with the given calibration level. Options are:
253262 'Top': str, only the planes with the highest calibration level
@@ -260,7 +269,7 @@ def __query_region(self, coordinate, radius=None, width=None, height=None,
260269 'NIRISS', 'NIRSPEC', 'NIRCAM', 'MIRI', 'FGS': str, only results of the given instrument
261270 filter_name : str, optional, default None
262271 get the observations made with the given filter.
263- proposal_id : int , optional, default None
272+ proposal_id : str , optional, default None
264273 get the observations from the given proposal ID.
265274 show_all_columns : bool, optional, default 'False'
266275 flag to show all available columns in the output. Default behaviour is to show the most
@@ -282,6 +291,7 @@ def __query_region(self, coordinate, radius=None, width=None, height=None,
282291 if radius is not None :
283292 job = self .__cone_search (coord , radius ,
284293 only_public = only_public ,
294+ observation_id = observation_id ,
285295 cal_level = cal_level ,
286296 prod_type = prod_type ,
287297 instrument_name = instrument_name ,
@@ -296,7 +306,8 @@ def __query_region(self, coordinate, radius=None, width=None, height=None,
296306 heightQuantity = self .__get_quantity_input (height , "height" )
297307 widthDeg = widthQuantity .to (units .deg )
298308 heightDeg = heightQuantity .to (units .deg )
299-
309+
310+ observationid_condition = self .__get_observationid_condition (observation_id )
300311 cal_level_condition = self .__get_callevel_condition (cal_level )
301312 public_condition = self .__get_public_condition (only_public )
302313 prod_type_condition = self .__get_plane_dataproducttype_condition (prod_type )
@@ -320,6 +331,7 @@ def __query_region(self, coordinate, radius=None, width=None, height=None,
320331 BOX('ICRS'," + str (ra ) + "," + str (dec )+ ", " + \
321332 str (widthDeg .value )+ ", " + \
322333 str (heightDeg .value )+ "))=1 " + \
334+ observationid_condition + \
323335 cal_level_condition + \
324336 public_condition + \
325337 prod_type_condition + \
@@ -335,6 +347,7 @@ def __query_region(self, coordinate, radius=None, width=None, height=None,
335347 return job .get_results ()
336348
337349 def query_region (self , coordinate , radius = None , width = None , height = None ,
350+ observation_id = None ,
338351 cal_level = "Top" ,
339352 prod_type = None ,
340353 instrument_name = None ,
@@ -356,6 +369,8 @@ def query_region(self, coordinate, radius=None, width=None, height=None,
356369 box width
357370 height : astropy.units, required if no 'radius' is provided
358371 box height
372+ observation_id : str, optional, default None
373+ get the observation given by its ID.
359374 cal_level : object, optional, default 'Top'
360375 get the planes with the given calibration level. Options are:
361376 'Top': str, only the planes with the highest calibration level
@@ -368,7 +383,7 @@ def query_region(self, coordinate, radius=None, width=None, height=None,
368383 'NIRISS', 'NIRSPEC', 'NIRCAM', 'MIRI', 'FGS': str, only results of the given instrument
369384 filter_name : str, optional, default None
370385 get the observations made with the given filter.
371- proposal_id : int , optional, default None
386+ proposal_id : str , optional, default None
372387 get the observations from the given proposal ID.
373388 only_public : bool, optional, default 'False'
374389 flag to show only metadata corresponding to public observations
@@ -384,6 +399,7 @@ def query_region(self, coordinate, radius=None, width=None, height=None,
384399 """
385400 return self .__query_region (coordinate , radius , width , height ,
386401 only_public = only_public ,
402+ observation_id = observation_id ,
387403 cal_level = cal_level ,
388404 prod_type = prod_type ,
389405 instrument_name = instrument_name ,
@@ -394,6 +410,7 @@ def query_region(self, coordinate, radius=None, width=None, height=None,
394410
395411 def query_region_async (self , coordinate , radius = None ,
396412 width = None , height = None ,
413+ observation_id = None ,
397414 cal_level = "Top" ,
398415 prod_type = None ,
399416 instrument_name = None ,
@@ -415,6 +432,8 @@ def query_region_async(self, coordinate, radius=None,
415432 box width
416433 height : astropy.units, required if no 'radius' is provided
417434 box height
435+ observation_id : str, optional, default None
436+ get the observation given by its ID.
418437 cal_level : object, optional, default 'Top'
419438 get the planes with the given calibration level. Options are:
420439 'Top': str, only the planes with the highest calibration level
@@ -427,7 +446,7 @@ def query_region_async(self, coordinate, radius=None,
427446 'NIRISS', 'NIRSPEC', 'NIRCAM', 'MIRI', 'FGS': str, only results of the given instrument
428447 filter_name : str, optional, default None
429448 get the observations made with the given filter.
430- proposal_id : int , optional, default None
449+ proposal_id : str , optional, default None
431450 get the observations from the given proposal ID.
432451 only_public : bool, optional, default 'False'
433452 flag to show only metadata corresponding to public observations
@@ -442,6 +461,7 @@ def query_region_async(self, coordinate, radius=None,
442461 The job results (astropy.table).
443462 """
444463 return self .__query_region (coordinate , radius , width , height ,
464+ observation_id = observation_id ,
445465 cal_level = cal_level ,
446466 async_job = True ,
447467 prod_type = prod_type ,
@@ -453,6 +473,7 @@ def query_region_async(self, coordinate, radius=None,
453473 verbose = verbose )
454474
455475 def __cone_search (self , coordinate , radius ,
476+ observation_id = None ,
456477 cal_level = "Top" ,
457478 prod_type = None ,
458479 instrument_name = None ,
@@ -475,6 +496,8 @@ def __cone_search(self, coordinate, radius,
475496 coordinates center point
476497 radius : astropy.units, mandatory
477498 radius
499+ observation_id : str, optional, default None
500+ get the observation given by its ID.
478501 cal_level : object, optional, default 'Top'
479502 get the planes with the given calibration level. Options are:
480503 'Top': str, only the planes with the highest calibration level
@@ -487,7 +510,7 @@ def __cone_search(self, coordinate, radius,
487510 'NIRISS', 'NIRSPEC', 'NIRCAM', 'MIRI', 'FGS': str, only results of the given instrument
488511 filter_name : str, optional, default None
489512 get the observations made with the given filter.
490- proposal_id : int , optional, default None
513+ proposal_id : str , optional, default None
491514 get the observations from the given proposal ID.
492515 only_public : bool, optional, default 'False'
493516 flag to show only metadata corresponding to public observations
@@ -501,7 +524,10 @@ def __cone_search(self, coordinate, radius,
501524 file name where the results are saved if dumpToFile is True.
502525 If this parameter is not provided, the jobid is used instead
503526 output_format : str, optional, default 'votable'
504- results format
527+ results format. Options are:
528+ 'votable': str, binary VOTable format
529+ 'csv': str, comma-separated values format
530+ 'fits': str, FITS format
505531 verbose : bool, optional, default 'False'
506532 flag to display information about the process
507533 dump_to_file : bool, optional, default 'False'
@@ -514,7 +540,8 @@ def __cone_search(self, coordinate, radius,
514540 coord = self .__get_coord_input (coordinate , "coordinate" )
515541 ra_hours , dec = commons .coord_to_radec (coord )
516542 ra = ra_hours * 15.0 # Converts to degrees
517-
543+
544+ observationid_condition = self .__get_observationid_condition (observation_id )
518545 cal_level_condition = self .__get_callevel_condition (cal_level )
519546 public_condition = self .__get_public_condition (only_public )
520547 prod_type_condition = self .__get_plane_dataproducttype_condition (prod_type )
@@ -539,6 +566,7 @@ def __cone_search(self, coordinate, radius,
539566 str (self .JWST_OBSERVATION_TABLE_DEC )+ "),\
540567 CIRCLE('ICRS'," + str (ra )+ "," + str (dec ) + ", " + \
541568 str (radius_deg )+ "))=1" + \
569+ observationid_condition + \
542570 cal_level_condition + \
543571 public_condition + \
544572 prod_type_condition + \
@@ -561,6 +589,7 @@ def __cone_search(self, coordinate, radius,
561589 dump_to_file = dump_to_file )
562590
563591 def cone_search (self , coordinate , radius = None ,
592+ observation_id = None ,
564593 cal_level = "Top" ,
565594 prod_type = None ,
566595 instrument_name = None ,
@@ -581,6 +610,8 @@ def cone_search(self, coordinate, radius=None,
581610 coordinates center point
582611 radius : astropy.units, mandatory
583612 radius
613+ observation_id : str, optional, default None
614+ get the observation given by its ID.
584615 cal_level : object, optional, default 'Top'
585616 get the planes with the given calibration level. Options are:
586617 'Top': str, only the planes with the highest calibration level
@@ -593,7 +624,7 @@ def cone_search(self, coordinate, radius=None,
593624 'NIRISS', 'NIRSPEC', 'NIRCAM', 'MIRI', 'FGS': str, only results of the given instrument
594625 filter_name : str, optional, default None
595626 get the observations made with the given filter.
596- proposal_id : int , optional, default None
627+ proposal_id : str , optional, default None
597628 get the observations from the given proposal ID.
598629 only_public : bool, optional, default 'False'
599630 flag to show only metadata corresponding to public observations
@@ -604,7 +635,10 @@ def cone_search(self, coordinate, radius=None,
604635 file name where the results are saved if dumpToFile is True.
605636 If this parameter is not provided, the jobid is used instead
606637 output_format : str, optional, default 'votable'
607- results format
638+ results format. Options are:
639+ 'votable': str, binary VOTable format
640+ 'csv': str, comma-separated values format
641+ 'fits': str, FITS format
608642 verbose : bool, optional, default 'False'
609643 flag to display information about the process
610644 dump_to_file : bool, optional, default 'False'
@@ -617,6 +651,7 @@ def cone_search(self, coordinate, radius=None,
617651 return self .__cone_search (coordinate ,
618652 radius = radius ,
619653 only_public = only_public ,
654+ observation_id = observation_id ,
620655 cal_level = cal_level ,
621656 prod_type = prod_type ,
622657 instrument_name = instrument_name ,
@@ -631,6 +666,7 @@ def cone_search(self, coordinate, radius=None,
631666 dump_to_file = dump_to_file )
632667
633668 def cone_search_async (self , coordinate , radius = None ,
669+ observation_id = None ,
634670 cal_level = "Top" ,
635671 prod_type = None ,
636672 instrument_name = None ,
@@ -650,6 +686,8 @@ def cone_search_async(self, coordinate, radius=None,
650686 coordinates center point
651687 radius : astropy.units, mandatory
652688 radius
689+ observation_id : str, optional, default None
690+ get the observation given by its ID.
653691 cal_level : object, optional, default 'Top'
654692 get the planes with the given calibration level. Options are:
655693 'Top': str, only the planes with the highest calibration level
@@ -662,7 +700,7 @@ def cone_search_async(self, coordinate, radius=None,
662700 'NIRISS', 'NIRSPEC', 'NIRCAM', 'MIRI', 'FGS': str, only results of the given instrument
663701 filter_name : str, optional, default None
664702 get the observations made with the given filter.
665- proposal_id : int , optional, default None
703+ proposal_id : str , optional, default None
666704 get the observations from the given proposal ID.
667705 only_public : bool, optional, default 'False'
668706 flag to show only metadata corresponding to public observations
@@ -676,7 +714,10 @@ def cone_search_async(self, coordinate, radius=None,
676714 file name where the results are saved if dumpToFile is True.
677715 If this parameter is not provided, the jobid is used instead
678716 output_format : str, optional, default 'votable'
679- results format
717+ results format. Options are:
718+ 'votable': str, binary VOTable format
719+ 'csv': str, comma-separated values format
720+ 'fits': str, FITS format
680721 verbose : bool, optional, default 'False'
681722 flag to display information about the process
682723 dump_to_file : bool, optional, default 'False'
@@ -688,6 +729,7 @@ def cone_search_async(self, coordinate, radius=None,
688729 """
689730 return self .__cone_search (coordinate ,
690731 radius = radius ,
732+ observation_id = observation_id ,
691733 cal_level = cal_level ,
692734 prod_type = prod_type ,
693735 instrument_name = instrument_name ,
@@ -874,6 +916,15 @@ def __get_coord_input(self, value, msg):
874916 else :
875917 return value
876918
919+ def __get_observationid_condition (self , value = None ):
920+ condition = ""
921+ if (value is not None ):
922+ if (not isinstance (value , str )):
923+ raise ValueError ("observation_id must be string" )
924+ else :
925+ condition = " AND observationid LIKE '" + value .lower ()+ "' "
926+ return condition
927+
877928 def __get_callevel_condition (self , cal_level ):
878929 condition = ""
879930 if (cal_level is not None ):
@@ -931,11 +982,11 @@ def __get_filter_name_condition(self, value=None):
931982 def __get_proposal_id_condition (self , value = None ):
932983 condition = ""
933984 if (value is not None ):
934- if (not isinstance (value , int )):
935- raise ValueError ("proposal_id must be an integer " )
985+ if (not isinstance (value , str )):
986+ raise ValueError ("proposal_id must be string " )
936987
937988 else :
938- condition = " AND proposal_id='" + str ( value )+ "' "
989+ condition = " AND proposal_id LIKE '%FILTER=" + value . upper ( )+ "% ' "
939990 return condition
940991
941992 def __get_artifact_producttype_condition (self , product_type = None ):
0 commit comments