views.py
MeasurementQuery
¶
Bases: APIView
Source code in vast_pipeline/views.py
1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 |
|
get(request, ra_deg, dec_deg, image_id, radius_deg)
¶
Return a DS9/JS9 region file for all Measurement objects for a given cone search on an Image. Optionally highlight sources based on a Measurement or Source ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django HTTPRequest. Supports 4 URL GET parameters: - selection_model: either "measurement" or "source" (defaults to "measurement"). - selection_id: the id for the given | required |
ra_deg | float | Cone search RA in decimal degrees. | required |
dec_deg | float | Cone search Dec in decimal degrees. | required |
image_id | int | Primary key (id) of the Image object to search. | required |
radius_deg | float | Cone search radius in decimal degrees. | required |
Returns:
Name | Type | Description |
---|---|---|
FileResponse | FileResponse | Django FileReponse containing a DS9/JS9 region file. |
Source code in vast_pipeline/views.py
1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 |
|
RawImageListSet
¶
Bases: ViewSet
Source code in vast_pipeline/views.py
2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 |
|
gen_title_data_tokens(list_of_paths)
staticmethod
¶
generate a dataframe with extra columns for HTML tags title and data-tokens to generate something like:
this assume a path like this: EPOCH06x/COMBINED/STOKESI_SELAVY/VAST_2118-06A.EPOCH06x.I.selavy.components.txt For the following dataframe columns path EPOCH06x/COMBINED/STOKESI_SELAVY/VAST_2118-06A... title VAST_2118-06A.EPOCH06x.I.selavy.components.txt datatokens EPOCH06x VAST_2118-06A.EPOCH06x.I.selavy.compo...
Source code in vast_pipeline/views.py
2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 |
|
RunViewSet
¶
Bases: ModelViewSet
Source code in vast_pipeline/views.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 |
|
delete(request, pk=None)
¶
Launches the remove pipeline run using a Django Q cluster. Includes a check on ownership or admin status of the user to make sure deletion is allowed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST Framework request object. | required |
pk | int | Run object primary key. Defaults to None. | None |
Raises:
Type | Description |
---|---|
Http404 | if a Source with the given |
Returns:
Name | Type | Description |
---|---|---|
Response | HttpResponseRedirect | Returns to the run index page (list of pipeline runs). |
Source code in vast_pipeline/views.py
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 |
|
genarrow(request, pk=None)
¶
Launches the create arrow files process for a pipeline run using a Django Q cluster. Includes a check on ownership or admin status of the user to make sure the creation is allowed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST Framework request object. | required |
pk | Optional[int] | Run object primary key. Defaults to None. | None |
Raises:
Type | Description |
---|---|
Http404 | if a Source with the given |
Returns:
Name | Type | Description |
---|---|---|
Response | HttpResponseRedirect | Returns to the orignal request page (the pipeline run detail). |
Source code in vast_pipeline/views.py
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 |
|
restore(request, pk=None)
¶
Launches a restore pipeline run using a Django Q cluster. Includes a check on ownership or admin status of the user to make sure processing is allowed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST Framework request object. | required |
pk | Optional[int] | Run object primary key. Defaults to None. | None |
Raises:
Type | Description |
---|---|
Http404 | if a Source with the given |
Returns:
Name | Type | Description |
---|---|---|
Response | HttpResponseRedirect | Returns to the orignal request page (the pipeline run detail). |
Source code in vast_pipeline/views.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
|
run(request, pk=None)
¶
Launches a pipeline run using a Django Q cluster. Includes a check on ownership or admin stataus of the user to make sure processing is allowed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST Framework request object. | required |
pk | Optional[int] | Run object primary key. Defaults to None. | None |
Raises:
Type | Description |
---|---|
Http404 | if a Source with the given |
Returns:
Name | Type | Description |
---|---|---|
Response | HttpResponseRedirect | Returns to the orignal request page (the pipeline run detail). |
Source code in vast_pipeline/views.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
|
SourcePlotsSet
¶
Bases: ViewSet
Source code in vast_pipeline/views.py
2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 |
|
etavplot(request)
¶
Create the eta-V plot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST Framework request object. | required |
Raises:
Type | Description |
---|---|
Http404 | if no sources are found. |
Returns:
Name | Type | Description |
---|---|---|
Response | Response | Django REST Framework response object containing the Bokeh plot in JSON format to be embedded in the HTML template. |
Source code in vast_pipeline/views.py
2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 |
|
lightcurve(request, pk=None)
¶
Create lightcurve and 2-epoch metric graph plots for a source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST Framework request object. | required |
pk | int | Source object primary key. Defaults to None. | None |
Raises:
Type | Description |
---|---|
Http404 | if a Source with the given |
Returns:
Name | Type | Description |
---|---|---|
Response | Response | Django REST Framework response object containing the Bokeh plot in JSON format to be embedded in the HTML template. |
Source code in vast_pipeline/views.py
2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 |
|
SourceViewSet
¶
Bases: ModelViewSet
Source code in vast_pipeline/views.py
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 |
|
list(request, *args, **kwargs)
¶
Override the DRF ModelViewSet.list function to store the source ID order in the user session to retain the source order for source detail view next and previous button links. Then, call the original list function.
Source code in vast_pipeline/views.py
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 |
|
UtilitiesSet
¶
Bases: ViewSet
Source code in vast_pipeline/views.py
2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 |
|
coordinate_validator(request)
¶
Validate a coordinate string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST framework Request object with GET parameters: - coord (str): the coordinate string to validate. - frame (str): the frame for the given coordinate string e.g. icrs, galactic. | required |
Returns:
Type | Description |
---|---|
Response | A Django REST framework Response. Will return JSON with status code: - 400 if the query params fail validation, i.e. if a frame unknown to Astropy is given, or the coordinate string fails to parse. Error messages are returned as an array of strings under the relevant query parameter key. e.g. {"coord": ["This field may not be blank."]}. - 200 if the coordinate string successfully validates. No other data is returned. |
Source code in vast_pipeline/views.py
2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 |
|
external_search(request)
¶
Perform a cone search with external providers (e.g. SIMBAD, NED, TNS) and return the combined results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST Framework Request object get GET parameters: - coord (str): the coordinate string to validate. Interpreted by | required |
Raises:
Type | Description |
---|---|
ValidationError | if either the coordinate or radius parameters cannot be interpreted by |
Returns:
Type | Description |
---|---|
Response | A Django REST framework Response containing result records as a list under the data object key. Each record contains the properties: - object_name: the name of the astronomical object. - database: the source of the result, e.g. SIMBAD or NED. - separation_arcsec: separation to the query coordinate in arcsec. - otype: object type. - otype_long: long form of the object type (only available for SIMBAD). - ra_hms: RA coordinate string in |
Source code in vast_pipeline/views.py
2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 |
|
sesame_search(request)
¶
Query the Sesame name resolver service and return a coordinate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST framework Request object with GET parameters: - object_name (str): Object name to query. - service (str, optional): Sesame service to query (all, simbad, ned, vizier). Defaults to "all". | required |
Returns:
Type | Description |
---|---|
Response | A Django REST framework Response. Will return JSON with status code: - 400 if the query params fail validation (i.e. if an invalid Sesame service or no object name is provided) or if the name resolution fails. Error messages are returned as an array of strings under the relevant query parameter key. e.g. {"object_name": ["This field may not be blank."]}. - 200 if successful. Response data contains the passed in query parameters and the resolved coordinate as a sexagesimal string with units hourangle, deg under the key |
Source code in vast_pipeline/views.py
2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 |
|
SourceEtaVPlot(request)
¶
The view for the main eta-V plot page.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST Framework request object. | required |
Returns:
Type | Description |
---|---|
Response | The response for the main eta-V page. |
Source code in vast_pipeline/views.py
1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 |
|
SourceEtaVPlotUpdate(request, pk)
¶
The view to perform the update on the eta-V plot page.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request | Request | Django REST Framework request object. | required |
pk | int | Source object primary key. Defaults to None. | required |
Raises:
Type | Description |
---|---|
Http404 | if a Source with the given |
Returns:
Type | Description |
---|---|
Response | The response for the update page. |
Source code in vast_pipeline/views.py
1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 |
|