diff --git a/README.md b/README.md index 4f8ab9b86967b36d8905a6a8214bf210e1ff15d6..229bac8422d60fc13140179f758f5d3e428d1226 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,11 @@ ## Development ### localhost (laptop) * http://localhost:8000/adex-fastapi/skyviews/ - * http://localhost:8000/adex-fastapi/skyviews_rectangle/?ra_min=70&ra_max=90&dec_min=15&dec_max=17&limit=10000 + * http://localhost:8000/adex-fastapi/skyviews_rectangle/?ra_min=40&ra_max=50&dec_min=25&dec_max=35&limit=1000 ### sdc-dev (test environment) * https://sdc-dev.astron.nl/adex-fastapi/skyviews/ + * https://sdc-dev.astron.nl/adex-fastapi/skyviews_rectangle/?ra_min=40&ra_max=50&dec_min=25&dec_max=35&limit=1000 ## 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/routers/skyviews.py b/routers/skyviews.py index e4ca893b80ceff8a7b1c1c7fcb3f2ce386cbf079..29b7abc1f086133d5b1942ce8169f5aaf77d53bc 100644 --- a/routers/skyviews.py +++ b/routers/skyviews.py @@ -5,7 +5,7 @@ from sqlalchemy.orm import Session from database import crud, models, schemas from database.database import SessionLocal, engine -router = APIRouter(tags=["skyviews"],) +router = APIRouter(prefix="/adex-fastapi", tags=["skyviews"],) # Dependency def get_db(): @@ -18,11 +18,12 @@ def get_db(): # http://127.0.0.1:8000/skyviews/ # http://127.0.0.1:8000/skyviews/?skip=100&limit=100 -@router.get("/adex-fastapi/skyviews/", tags=["skyviews"], response_model=List[schemas.SkyView]) +@router.get("/skyviews/", tags=["skyviews"], response_model=List[schemas.SkyView]) async def get_skyviews(skip: int = 0, limit: int = 1000, db: Session = Depends(get_db)): items = crud.get_skyviews(db, skip=skip, limit=limit) return items +# http://localhost:8000/adex-fastapi/skyviews_rectangle/?ra_min=40&ra_max=50&dec_min=25&dec_max=35&limit=1000 @router.get("/skyviews_rectangle/", tags=["skyviews"], response_model=List[schemas.SkyView]) async def get_skyviews_rectangle(ra_min: float = 0.0, ra_max: float = 1.0, dec_min: float = 0.0, dec_max: float = 1.0, diff --git a/utils/convert_alta_to_adex_cache.py b/utils/convert_alta_to_adex_cache.py index 9afeb4f49071e13e6d3ba9ba9aab628f82a8cb27..4fcd49bc42b9ff5b2db97ffe989d93729b1b6556 100644 --- a/utils/convert_alta_to_adex_cache.py +++ b/utils/convert_alta_to_adex_cache.py @@ -58,6 +58,7 @@ def do_convert(source, target): record_to_insert = (observation, observation, ra, dec, "alta",0, dt,dst, access_url) target_cursor.execute(insert_into_skyview,record_to_insert) target_connection.commit() + except Error as e: print(e)