diff --git a/README.md b/README.md index fbd5b3935bfea19ececea4cffd62669737a98997..d4714361543d4c62fb22b71c22a81892d62a2de1 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,12 @@ ### localhost (laptop) * http://localhost:8000/adex-fastapi/skyviews/ * http://localhost:8000/adex-fastapi/skyviews_rectangle/?ra_min=40&ra_max=50&dec_min=25&dec_max=35&limit=1000 + * http://localhost:8000/adex-fastapi/skyviews_dataproducts/?ra_min=40&ra_max=50&dec_min=25&dec_max=35&limit=1000&collections=apertif-imaging&levels=2 + +#### filters + * http://localhost:8000/adex-fastapi/skyviews_dataproducts/?ra_min=40&ra_max=50&dec_min=25&dec_max=35&limit=1000&collections=apertif-imaging&levels=2 +#### API documentation * http://localhost:8000/adex-fastapi/docs * http://localhost:8000/adex-fastapi/redoc @@ -19,8 +24,12 @@ ### SURF Research Cloud (dev environment) * frontend app for testing: http://145.38.187.31/aladin-testbed/ + * http://145.38.187.31/adex-fastapi/skyviews/ * http://145.38.187.31/adex-fastapi/skyviews_rectangle/?ra_min=40&ra_max=50&dec_min=25&dec_max=35&limit=1000 + +#### filters + * http://145.38.187.31/adex-fastapi/skyviews_dataproducts/?ra_min=40&ra_max=50&dec_min=25&dec_max=35&limit=1000&collections=apertif-imaging&levels=2 ## data procedures (rough) * [dump/load a copy of the alta database](https://web-of-wyrd.nl/myworkwiki/doku.php?id=alta_runtime&s[]=dump#qhow_do_i_dump_and_load_a_copy_of_the_production_database_with_postgres_into_a_dev_or_vm_environment) diff --git a/dev_scripts/convert_alta_to_adex_cache.py b/dev_scripts/convert_alta_to_adex_cache.py index fe2e8aa2beca7e6fccce8002218fef5518ad9a4a..607cf1f79938da4390d46df0137b4c95569ff474 100644 --- a/dev_scripts/convert_alta_to_adex_cache.py +++ b/dev_scripts/convert_alta_to_adex_cache.py @@ -66,7 +66,7 @@ def convert_dataproduct(row): beam = calc_beam(name) - record_to_insert = (name, observation, beam, ra, dec, collection, level, dt, dst, access_url) + record_to_insert = (name, pid, observation, beam, ra, dec, collection, level, dt, dst, access_url) return record_to_insert @@ -110,7 +110,6 @@ def do_convert(source, target): print('inserting records into adex_cache...') insert_count = 0 for row in rows: - name, pid, access_url,ra,dec,dt,dst,observation = row record_to_insert = convert_dataproduct(row) if not record_to_insert: continue diff --git a/routers/skyviews.py b/routers/skyviews.py index 9f9e368c9fe41900b84005bdd528310dcfc3ec40..2725040c4d94c06fb89786671e6f4f1b40919d82 100644 --- a/routers/skyviews.py +++ b/routers/skyviews.py @@ -70,12 +70,16 @@ async def get_skyviews_dataproducts(db: Session = Depends(get_db), try: dp_types_list = dp_types.split(',') + if 'all' in dp_types_list: + dp_types_list = get_all_dp_types() except: # if no dp_types are given, assume 'image' (better than nothing) dp_types_list = get_all_dp_types() try: dp_subtypes_list = dp_subtypes.split(',') + if 'all' in dp_subtypes_list: + dp_subtypes_list = get_all_dp_subtypes() except: # if no dp_types are given, assume 'image' (better than nothing) dp_subtypes_list = get_all_dp_subtypes() @@ -86,6 +90,7 @@ async def get_skyviews_dataproducts(db: Session = Depends(get_db), beams=beams_list, levels=levels_list, dp_types=dp_types_list, - dp_subtypes=dp_subtypes_list, limit=limit) + dp_subtypes=dp_subtypes_list, + limit=limit) return items