Fritz: SkyPortal API (0.9.dev0+git20220817.c23e88f)

Download OpenAPI specification:Download

SkyPortal provides an API to access most of its underlying functionality. To use it, you will need an API token. This can be generated via the web application from your profile page or, if you are an admin, you may use the system provisioned token stored inside of .tokens.yaml.

Accessing the SkyPortal API

Once you have a token, you may access SkyPortal programmatically as follows.

Python

import requests

token = 'ea70a5f0-b321-43c6-96a1-b2de225e0339'

def api(method, endpoint, data=None):
    headers = {'Authorization': f'token {token}'}
    response = requests.request(method, endpoint, json=data, headers=headers)
    return response

response = api('GET', 'http://localhost:5000/api/sysinfo')

print(f'HTTP code: {response.status_code}, {response.reason}')
if response.status_code in (200, 400):
    print(f'JSON response: {response.json()}')

Command line (curl)

curl -s -H 'Authorization: token ea70a5f0-b321-43c6-96a1-b2de225e0339' http://localhost:5000/api/sysinfo

Request parameters

There are two ways to pass information along with a request: path and body parameters.

Path parameters

Path parameters (also called query or URL parameters) are embedded in the URL called. For example, you can specify numPerPage or pageNumber path parameters when calling /api/candidates as follows:

curl -s -H 'Authorization: token ea70a5f0-b321-43c6-96a1-b2de225e0339' \
     http://localhost:5000/api/candidates?numPerPage=100&pageNumber=1

When using Python's requests library, a dictionary of path parameters can be passed in via the params keyword argument:

token = 'ea70a5f0-b321-43c6-96a1-b2de225e0339'

response = requests.get(
    "http://localhost:5000/api/sources",
    params={"includeComments": True, "includeThumbnails": False},
    headers={'Authorization': f'token {token}'},
)

Body parameters

Request body parameters (or simply: the body of the request) contains data uploaded to a specific endpoint. These are the parameters listed under REQUEST BODY SCHEMA: application/json in the API docs.

When using Python's requests library, body parameters are specified using the json keyword argument:

token = "abc"
response = requests.post(
    "http://localhost:5000/api/sources",
    json={
        "id": "14gqr",
        "ra": 353.36647,
        "dec": 33.646149,
        "group_ids": [52, 97],
    },
    headers={"Authorization": f"token {token}"},
)

Response

In the above examples, the SkyPortal server is located at http://localhost:5000. In case of success, the HTTP response is 200:


HTTP code: 200, OK
JSON response: {'status': 'success', 'data': {}, 'version': '0.9.dev0+git20200819.84c453a'}

On failure, it is 400; the JSON response has status="error" with the reason for the failure given in message:

{
  "status": "error",
  "message": "Invalid API endpoint",
  "data": {},
  "version": "0.9.1"
}

Pagination

Several API endpoints (notably the sources and candidates APIs) enforce pagination to limit the number of records that can be fetched per request. These APIs expose parameters that facilitate pagination (see the various API docs for details). A sample pagination script is included here:

import requests
import time


base_url = "https://fritz.science/api/sources"
token = "your_token_id_here"
group_ids = [4, 71]  # If applicable
all_sources = []
num_per_page = 500
page = 1
total_matches = None
retry_attempts = 0
max_retry_attempts = 10

while retry_attempts <= max_retry_attempts:
    r = requests.get(
        f"{base_url}?group_ids={','.join([str(gid) for gid in group_ids])}&pageNumber={page}&numPerPage={num_per_page}&totalMatches={total_matches}",
        headers={"Authorization": f"token {token}"},
    )

    if r.status_code == 429:
        print("Request rate limit exceeded; sleeping 1s before trying again...")
        time.sleep(1)
        continue

    data = r.json()

    if data["status"] != "success":
        print(data)  # log as appropriate
        retry_attempts += 1
        time.sleep(5)
        continue
    else:
        retry_attempts = 0

    all_sources.extend(data["data"]["sources"])
    total_matches = data["data"]["totalMatches"]

    print(f"Fetched {len(all_sources)} of {total_matches} sources.")

    if len(all_sources) >= total_matches:
        break
    page += 1

Authentication

token

Header should be in the format 'token abcd-efgh-0000-1234'

Security Scheme Type API Key
Header parameter name: Authorization

allocations

Produce a report on allocations for an instrument

Produce a report on allocations for an instrument

path Parameters
instrument_id
required
integer
query Parameters
output_format
string

Output format for analysis. Can be png or pdf

Responses

200
400
get/api/allocation/report/instrument_id
https://fritz.science/api/allocation/report/instrument_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve an allocation

Retrieve an allocation

path Parameters
allocation_id
required
integer

Responses

200
400
get/api/allocation/allocation_id
https://fritz.science/api/allocation/allocation_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Update an allocation on a robotic instrument

Update an allocation on a robotic instrument

path Parameters
allocation_id
required
integer
Request Body schema: application/json
pi
string Nullable

The PI of the allocation's proposal.

proposal_id
string Nullable

The ID of the proposal associated with this allocation.

start_date
string <date-time> Nullable

The UTC start date of the allocation.

end_date
string <date-time> Nullable

The UTC end date of the allocation.

hours_allocated
required
number

The number of hours allocated.

default_share_group_ids
any Nullable
group_id
required
integer

The ID of the Group the allocation is associated with.

instrument_id
required
integer

The ID of the Instrument the allocation is associated with.

_altdata
string Nullable

Responses

200
400
put/api/allocation/allocation_id
https://fritz.science/api/allocation/allocation_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "pi": "string",
  • "proposal_id": "string",
  • "start_date": "2022-08-17T20:51:00Z",
  • "end_date": "2022-08-17T20:51:00Z",
  • "hours_allocated": 0,
  • "default_share_group_ids": null,
  • "group_id": 0,
  • "instrument_id": 0,
  • "_altdata": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete allocation.

Delete allocation.

path Parameters
allocation_id
required
string

Responses

200
delete/api/allocation/allocation_id
https://fritz.science/api/allocation/allocation_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all allocations

Retrieve all allocations

query Parameters
instrument_id
number

Instrument ID to retrieve allocations for

Responses

200
400
get/api/allocation
https://fritz.science/api/allocation

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Post new allocation on a robotic instrument

Post new allocation on a robotic instrument

Request Body schema: application/json
pi
string Nullable

The PI of the allocation's proposal.

proposal_id
string Nullable

The ID of the proposal associated with this allocation.

start_date
string <date-time> Nullable

The UTC start date of the allocation.

end_date
string <date-time> Nullable

The UTC end date of the allocation.

hours_allocated
required
number

The number of hours allocated.

default_share_group_ids
any Nullable
group_id
required
integer

The ID of the Group the allocation is associated with.

instrument_id
required
integer

The ID of the Instrument the allocation is associated with.

_altdata
string Nullable

Responses

200
post/api/allocation
https://fritz.science/api/allocation

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "pi": "string",
  • "proposal_id": "string",
  • "start_date": "2022-08-17T20:51:00Z",
  • "end_date": "2022-08-17T20:51:00Z",
  • "hours_allocated": 0,
  • "default_share_group_ids": null,
  • "group_id": 0,
  • "instrument_id": 0,
  • "_altdata": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve all observation analyses

Retrieve all observation analyses

query Parameters
gcnevent_id
number

GcnEvent ID to retrieve observation efficiency analyses for

Responses

200
400
get/api/survey_efficiency/observations
https://fritz.science/api/survey_efficiency/observations

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Retrieve all observation plan efficiency analyses

Retrieve all observation plan efficiency analyses

query Parameters
observation_plan_id
number

EventObservationPlan ID to retrieve observation plan efficiency analyses for

Responses

200
400
get/api/survey_efficiency/observation_plan
https://fritz.science/api/survey_efficiency/observation_plan

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

analysis_services

Retrieve an Analysis Service by id

Retrieve an Analysis Service by id

path Parameters
analysis_service_id
required
integer

Responses

200
400
get/api/analysis_service/analysis_service_id
https://fritz.science/api/analysis_service/analysis_service_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Delete an Analysis Service.

Delete an Analysis Service.

path Parameters
analysis_service_id
required
integer

Responses

200
delete/api/analysis_service/analysis_service_id
https://fritz.science/api/analysis_service/analysis_service_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all Analysis Services

Retrieve all Analysis Services

Responses

200
400
get/api/analysis_service
https://fritz.science/api/analysis_service

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

analysis

Retrieve an Analysis by id

Retrieve an Analysis by id

path Parameters
analysis_resource_type
required
string

What underlying data the analysis is on: must be "obj" (more to be added in the future)

analysis_id
required
int

ID of the analysis to return.

query Parameters
objID
string

Return any analysis on an object with ID objID

includeAnalysisData
boolean

Boolean indicating whether to include the data associated with the analysis in the response. Could be a large amount of data. Only works for single analysis requests. Defaults to false.

includeFilename
boolean

Boolean indicating whether to include the filename of the data associated with the analysis in the response. Defaults to false.

Responses

200
400
get/api/analysis_resource_type/analysis_id/analysis
https://fritz.science/api/analysis_resource_type/analysis_id/analysis

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Delete an Analysis.

Delete an Analysis.

path Parameters
analysis_id
required
integer

Responses

200
delete/api/analysis_resource_type/analysis_id/analysis
https://fritz.science/api/analysis_resource_type/analysis_id/analysis

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all Analyses

Retrieve all Analyses

Responses

200
400
get/api/analysis_resource_type/analysis_id
https://fritz.science/api/analysis_resource_type/analysis_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Begin an analysis run

Begin an analysis run

path Parameters
analysis_resource_type
required
string

What underlying data the analysis is on: must be "obj" (more to be added in the future)

resource_id
required
string

The ID of the underlying data. This would be a string for an object ID.

analysis_service_id
required
string

the analysis service id to be used

Request Body schema: application/json
show_parameters
boolean

Whether to render the parameters of this analysis

show_plots
boolean

Whether to render the plots of this analysis

show_corner
boolean

Whether to render the corner plots of this analysis

analysis_parameters
object

Dictionary of parameters to be passed thru to the analysis

group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view analysis results. Defaults to all of requesting user's groups.

Responses

200
post/api/analysis_resource_type/resource_id/analysis/analysis_service_id
https://fritz.science/api/analysis_resource_type/resource_id/analysis/analysis_service_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "show_parameters": true,
  • "show_plots": true,
  • "show_corner": true,
  • "analysis_parameters":
    {
    },
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve an Analysis by id

Retrieve an Analysis by id

path Parameters
analysis_resource_type
required
string

What underlying data the analysis is on: must be "obj" (more to be added in the future)

analysis_id
required
int

ID of the analysis to return.

query Parameters
objID
string

Return any analysis on an object with ID objID

includeAnalysisData
boolean

Boolean indicating whether to include the data associated with the analysis in the response. Could be a large amount of data. Only works for single analysis requests. Defaults to false.

includeFilename
boolean

Boolean indicating whether to include the filename of the data associated with the analysis in the response. Defaults to false.

Responses

200
400
get/api/analysis_resource_type/analysis/analysis_id
https://fritz.science/api/analysis_resource_type/analysis/analysis_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Delete an Analysis.

Delete an Analysis.

path Parameters
analysis_id
required
integer

Responses

200
delete/api/analysis_resource_type/analysis/analysis_id
https://fritz.science/api/analysis_resource_type/analysis/analysis_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all Analyses

Retrieve all Analyses

Responses

200
400
get/api/analysis_resource_type/analysis
https://fritz.science/api/analysis_resource_type/analysis

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Begin an analysis run

Begin an analysis run

path Parameters
analysis_resource_type
required
string

What underlying data the analysis is on: must be "obj" (more to be added in the future)

resource_id
required
string

The ID of the underlying data. This would be a string for an object ID.

analysis_service_id
required
string

the analysis service id to be used

Request Body schema: application/json
show_parameters
boolean

Whether to render the parameters of this analysis

show_plots
boolean

Whether to render the plots of this analysis

show_corner
boolean

Whether to render the corner plots of this analysis

analysis_parameters
object

Dictionary of parameters to be passed thru to the analysis

group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view analysis results. Defaults to all of requesting user's groups.

Responses

200
post/api/analysis_resource_type/analysis/resource_id
https://fritz.science/api/analysis_resource_type/analysis/resource_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "show_parameters": true,
  • "show_plots": true,
  • "show_corner": true,
  • "analysis_parameters":
    {
    },
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve primary data associated with an Analysis.

Retrieve primary data associated with an Analysis.

path Parameters
analysis_resource_type
required
string

What underlying data the analysis is on: must be "obj" (more to be added in the future)

analysis_id
required
integer
product_type
required
string

What type of data to retrieve: must be one of "corner", "results", or "plot"

plot_number
required
integer

if product_type == "plot", which plot number should be returned? Default to zero (first plot).

Request Body schema: application/json
plot_kwargs
object

Extra parameters to pass to the plotting functions if new plots are to be generated (e.g. with corner plots)

Responses

200

PNG finding chart file

400
get/api/analysis_resource_type/analysis/analysis_id/product_type/plot_number
https://fritz.science/api/analysis_resource_type/analysis/analysis_id/product_type/plot_number

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "plot_kwargs":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "error",
  • "message": "string",
  • "data": { }
}

assignments

Retrieve an observing run assignment

Retrieve an observing run assignment

path Parameters
assignment_id
required
integer

Responses

200
400
get/api/assignment/assignment_id
https://fritz.science/api/assignment/assignment_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Update an assignment

Update an assignment

path Parameters
assignment_id
required
integer
Request Body schema: application/json
requester_id
required
integer

The ID of the User who created this assignment.

obj_id
required
string

ID of the assigned Obj.

comment
string Nullable

A comment on the assignment. Typically a justification for the request, or instructions for taking the data.

status
string

Status of the assignment [done, not done, pending].

priority
required
string <= 1 characters
Enum: "1" "2" "3" "4" "5"

Priority of the request (1 = lowest, 5 = highest).

run_id
required
integer

ID of the ObservingRun this target was assigned to.

Responses

200
400
put/api/assignment/assignment_id
https://fritz.science/api/assignment/assignment_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "requester_id": 0,
  • "obj_id": "string",
  • "comment": "string",
  • "status": "string",
  • "priority": "1",
  • "run_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete assignment.

Delete assignment.

path Parameters
assignment_id
required
string

Responses

200
delete/api/assignment/assignment_id
https://fritz.science/api/assignment/assignment_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all observing run assignments

Retrieve all observing run assignments

Responses

200
400
get/api/assignment
https://fritz.science/api/assignment

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Post new target assignment to observing run

Post new target assignment to observing run

Request Body schema: application/json
comment
string

An optional comment describing the request.

obj_id
required
string

The ID of the object to observe.

priority
required
any
Enum: "1" "2" "3" "4" "5"

Priority of the request, (lowest = 1, highest = 5).

status
string

The status of the request

run_id
required
integer

Responses

200
post/api/assignment
https://fritz.science/api/assignment

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "comment": "string",
  • "obj_id": "string",
  • "priority": "1",
  • "status": "string",
  • "run_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

candidates

Retrieve a candidate

Retrieve a candidate

path Parameters
obj_id
required
string
query Parameters
includeComments
boolean

Boolean indicating whether to include associated comments. Defaults to false.

Responses

200
400
get/api/candidates/obj_id
https://fritz.science/api/candidates/obj_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Check if a Candidate exists

Check if a Candidate exists

path Parameters
obj_id
required
string

Responses

200
404
head/api/candidates/obj_id
https://fritz.science/api/candidates/obj_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete candidate(s)

Delete candidate(s)

path Parameters
obj_id
required
string
filter_id
required
integer

Responses

200
delete/api/candidates/obj_id
https://fritz.science/api/candidates/obj_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all candidates

Retrieve all candidates

query Parameters
numPerPage
integer

Number of candidates to return per paginated request. Defaults to 25. Capped at 500.

pageNumber
integer

Page number for paginated query results. Defaults to 1

totalMatches
integer

Used only in the case of paginating query results - if provided, this allows for avoiding a potentially expensive query.count() call.

savedStatus
string
Enum: "all" "savedToAllSelected" "savedToAnySelected" "savedToAnyAccessible" "notSavedToAnyAccessible" "notSavedToAnySelected" "notSavedToAllSelected"

String indicating the saved status to filter candidate results for. Must be one of the enumerated values.

startDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, filter by Candidate.passed_at >= startDate

endDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, filter by Candidate.passed_at <= endDate

groupIDs
Array of integers

Comma-separated string of group IDs (e.g. "1,2"). Defaults to all of user's groups if filterIDs is not provided.

filterIDs
Array of integers

Comma-separated string of filter IDs (e.g. "1,2"). Defaults to all of user's groups' filters if groupIDs is not provided.

annotationExcludeOrigin
string

Only load objects that do not have annotations from this origin. If the annotationsExcludeOutdatedDate is also given, then annotations with this origin will still be loaded if they were modified before that date.

annotationExcludeOutdatedDate
string

An Arrow parseable string designating when an existing annotation is outdated. Only relevant if giving the annotationExcludeOrigin argument. Will treat objects with outdated annotations as if they did not have that annotation, so it will load an object if it doesn't have an annotation with the origin specified or if it does have it but the annotation modified date < annotationsExcludeOutdatedDate

sortByAnnotationOrigin
string

The origin of the Annotation to sort by

sortByAnnotationKey
string

The key of the Annotation data value to sort by

sortByAnnotationOrder
string

The sort order for annotations - either "asc" or "desc". Defaults to "asc".

annotationFilterList
Array of strings

Comma-separated string of JSON objects representing annotation filters. Filter objects are expected to have keys { origin, key, value } for non-numeric value types, or { origin, key, min, max } for numeric values.

includePhotometry
boolean

Boolean indicating whether to include associated photometry. Defaults to false.

includeSpectra
boolean

Boolean indicating whether to include associated spectra. Defaults to false.

includeComments
boolean

Boolean indicating whether to include associated comments. Defaults to false.

classifications
Array of strings

Comma-separated string of classification(s) to filter for candidates matching that/those classification(s).

minRedshift
number

If provided, return only candidates with a redshift of at least this value

maxRedshift
number

If provided, return only candidates with a redshift of at most this value

listName
string

Get only candidates saved to the querying user's list, e.g., "favorites".

listNameReject
string

Get only candidates that ARE NOT saved to the querying user's list, e.g., "rejected_candidates".

Responses

200
400
get/api/candidates
https://fritz.science/api/candidates

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Create new candidate(s) (one per filter).

Create new candidate(s) (one per filter).

Request Body schema: application/json
ra
number Nullable
dec
number Nullable
id
required
string

Name of the object.

ra_dis
number Nullable

J2000 Right Ascension at discovery time [deg].

dec_dis
number Nullable

J2000 Declination at discovery time [deg].

ra_err
number Nullable

Error on J2000 Right Ascension at discovery time [deg].

dec_err
number Nullable

Error on J2000 Declination at discovery time [deg].

offset
number Nullable

Offset from nearest static object [arcsec].

redshift
number Nullable

Redshift.

redshift_error
number Nullable

Redshift error.

redshift_origin
string Nullable

Redshift source.

altdata
any Nullable

Misc. alternative metadata stored in JSON format, e.g. {'gaia': {'info': {'Teff': 5780}}}

dist_nearest_source
number Nullable

Distance to the nearest Obj [arcsec].

mag_nearest_source
number Nullable

Magnitude of the nearest Obj [AB].

e_mag_nearest_source
number Nullable

Error on magnitude of the nearest Obj [mag].

transient
boolean Nullable

Boolean indicating whether the object is an astrophysical transient.

varstar
boolean Nullable

Boolean indicating whether the object is a variable star.

is_roid
boolean Nullable

Boolean indicating whether the object is a moving object.

score
number Nullable

Machine learning score.

origin
string Nullable

Origin of the object.

alias
any Nullable

Alternative names for this object.

healpix
integer Nullable
detect_photometry_count
integer Nullable

How many times the object was detected above :math:S/N = phot_detection_threshold (3.0 by default).

filter_ids
required
Array of integers

List of associated filter IDs

passing_alert_id
integer Nullable

ID of associated filter that created candidate

passed_at
required
string Nullable

Arrow-parseable datetime string indicating when passed filter.

Responses

200
post/api/candidates
https://fritz.science/api/candidates

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ra": 0,
  • "dec": 0,
  • "id": "string",
  • "ra_dis": 0,
  • "dec_dis": 0,
  • "ra_err": 0,
  • "dec_err": 0,
  • "offset": 0,
  • "redshift": 0,
  • "redshift_error": 0,
  • "redshift_origin": "string",
  • "altdata": null,
  • "dist_nearest_source": 0,
  • "mag_nearest_source": 0,
  • "e_mag_nearest_source": 0,
  • "transient": true,
  • "varstar": true,
  • "is_roid": true,
  • "score": 0,
  • "origin": "string",
  • "alias": null,
  • "healpix": 0,
  • "detect_photometry_count": 0,
  • "filter_ids":
    [
    ],
  • "passing_alert_id": 0,
  • "passed_at": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Create new candidate(s) (one per filter).

Create new candidate(s) (one per filter).

Request Body schema: application/json
ra
number Nullable
dec
number Nullable
id
required
string

Name of the object.

ra_dis
number Nullable

J2000 Right Ascension at discovery time [deg].

dec_dis
number Nullable

J2000 Declination at discovery time [deg].

ra_err
number Nullable

Error on J2000 Right Ascension at discovery time [deg].

dec_err
number Nullable

Error on J2000 Declination at discovery time [deg].

offset
number Nullable

Offset from nearest static object [arcsec].

redshift
number Nullable

Redshift.

redshift_error
number Nullable

Redshift error.

redshift_origin
string Nullable

Redshift source.

altdata
any Nullable

Misc. alternative metadata stored in JSON format, e.g. {'gaia': {'info': {'Teff': 5780}}}

dist_nearest_source
number Nullable

Distance to the nearest Obj [arcsec].

mag_nearest_source
number Nullable

Magnitude of the nearest Obj [AB].

e_mag_nearest_source
number Nullable

Error on magnitude of the nearest Obj [mag].

transient
boolean Nullable

Boolean indicating whether the object is an astrophysical transient.

varstar
boolean Nullable

Boolean indicating whether the object is a variable star.

is_roid
boolean Nullable

Boolean indicating whether the object is a moving object.

score
number Nullable

Machine learning score.

origin
string Nullable

Origin of the object.

alias
any Nullable

Alternative names for this object.

healpix
integer Nullable
detect_photometry_count
integer Nullable

How many times the object was detected above :math:S/N = phot_detection_threshold (3.0 by default).

filter_ids
required
Array of integers

List of associated filter IDs

passing_alert_id
integer Nullable

ID of associated filter that created candidate

passed_at
required
string Nullable

Arrow-parseable datetime string indicating when passed filter.

Responses

200
post/api/candidates/
https://fritz.science/api/candidates/

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ra": 0,
  • "dec": 0,
  • "id": "string",
  • "ra_dis": 0,
  • "dec_dis": 0,
  • "ra_err": 0,
  • "dec_err": 0,
  • "offset": 0,
  • "redshift": 0,
  • "redshift_error": 0,
  • "redshift_origin": "string",
  • "altdata": null,
  • "dist_nearest_source": 0,
  • "mag_nearest_source": 0,
  • "e_mag_nearest_source": 0,
  • "transient": true,
  • "varstar": true,
  • "is_roid": true,
  • "score": 0,
  • "origin": "string",
  • "alias": null,
  • "healpix": 0,
  • "detect_photometry_count": 0,
  • "filter_ids":
    [
    ],
  • "passing_alert_id": 0,
  • "passed_at": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Delete candidate(s)

Delete candidate(s)

path Parameters
obj_id
required
string
filter_id
required
integer

Responses

200
delete/api/candidates/obj_id/filter_id
https://fritz.science/api/candidates/obj_id/filter_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

source

find the sources with classifications

find the sources with classifications

query Parameters
startDate
string

Arrow-parseable date string (e.g. 2020-01-01) for when the classification was made. If provided, filter by created_at >= startDate

endDate
string

Arrow-parseable date string (e.g. 2020-01-01) for when the classification was made. If provided, filter by created_at <= endDate

Responses

200
400
get/api/classification/sources
https://fritz.science/api/classification/sources

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

find the number of sources with and without a Heal

find the number of sources with and without a Healpix value

Responses

200
400
get/api/healpix
https://fritz.science/api/healpix

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

classifications

Retrieve a classification

Retrieve a classification

path Parameters
classification_id
required
integer

Responses

200
400
get/api/classification/classification_id
https://fritz.science/api/classification/classification_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Update a classification

Update a classification

path Parameters
classification
required
integer
Request Body schema: application/json
classification
required
string

The assigned class.

taxonomy_id
required
integer

ID of the Taxonomy in which this Classification was made.

probability
number Nullable

User-assigned probability of belonging to this class

author_id
required
integer

ID of the User that made this Classification

author_name
required
string

User.username or Token.id of the Classification's author.

obj_id
required
string

ID of the Classification's Obj.

group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view classification.

Responses

200
400
put/api/classification/classification_id
https://fritz.science/api/classification/classification_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "classification": "string",
  • "taxonomy_id": 0,
  • "probability": 0,
  • "author_id": 0,
  • "author_name": "string",
  • "obj_id": "string",
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete a classification

Delete a classification

path Parameters
classification_id
required
integer

Responses

200
delete/api/classification/classification_id
https://fritz.science/api/classification/classification_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all classifications

Retrieve all classifications

query Parameters
startDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, filter by created_at >= startDate

endDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, filter by created_at <= endDate

numPerPage
integer

Number of sources to return per paginated request. Defaults to 100. Max 500.

pageNumber
integer

Page number for paginated query results. Defaults to 1

Responses

200
400
get/api/classification
https://fritz.science/api/classification

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Post a classification

Post a classification

Request Body schema: application/json
obj_id
required
string
classification
required
string
taxonomy_id
required
integer
probability
float [ 0 .. 1 ] Nullable

User-assigned probability of this classification on this taxonomy. If multiple classifications are given for the same source by the same user, the sum of the classifications ought to equal unity. Only individual probabilities are checked.

group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view classification. Defaults to all of requesting user's groups.

Responses

200
post/api/classification
https://fritz.science/api/classification

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "obj_id": "string",
  • "classification": "string",
  • "taxonomy_id": 0,
  • "probability": null,
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve an object's classifications

Retrieve an object's classifications

path Parameters
obj_id
required
string

Responses

200
400
get/api/sources/obj_id/classifications
https://fritz.science/api/sources/obj_id/classifications

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

system_info

Retrieve enum types in the DB

Retrieve enum types in the DB

Responses

200
get/api/enum_types
https://fritz.science/api/enum_types

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve basic DB statistics

Retrieve basic DB statistics

Responses

200
get/api/db_stats
https://fritz.science/api/db_stats

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve system/deployment info

Retrieve system/deployment info

Responses

200
get/api/sysinfo
https://fritz.science/api/sysinfo

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

default_observation_plans

Retrieve a single default observation plan

Retrieve a single default observation plan

path Parameters
default_observation_plan_id
required
integer

Responses

200
400
get/api/default_observation_plan/default_observation_plan_id
https://fritz.science/api/default_observation_plan/default_observation_plan_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

filters

Delete a default observation plan

Delete a default observation plan

path Parameters
default_observation_plan_id
required
integer

Responses

200
delete/api/default_observation_plan/default_observation_plan_id
https://fritz.science/api/default_observation_plan/default_observation_plan_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all default observation plans

Retrieve all default observation plans

Responses

200
400
get/api/default_observation_plan
https://fritz.science/api/default_observation_plan

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Retrieve a filter

Retrieve a filter

path Parameters
filter_id
required
integer

Responses

200
400
get/api/filters/filter_id
https://fritz.science/api/filters/filter_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Delete a filter

Delete a filter

path Parameters
filter_id
required
integer

Responses

200
delete/api/filters/filter_id
https://fritz.science/api/filters/filter_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Update filter name

Update filter name

path Parameters
filter_id
required
integer
Request Body schema: application/json
name
required
string

Filter name.

stream_id
required
integer

ID of the Filter's Stream.

group_id
required
integer

ID of the Filter's Group.

Responses

200
400
patch/api/filters/filter_id
https://fritz.science/api/filters/filter_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "stream_id": 0,
  • "group_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all filters

Retrieve all filters

Responses

200
400
get/api/filters
https://fritz.science/api/filters

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

POST a new filter.

POST a new filter.

Request Body schema: application/json
name
required
string

Filter name.

stream_id
required
integer

ID of the Filter's Stream.

group_id
required
integer

ID of the Filter's Group.

Responses

200
post/api/filters
https://fritz.science/api/filters

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "stream_id": 0,
  • "group_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a filter as stored on Kowalski

Retrieve a filter as stored on Kowalski

path Parameters
filter_id
required
integer

Responses

200
400
get/api/filters/filter_id/v
https://fritz.science/api/filters/filter_id/v

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data": { }
}

POST a new filter version.

POST a new filter version.

Request Body schema: application/json
name
required
string

Filter name.

stream_id
required
integer

ID of the Filter's Stream.

group_id
required
integer

ID of the Filter's Group.

Responses

200
post/api/filters/filter_id/v
https://fritz.science/api/filters/filter_id/v

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "stream_id": 0,
  • "group_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Delete a filter on Kowalski

Delete a filter on Kowalski

path Parameters
filter_id
required
integer

Responses

200
delete/api/filters/filter_id/v
https://fritz.science/api/filters/filter_id/v

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Update a filter on Kowalski

Update a filter on Kowalski

path Parameters
filter_id
required
integer
Request Body schema: application/json
filter_id
required
integer >= 1

[fritz] science program filter id for this user group id

active
boolean

activate or deactivate filter

active_fid
string 6 characters

set fid as active version

autosave
boolean

automatically save passing candidates to filter's group

update_annotations
boolean

update annotations for existing candidates

Responses

200
400
patch/api/filters/filter_id/v
https://fritz.science/api/filters/filter_id/v

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "filter_id": 1,
  • "active": true,
  • "active_fid": "string",
  • "autosave": true,
  • "update_annotations": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

default_observation_plan

Create default observation plan requests.

Create default observation plan requests.

Request Body schema: application/json
target_group_ids
Array of integers

IDs of groups to share the results of the default observation plan request with.

payload
any

Content of the default observation plan request.

allocation_id
required
integer

Observation plan request allocation ID.

Responses

200
post/api/default_observation_plan
https://fritz.science/api/default_observation_plan

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "target_group_ids":
    [
    ],
  • "payload": null,
  • "allocation_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

facility

Post a message from a remote facility

Post a message from a remote facility

Request Body schema: application/json
One of
  • SEDMListener
new_status
required
string
followup_request_id
required
integer

Responses

200
400
post/api/facility
https://fritz.science/api/facility

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "new_status": "string",
  • "followup_request_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

followup_requests

Retrieve followup requests schedule

Retrieve followup requests schedule

query Parameters
sourceID
string

Portion of ID to filter on

startDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, filter by created_at >= startDate

endDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, filter by created_at <= endDate

status
string

String to match status of request against

observationStartDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, start time of observation window, otherwise now.

observationEndDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, end time of observation window, otherwise 12 hours from now.

output_format
string

Output format for schedule. Can be png, pdf, or csv

Responses

200

A PDF/PNG schedule file

400
get/api/followup_request/schedule/instrument_id
https://fritz.science/api/followup_request/schedule/instrument_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "error",
  • "message": "string",
  • "data": { }
}

Reprioritize followup requests schedule automatica

Reprioritize followup requests schedule automatically based on either magnitude or location within skymap.

Responses

200
400
put/api/followup_request/prioritization
https://fritz.science/api/followup_request/prioritization

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Update a follow-up request

Update a follow-up request

path Parameters
request_id
required
string
Request Body schema: application/json
obj_id
required
string

ID of the target Obj.

target_group_ids
Array of integers

IDs of groups to share the results of the followup request with.

payload
any

Content of the followup request.

allocation_id
required
integer

Followup request allocation ID.

status
string
Default: "pending submission"

The status of the request.

Responses

200
400
put/api/followup_request/request_id
https://fritz.science/api/followup_request/request_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "obj_id": "string",
  • "target_group_ids":
    [
    ],
  • "payload": null,
  • "allocation_id": 0,
  • "status": "pending submission"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete follow-up request.

Delete follow-up request.

path Parameters
request_id
required
string

Responses

200
delete/api/followup_request/request_id
https://fritz.science/api/followup_request/request_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Submit follow-up request.

Submit follow-up request.

Request Body schema: application/json
obj_id
required
string

ID of the target Obj.

target_group_ids
Array of integers

IDs of groups to share the results of the followup request with.

payload
any

Content of the followup request.

allocation_id
required
integer

Followup request allocation ID.

status
string
Default: "pending submission"

The status of the request.

Responses

200
post/api/followup_request
https://fritz.science/api/followup_request

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "obj_id": "string",
  • "target_group_ids":
    [
    ],
  • "payload": null,
  • "allocation_id": 0,
  • "status": "pending submission"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Get photometry request.

Get photometry request.

path Parameters
request_id
required
string

Responses

200
get/api/photometry_request/request_id
https://fritz.science/api/photometry_request/request_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

galaxys

Upload galaxies from GLADE+ catalog. If no file_na

Upload galaxies from GLADE+ catalog. If no file_name or file_url is provided, will look for the GLADE+ catalog in the data directory. If it can't be found, it will download it.

Request Body schema: application/json
file_name
string

Name of the file containing the galaxies (in the data directory)

file_url
string

URL of the file containing the galaxies

Responses

200
400
post/api/galaxy_catalog/glade
https://fritz.science/api/galaxy_catalog/glade

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "file_name": "string",
  • "file_url": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Upload galaxies from ASCII file

Upload galaxies from ASCII file

Request Body schema: application/json
catalogData
any

Catalog data Ascii string

catalogName
string

Galaxy catalog name.

Responses

200
400
post/api/galaxy_catalog/ascii
https://fritz.science/api/galaxy_catalog/ascii

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "catalogData": null,
  • "catalogName": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

galaxies

Retrieve all galaxies

Retrieve all galaxies

query Parameters
catalog_name
string

Filter by catalog name (exact match)

minDistance
number

If provided, return only galaxies with a distance of at least this value

maxDistance
number

If provided, return only galaxies with a distance of at most this value

minRedshift
number

If provided, return only galaxies with a redshift of at least this value

maxRedshift
number

If provided, return only galaxies with a redshift of at most this value

localizationDateobs
string

Event time in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.sss).

localizationName
string

Name of localization / skymap to use. Can be found in Localization.localization_name queried from /api/localization endopoint or skymap name in GcnEvent page table.

localizationCumprob
number

Cumulative probability up to which to include galaxies

includeGeoJSON
boolean

Boolean indicating whether to include associated GeoJSON. Defaults to false.

numPerPage
integer

Number of galaxies to return per paginated request. Defaults to 100. Can be no larger than {MAX_OBSERVATIONS}.

pageNumber
integer

Page number for paginated query results. Defaults to 1

catalogNamesOnly
boolean

Boolean indicating whether to just return catalog names. Defaults to false.

Responses

200
400
get/api/galaxy_catalog/catalog_name
https://fritz.science/api/galaxy_catalog/catalog_name

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Ingest a Galaxy catalog

Ingest a Galaxy catalog

Request Body schema: application/json
catalog_name
string

Galaxy catalog name.

catalog_data
Array of any

Galaxy catalog data

Responses

200
400
post/api/galaxy_catalog
https://fritz.science/api/galaxy_catalog

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "catalog_name": "string",
  • "catalog_data":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

instruments

Delete a galaxy catalog

Delete a galaxy catalog

path Parameters
catalog_name
required
str

Responses

200
400
delete/api/galaxy_catalog/catalog_name
https://fritz.science/api/galaxy_catalog/catalog_name

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve an instrument

Retrieve an instrument

path Parameters
instrument_id
required
integer
query Parameters
includeGeoJSON
boolean

Boolean indicating whether to include associated GeoJSON. Defaults to false.

includeGeoJSONSummary
boolean

Boolean indicating whether to include associated GeoJSON summary bounding box. Defaults to false.

includeRegion
boolean

Boolean indicating whether to include associated DS9 region. Defaults to false.

localizationDateobs
string

Include fields within a given localization. Event time in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.sss). Each localization is associated with a specific GCNEvent by the date the event happened, and this date is used as a unique identifier. It can be therefore found as Localization.dateobs, queried from the /api/localization endpoint or dateobs in the GcnEvent page table.

localizationName
string

Name of localization / skymap to use. Can be found in Localization.localization_name queried from /api/localization endpoint or skymap name in GcnEvent page table.

localizationCumprob
number

Cumulative probability up to which to include fields. Defaults to 0.95.

Responses

200
400
get/api/instrument/instrument_id
https://fritz.science/api/instrument/instrument_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Update instrument

Update instrument

path Parameters
instrument_id
required
integer
Request Body schema: application/json
region
string Nullable

Instrument astropy.regions representation.

name
required
string

Instrument name.

type
required
string <= 20 characters
Enum: "imager" "spectrograph" "imaging spectrograph"

Instrument type, one of Imager, Spectrograph, or Imaging Spectrograph.

band
string Nullable

The spectral band covered by the instrument (e.g., Optical, IR).

telescope_id
required
integer

The ID of the Telescope that hosts the Instrument.

filters
Array of any

List of filters on the instrument (if any).

sensitivity_data
any Nullable

JSON describing the filters on the instrument and the filter's corresponding limiting magnitude and exposure time.

api_classname
string <= 11 characters Nullable
Enum: "ATLASAPI" "KAITAPI" "SEDMAPI" "SEDMV2API" "IOOAPI" "IOIAPI" "SPRATAPI" "SINISTROAPI" "SPECTRALAPI" "FLOYDSAPI" "MUSCATAPI" "MMAAPI" "PS1API" "SLACKAPI" "UVOTXRTAPI" "ZTFAPI" "ZTFMMAAPI"

Name of the instrument's API class.

api_classname_obsplan
string <= 11 characters Nullable
Enum: "ATLASAPI" "KAITAPI" "SEDMAPI" "SEDMV2API" "IOOAPI" "IOIAPI" "SPRATAPI" "SINISTROAPI" "SPECTRALAPI" "FLOYDSAPI" "MUSCATAPI" "MMAAPI" "PS1API" "SLACKAPI" "UVOTXRTAPI" "ZTFAPI" "ZTFMMAAPI"

Name of the instrument's ObservationPlan API class.

listener_classname
string <= 12 characters Nullable
Value: "SEDMListener"

Name of the instrument's listener class.

treasuremap_id
integer Nullable

treasuremap.space API ID for this instrument

tns_id
integer Nullable

TNS API ID for this instrument

Responses

200
400
put/api/instrument/instrument_id
https://fritz.science/api/instrument/instrument_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "region": "string",
  • "name": "string",
  • "type": "imager",
  • "band": "string",
  • "telescope_id": 0,
  • "filters":
    [
    ],
  • "sensitivity_data": null,
  • "api_classname": "ATLASAPI",
  • "api_classname_obsplan": "ATLASAPI",
  • "listener_classname": "SEDMListener",
  • "treasuremap_id": 0,
  • "tns_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete an instrument

Delete an instrument

path Parameters
instrument_id
required
integer

Responses

200
400
delete/api/instrument/instrument_id
https://fritz.science/api/instrument/instrument_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all instruments

Retrieve all instruments

query Parameters
name
string

Filter by name (exact match)

includeGeoJSON
boolean

Boolean indicating whether to include associated GeoJSON. Defaults to false.

includeGeoJSONSummary
boolean

Boolean indicating whether to include associated GeoJSON summary bounding box. Defaults to false.

includeRegion
boolean

Boolean indicating whether to include associated DS9 region. Defaults to false.

localizationDateobs
string

Include fields within a given localization. Event time in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.sss). Each localization is associated with a specific GCNEvent by the date the event happened, and this date is used as a unique identifier. It can be therefore found as Localization.dateobs, queried from the /api/localization endpoint or dateobs in the GcnEvent page table.

localizationName
string

Name of localization / skymap to use. Can be found in Localization.localization_name queried from /api/localization endpoint or skymap name in GcnEvent page table.

localizationCumprob
number

Cumulative probability up to which to include fields. Defaults to 0.95.

airmassTime
string

Time to use for airmass calculation in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.sss). Defaults to localizationDateobs if not supplied.

Responses

200
400
get/api/instrument
https://fritz.science/api/instrument

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Add a new instrument

Add a new instrument

Request Body schema: application/json
region
string Nullable

Instrument astropy.regions representation.

name
required
string

Instrument name.

type
required
string <= 20 characters
Enum: "imager" "spectrograph" "imaging spectrograph"

Instrument type, one of Imager, Spectrograph, or Imaging Spectrograph.

band
string Nullable

The spectral band covered by the instrument (e.g., Optical, IR).

telescope_id
required
integer

The ID of the Telescope that hosts the Instrument.

filters
Array of strings
Default: []
Items Enum: "bessellux" "bessellb" "bessellv" "bessellr" "besselli" "standard::u" "standard::b" "standard::v" "standard::r" "standard::i" "desg" "desr" "desi" "desz" "desy" "sdssu" "sdssg" "sdssr" "sdssi" "sdssz" "f435w" "f475w" "f555w" "f606w" "f625w" "f775w" "f850lp" "nicf110w" "nicf160w" "f098m" "f105w" "f110w" "f125w" "f127m" "f139m" "f140w" "f153m" "f160w" "f218w" "f225w" "f275w" "f300x" "f336w" "f350lp" "f390w" "f689m" "f763m" "f845m" "f438w" "uvf475w" "uvf555w" "uvf606w" "uvf625w" "uvf775w" "uvf814w" "uvf850lp" "kepler" "cspb" "csphs" "csphd" "cspjs" "cspjd" "cspv3009" "cspv3014" "cspv9844" "cspys" "cspyd" "cspg" "cspi" "cspk" "cspr" "cspu" "f070w" "f090w" "f115w" "f150w" "f200w" "f277w" "f356w" "f444w" "f140m" "f162m" "f182m" "f210m" "f250m" "f300m" "f335m" "f360m" "f410m" "f430m" "f460m" "f480m" "f560w" "f770w" "f1000w" "f1130w" "f1280w" "f1500w" "f1800w" "f2100w" "f2550w" "f1065c" "f1140c" "f1550c" "f2300c" "lsstu" "lsstg" "lsstr" "lssti" "lsstz" "lssty" "keplercam::us" "keplercam::b" "keplercam::v" "keplercam::r" "keplercam::i" "4shooter2::us" "4shooter2::b" "4shooter2::v" "4shooter2::r" "4shooter2::i" "f062" "f087" "f106" "f129" "f158" "f184" "f213" "f146" "ztfg" "ztfr" "ztfi" "uvot::b" "uvot::u" "uvot::uvm2" "uvot::uvw1" "uvot::uvw2" "uvot::v" "uvot::white" "ps1::open" "ps1::g" "ps1::r" "ps1::i" "ps1::z" "ps1::y" "ps1::w" "atlasc" "atlaso" "2massj" "2massh" "2massks"

List of filters on the instrument (if any).

sensitivity_data
object Nullable

JSON describing the filters on the instrument and the filter's corresponding limiting magnitude and exposure time.

api_classname
string <= 11 characters Nullable
Enum: "ATLASAPI" "KAITAPI" "SEDMAPI" "SEDMV2API" "IOOAPI" "IOIAPI" "SPRATAPI" "SINISTROAPI" "SPECTRALAPI" "FLOYDSAPI" "MUSCATAPI" "MMAAPI" "PS1API" "SLACKAPI" "UVOTXRTAPI" "ZTFAPI" "ZTFMMAAPI"

Name of the instrument's API class.

api_classname_obsplan
string <= 11 characters Nullable
Enum: "ATLASAPI" "KAITAPI" "SEDMAPI" "SEDMV2API" "IOOAPI" "IOIAPI" "SPRATAPI" "SINISTROAPI" "SPECTRALAPI" "FLOYDSAPI" "MUSCATAPI" "MMAAPI" "PS1API" "SLACKAPI" "UVOTXRTAPI" "ZTFAPI" "ZTFMMAAPI"

Name of the instrument's ObservationPlan API class.

listener_classname
string <= 12 characters Nullable
Value: "SEDMListener"

Name of the instrument's listener class.

treasuremap_id
integer Nullable

treasuremap.space API ID for this instrument

tns_id
integer Nullable

TNS API ID for this instrument

field_data
dict

List of ID, RA, and Dec for each field.

field_region
str

Serialized version of a regions.Region describing the shape of the instrument field. Note: should only include field_region or field_fov_type.

field_fov_type
str

Option for instrument field shape. Must be either circle or rectangle. Note: should only include field_region or field_fov_type.

field_fov_attributes
list

Option for instrument field shape parameters. Single float radius in degrees in case of circle or list of two floats (height and width) in case of a rectangle.

Responses

200
400
post/api/instrument
https://fritz.science/api/instrument

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "region": "string",
  • "name": "string",
  • "type": "imager",
  • "band": "string",
  • "telescope_id": 0,
  • "filters":
    [
    ],
  • "sensitivity_data":
    {
    },
  • "api_classname": "ATLASAPI",
  • "api_classname_obsplan": "ATLASAPI",
  • "listener_classname": "SEDMListener",
  • "treasuremap_id": 0,
  • "tns_id": 0,
  • "field_data": null,
  • "field_region": null,
  • "field_fov_type": null,
  • "field_fov_attributes": null
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

comments

Retrieve all comments associated with specified re

Retrieve all comments associated with specified resource

path Parameters
associated_resource_type
required
string
Value: "sources"

What underlying data the comment is on, e.g., "sources" or "spectra" or "gcn_event".

resource_id
required
string

The ID of the underlying data. This would be a string for a source ID or an integer for other data types like spectrum or gcn_event.

Responses

200
400
get/api/associated_resource_type/resource_id/comments
https://fritz.science/api/associated_resource_type/resource_id/comments

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Update a comment

Update a comment

path Parameters
associated_resource_type
required
string
Enum: "sources" "spectrum" "gcn_event" "shift"

What underlying data the comment is on: "sources" or "spectra" or "gcn_event" or "shift".

resource_id
required
string
Enum: "sources" "spectra" "gcn_event" "shift"

The ID of the source or spectrum that the comment is posted to. This would be a string for an object ID or an integer for a spectrum, gcn_event or shift.

comment_id
required
integer
Request Body schema: application/json
attachment_bytes
string Nullable

Binary representation of the attachment.

text
required
string

Comment body.

attachment_name
string Nullable

Filename of the attachment.

origin
string Nullable

Comment origin.

bot
boolean

Boolean indicating whether comment was posted via a bot (token-based request).

obj_id
required
string

ID of the Comment's Obj.

author_id
required
integer

ID of the Comment author's User instance.

group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view comment.

Responses

200
400
put/api/associated_resource_type/resource_id/comments
https://fritz.science/api/associated_resource_type/resource_id/comments

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "attachment_bytes": "string",
  • "text": "string",
  • "attachment_name": "string",
  • "origin": "string",
  • "bot": true,
  • "obj_id": "string",
  • "author_id": 0,
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Post a comment

Post a comment

path Parameters
associated_resource_type
required
string
Enum: "sources" "spectrum" "gcn_event"

What underlying data the comment is on: "source" or "spectrum" or "gcn_event".

resource_id
required
string
Enum: "sources" "spectra" "gcn_event"

The ID of the source or spectrum that the comment is posted to. This would be a string for a source ID or an integer for a spectrum.

Request Body schema: application/json
text
required
string
group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view comment. Defaults to all of requesting user's groups.

attachment
object

Responses

200
post/api/associated_resource_type/resource_id/comments
https://fritz.science/api/associated_resource_type/resource_id/comments

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "text": "string",
  • "group_ids":
    [
    ],
  • "attachment":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Delete a comment

Delete a comment

path Parameters
associated_resource_type
required
string

What underlying data the comment is on: "sources" or "spectra".

resource_id
required
string
Enum: "sources" "spectra" "gcn_event"

The ID of the source or spectrum that the comment is posted to. This would be a string for a source ID or an integer for a spectrum or gcn_event.

comment_id
required
integer

Responses

200
delete/api/associated_resource_type/resource_id/comments
https://fritz.science/api/associated_resource_type/resource_id/comments

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve a comment

Retrieve a comment

path Parameters
associated_resource_type
required
string

What underlying data the comment is on: "sources" or "spectra" or "gcn_event".

resource_id
required
string
Enum: "sources" "spectra" "gcn_event"

The ID of the source, spectrum, or gcn_event that the comment is posted to. This would be a string for a source ID or an integer for a spectrum or gcn_event

comment_id
required
integer

Responses

200
400
get/api/associated_resource_type/resource_id/comments/comment_id
https://fritz.science/api/associated_resource_type/resource_id/comments/comment_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Update a comment

Update a comment

path Parameters
associated_resource_type
required
string
Enum: "sources" "spectrum" "gcn_event" "shift"

What underlying data the comment is on: "sources" or "spectra" or "gcn_event" or "shift".

resource_id
required
string
Enum: "sources" "spectra" "gcn_event" "shift"

The ID of the source or spectrum that the comment is posted to. This would be a string for an object ID or an integer for a spectrum, gcn_event or shift.

comment_id
required
integer
Request Body schema: application/json
attachment_bytes
string Nullable

Binary representation of the attachment.

text
required
string

Comment body.

attachment_name
string Nullable

Filename of the attachment.

origin
string Nullable

Comment origin.

bot
boolean

Boolean indicating whether comment was posted via a bot (token-based request).

obj_id
required
string

ID of the Comment's Obj.

author_id
required
integer

ID of the Comment author's User instance.

group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view comment.

Responses

200
400
put/api/associated_resource_type/resource_id/comments/comment_id
https://fritz.science/api/associated_resource_type/resource_id/comments/comment_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "attachment_bytes": "string",
  • "text": "string",
  • "attachment_name": "string",
  • "origin": "string",
  • "bot": true,
  • "obj_id": "string",
  • "author_id": 0,
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete a comment

Delete a comment

path Parameters
associated_resource_type
required
string

What underlying data the comment is on: "sources" or "spectra".

resource_id
required
string
Enum: "sources" "spectra" "gcn_event"

The ID of the source or spectrum that the comment is posted to. This would be a string for a source ID or an integer for a spectrum or gcn_event.

comment_id
required
integer

Responses

200
delete/api/associated_resource_type/resource_id/comments/comment_id
https://fritz.science/api/associated_resource_type/resource_id/comments/comment_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Download comment attachment

Download comment attachment

path Parameters
associated_resource_type
required
string
Enum: "sources" "spectrum" "gcn_event"

What underlying data the comment is on: "sources" or "spectra".

resource_id
required
string
Enum: "sources" "spectra" "gcn_event"

The ID of the source or spectrum that the comment is posted to. This would be a string for a source ID or an integer for a spectrum.

comment_id
required
integer
query Parameters
download
boolean

If true, download the attachment; else return file data as text. True by default.

Responses

200
get/api/associated_resource_type/resource_id/comments/comment_id/attachment
https://fritz.science/api/associated_resource_type/resource_id/comments/comment_id/attachment

Response samples

Content type
No sample

Download comment attachment

Download comment attachment

path Parameters
associated_resource_type
required
string
Enum: "sources" "spectrum" "gcn_event"

What underlying data the comment is on: "sources" or "spectra".

resource_id
required
string
Enum: "sources" "spectra" "gcn_event"

The ID of the source or spectrum that the comment is posted to. This would be a string for a source ID or an integer for a spectrum.

comment_id
required
integer
query Parameters
download
boolean

If true, download the attachment; else return file data as text. True by default.

Responses

200
get/api/associated_resource_type/resource_id/comments/comment_id/attachment.pdf
https://fritz.science/api/associated_resource_type/resource_id/comments/comment_id/attachment.pdf

Response samples

Content type
No sample

spectra

Retrieve all comments associated with specified re

Retrieve all comments associated with specified resource

path Parameters
associated_resource_type
required
string
Value: "sources"

What underlying data the comment is on, e.g., "sources" or "spectra" or "gcn_event".

resource_id
required
string

The ID of the underlying data. This would be a string for a source ID or an integer for other data types like spectrum or gcn_event.

Responses

200
400
get/api/associated_resource_type/resource_id/comments
https://fritz.science/api/associated_resource_type/resource_id/comments

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Retrieve all annotations associated with specified

Retrieve all annotations associated with specified resource

path Parameters
associated_resource_type
required
string
Enum: "sources" "spectra"

What underlying data the annotation is on: must be one of either "sources" or "spectra".

resource_id
required
string

The ID of the underlying data. This would be a string for a source ID or an integer for other data types like spectra.

Responses

200
400
get/api/associated_resource_type/resource_id
https://fritz.science/api/associated_resource_type/resource_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Retrieve a comment

Retrieve a comment

path Parameters
associated_resource_type
required
string

What underlying data the comment is on: "sources" or "spectra" or "gcn_event".

resource_id
required
string
Enum: "sources" "spectra" "gcn_event"

The ID of the source, spectrum, or gcn_event that the comment is posted to. This would be a string for a source ID or an integer for a spectrum or gcn_event

comment_id
required
integer

Responses

200
400
get/api/associated_resource_type/resource_id/comments/comment_id
https://fritz.science/api/associated_resource_type/resource_id/comments/comment_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a reminder

Retrieve a reminder

path Parameters
associated_resource_type
required
string
Enum: "source" "spectra" "gcn_event" "shift"

What underlying data the reminder is on: "sources" or "spectra" or "gcn_event" or "shift".

resource_id
required
string

The ID of the source, spectrum, gcn_event or shift that the reminder is posted to. This would be a string for a source ID or an integer for a spectrum or gcn_event

reminder_id
required
integer

Responses

200
400
get/api/associated_resource_type/resource_id/reminders/reminder_id
https://fritz.science/api/associated_resource_type/resource_id/reminders/reminder_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve all reminders associated with specified r

Retrieve all reminders associated with specified resource

path Parameters
associated_resource_type
required
string
Enum: "source" "spectra" "gcn_event" "shift"

What underlying data the reminder is on: "sources" or "spectra" or "gcn_event" or "shift".

resource_id
required
string

The ID of the underlying data. This would be a string for a source ID or an integer for other data types like spectrum or gcn_event.

Responses

200
400
get/api/associated_resource_type/resource_id/reminders
https://fritz.science/api/associated_resource_type/resource_id/reminders

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Retrieve all spectra associated with an Object

Retrieve all spectra associated with an Object

path Parameters
obj_id
required
string

ID of the object to retrieve spectra for

query Parameters
normalization
string

what normalization is needed for the spectra (e.g., "median"). If omitted, returns the original spectrum. Options for normalization are:

  • median: normalize the flux to have median==1

Responses

200
400
get/api/sources/obj_id/spectra
https://fritz.science/api/sources/obj_id/spectra

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve all annotations associated with specified

Retrieve all annotations associated with specified resource

path Parameters
associated_resource_type
required
string
Enum: "sources" "spectra"

What underlying data the annotation is on: must be one of either "sources" or "spectra".

resource_id
required
string

The ID of the underlying data. This would be a string for a source ID or an integer for other data types like spectra.

Responses

200
400
get/api/associated_resource_type/resource_id/annotations
https://fritz.science/api/associated_resource_type/resource_id/annotations

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Retrieve an annotation

Retrieve an annotation

path Parameters
associated_resource_type
required
string
Enum: "sources" "spectra"

What underlying data the annotation is on: must be one of either "sources" or "spectra".

resource_id
required
string

The ID of the underlying data. This would be a string for a source ID or an integer for other data types like spectra.

annotation_id
required
integer

Responses

200
400
get/api/associated_resource_type/resource_id/annotations/annotation_id
https://fritz.science/api/associated_resource_type/resource_id/annotations/annotation_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a spectrum

Retrieve a spectrum

path Parameters
spectrum_id
required
integer

Responses

200
403
get/api/spectra/spectrum_id
https://fritz.science/api/spectra/spectrum_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Update spectrum

Update spectrum

path Parameters
spectrum_id
required
integer
Request Body schema: application/json
assignment_id
integer

ID of the classical assignment that generated this spectrum, if any.

altdata
any

Miscellaneous alternative metadata.

wavelengths
required
Array of numbers

Wavelengths of the spectrum [Angstrom].

external_reducer
string Nullable
Default: null

Free text provided as an external reducer

label
string

User defined label (can be used to replace default instrument/date labeling on plot legends).

followup_request_id
integer

ID of the Followup request that generated this spectrum, if any.

units
string

Units of the fluxes/errors. Options are Jy, AB, or erg/s/cm/cm/AA).

group_ids
any
Default: []

IDs of the Groups to share this spectrum with. Set to "all" to make this spectrum visible to all users.

errors
Array of numbers

Errors on the fluxes of the spectrum [F_lambda, same units as fluxes.]

external_observer
string Nullable
Default: null

Free text provided as an external observer

observed_at
required
string <date-time>

The ISO UTC time the spectrum was taken.

observed_by
Array of integers
Default: []

IDs of the Users who observed this Spectrum, or to use as points of contact given an external observer.

fluxes
required
Array of numbers

Flux of the Spectrum [F_lambda, arbitrary units].

instrument_id
required
integer

ID of the Instrument that acquired the Spectrum.

type
string
Enum: "source" "host" "host_center"

Type of spectrum. One of: 'source''host''host_center'. Defaults to 'fsource'.

obj_id
required
string

ID of this Spectrum's Obj.

origin
string

Origin of the spectrum.

reduced_by
Array of integers
Default: []

IDs of the Users who reduced this Spectrum, or to use as points of contact given an external reducer.

Responses

200
400
put/api/spectra/spectrum_id
https://fritz.science/api/spectra/spectrum_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "assignment_id": 0,
  • "altdata": null,
  • "wavelengths":
    [
    ],
  • "external_reducer": null,
  • "label": "string",
  • "followup_request_id": 0,
  • "units": "string",
  • "group_ids": [ ],
  • "errors":
    [
    ],
  • "external_observer": null,
  • "observed_at": "2022-08-17T20:51:00Z",
  • "observed_by": [ ],
  • "fluxes":
    [
    ],
  • "instrument_id": 0,
  • "type": "source",
  • "obj_id": "string",
  • "origin": "string",
  • "reduced_by": [ ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete a spectrum

Delete a spectrum

path Parameters
spectrum_id
required
integer

Responses

200
400
delete/api/spectra/spectrum_id
https://fritz.science/api/spectra/spectrum_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve multiple spectra with given criteria

Retrieve multiple spectra with given criteria

query Parameters
minimalPayload
boolean

If true, return only the minimal metadata about each spectrum, instead of returning the potentially large payload that includes wavelength/flux and also comments and annotations. The metadata that is always included is: id, obj_id, owner_id, origin, type, label, observed_at, created_at, modified, instrument_id, instrument_name, original_file_name, followup_request_id, assignment_id, and altdata.

observedBefore
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, return only spectra observed before this time.

observedAfter
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, return only spectra observed after this time.

objID
string

Return any spectra on an object with ID that has a (partial) match to this argument (i.e., the given argument is "in" the object's ID).

instrumentIDs
any

If provided, filter only spectra observed with one of these instrument IDs.

groupIDs
list

If provided, filter only spectra saved to one of these group IDs.

followupRequestIDs
list

If provided, filter only spectra associate with these followup request IDs.

assignmentIDs
list

If provided, filter only spectra associate with these assignment request IDs.

origin
string

Return any spectra that have an origin with a (partial) match to any of the values in this comma separated list.

label
string

Return any spectra that have an origin with a (partial) match to any of the values in this comma separated list.

type
string

Return spectra of the given type or types (match multiple values using a comma separated list). Types of spectra are defined in the config, e.g., source, host or host_center.

commentsFilter
Array of strings

Comma-separated string of comment text to filter for spectra matching.

commentsFilterAuthor
string

Comma separated string of authors. Only comments from these authors are used when filtering with the commentsFilter.

commentsFilterBefore
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, only return sources that have comments before this time.

commentsFilterAfter
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, only return sources that have comments after this time.

get/api/spectra
https://fritz.science/api/spectra

Upload spectrum

Upload spectrum

Request Body schema: application/json
assignment_id
integer

ID of the classical assignment that generated this spectrum, if any.

altdata
any

Miscellaneous alternative metadata.

wavelengths
required
Array of numbers

Wavelengths of the spectrum [Angstrom].

external_reducer
string Nullable
Default: null

Free text provided as an external reducer

label
string

User defined label (can be used to replace default instrument/date labeling on plot legends).

followup_request_id
integer

ID of the Followup request that generated this spectrum, if any.

units
string

Units of the fluxes/errors. Options are Jy, AB, or erg/s/cm/cm/AA).

group_ids
any
Default: []

IDs of the Groups to share this spectrum with. Set to "all" to make this spectrum visible to all users.

errors
Array of numbers

Errors on the fluxes of the spectrum [F_lambda, same units as fluxes.]

external_observer
string Nullable
Default: null

Free text provided as an external observer

observed_at
required
string <date-time>

The ISO UTC time the spectrum was taken.

observed_by
Array of integers
Default: []

IDs of the Users who observed this Spectrum, or to use as points of contact given an external observer.

fluxes
required
Array of numbers

Flux of the Spectrum [F_lambda, arbitrary units].

instrument_id
required
integer

ID of the Instrument that acquired the Spectrum.

type
string
Enum: "source" "host" "host_center"

Type of spectrum. One of: 'source''host''host_center'. Defaults to 'fsource'.

obj_id
required
string

ID of this Spectrum's Obj.

origin
string

Origin of the spectrum.

reduced_by
Array of integers
Default: []

IDs of the Users who reduced this Spectrum, or to use as points of contact given an external reducer.

Responses

200
400
post/api/spectra
https://fritz.science/api/spectra

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "assignment_id": 0,
  • "altdata": null,
  • "wavelengths":
    [
    ],
  • "external_reducer": null,
  • "label": "string",
  • "followup_request_id": 0,
  • "units": "string",
  • "group_ids": [ ],
  • "errors":
    [
    ],
  • "external_observer": null,
  • "observed_at": "2022-08-17T20:51:00Z",
  • "observed_by": [ ],
  • "fluxes":
    [
    ],
  • "instrument_id": 0,
  • "type": "source",
  • "obj_id": "string",
  • "origin": "string",
  • "reduced_by": [ ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Parse spectrum from ASCII file

Parse spectrum from ASCII file

Request Body schema: application/json
wave_column
integer
Default: 0

The 0-based index of the ASCII column corresponding to the wavelength values of the spectrum (default 0).

ascii
required
string

The content of the ASCII file to be parsed.

The file can optionally contain a header which will be parsed and stored.

The lines that make up the ASCII header must appear at the beginning of the file and all be formatted the same way within a single file. They can be formatted in one of two ways.

1) # KEY: VALUE
2) # KEY = VALUE / COMMENT

astropy.io.ascii.read is used to load the table into Python memory. An attempt is made to parse the header first using method 1, then method 2.

Example of format 1:

# XTENSION: IMAGE
# BITPIX: -32
# NAXIS: 2
# NAXIS1: 433
# NAXIS2: 1
# RA: 230.14

Example of format 2:

# FILTER  = 'clear   '           / Filter
# EXPTIME =              600.003 / Total exposure time (sec); avg. of R&B
# OBJECT  = 'ZTF20abpuxna'       / User-specified object name
# TARGNAME= 'ZTF20abpuxna_S1'    / Target name (from starlist)
# DICHNAME= '560     '           / Dichroic
# GRISNAME= '400/3400'           / Blue grism
# GRANAME = '400/8500'           / Red grating
# WAVELEN =        7829.41406250 / Red specified central wavelength
# BLUFILT = 'clear   '           / Blue filter
# REDFILT = 'Clear   '           / Red filter
# SLITNAME= 'long_1.0'           / Slitmask
# INSTRUME= 'LRIS+LRISBLUE'      / Camera
# TELESCOP= 'Keck I  '           / Telescope name
# BLUDET  = 'LRISB   '           / LRIS blue detector
# REDDET  = 'LRISR3  '           / LRIS red detector
# OBSERVER= 'Andreoni Anand De'  / Observer name
# REDUCER = '        '           / Name of reducer
# LPIPEVER= '2020.06 '           / LPipe version number
# HOSTNAME= 'gayatri '           / LPipe host computer name
# IDLVER  = '8.1     '           / IDL version number
# DATE    = '2020-09-15T09:47:10' / UT end of last exposure

The data must be at least 2 column ascii (wavelength, flux). If flux errors are provided in an additional column, the column must be specified in the call. If more than 2 columns are given, by default the first two are interpreted as (wavelength, flux). The column indices of each of these arguments can be controlled by passing the integer column index to the POST JSON.

Examples of valid data sections:

Many-column ASCII:

   10295.736  2.62912e-16  1.67798e-15  2.24407e-17    4084    75.956  5.48188e+15  0
   10296.924  2.96887e-16  1.57197e-15  2.21469e-17    4085    75.959  5.42569e+15  0
   10298.112  3.20429e-16  1.45017e-15  2.16863e-17    4086    75.962  5.36988e+15  0
   10299.301  3.33367e-16  1.06116e-15  1.94187e-17    4087    75.965  5.31392e+15  0
   10300.489  3.09943e-16  6.99539e-16  1.67183e-17    4088    75.968  5.25836e+15  0
   10301.678  3.48273e-16  5.56194e-16  1.59555e-17    4089    75.972  5.20314e+15  0
   10302.866  3.48102e-16  5.28483e-16  1.58033e-17    4090    75.975  5.15146e+15  0
   10304.055  3.78640e-16  6.00997e-16  1.67462e-17    4091    75.978  5.10058e+15  0
   10305.243  4.28820e-16  7.18759e-16  1.81534e-17    4092    75.981  5.05032e+15  0
   10306.432  4.13152e-16  7.54203e-16  1.83965e-17    4093    75.984  5.00097e+15  0

3-column ASCII:

8993.2 1.148e-16 7.919e-34
9018.7 1.068e-16 6.588e-34
9044.3 1.056e-16 5.660e-34
9069.9 9.763e-17 5.593e-34
9095.4 1.048e-16 8.374e-34
9121.0 1.026e-16 8.736e-34
9146.6 8.472e-17 9.505e-34
9172.1 9.323e-17 7.592e-34
9197.7 1.050e-16 7.863e-34
9223.3 8.701e-17 7.135e-34

2-column ASCII:

      10045.1    0.0217740
      10046.3    0.0182158
      10047.4    0.0204764
      10048.6    0.0231833
      10049.8    0.0207157
      10051.0    0.0185226
      10052.2    0.0200072
      10053.4    0.0205159
      10054.5    0.0199460
      10055.7    0.0210533

2-column ASCII:

7911.60 1.045683
7920.80 1.046414
7930.00 1.235362
7939.20 0.783466
7948.40 1.116153
7957.60 1.375844
7966.80 1.029127
7976.00 1.019637
7985.20 0.732859
7994.40 1.236514
flux_column
integer
Default: 1

The 0-based index of the ASCII column corresponding to the flux values of the spectrum (default 1).

fluxerr_column
integer Nullable
Default: null

The 0-based index of the ASCII column corresponding to the flux error values of the spectrum (default None). If a column for errors is provided, set to the corresponding 0-based column number, otherwise, it will be ignored.

Responses

200
400
post/api/spectra/parse/ascii
https://fritz.science/api/spectra/parse/ascii

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "wave_column": 0,
  • "ascii": "string",
  • "flux_column": 1,
  • "fluxerr_column": null
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "wavelengths":
    [
    ],
  • "fluxes":
    [
    ],
  • "errors":
    [
    ],
  • "units": "string",
  • "obj_id": "string",
  • "observed_at": "2022-08-17T20:51:00Z",
  • "origin": "string",
  • "type": "source",
  • "label": "string",
  • "instrument_id": 0,
  • "followup_request_id": 0,
  • "assignment_id": 0,
  • "altdata": null,
  • "original_file_string": "string",
  • "original_file_filename": "string"
}

Upload spectrum from ASCII file

Upload spectrum from ASCII file

Request Body schema: application/json
wave_column
integer
Default: 0

The 0-based index of the ASCII column corresponding to the wavelength values of the spectrum (default 0).

assignment_id
integer

ID of the classical assignment that generated this spectrum, if any.

external_reducer
string Nullable
Default: null

Free text provided as an external reducer

label
string

User defined label to be placed in plot legends, instead of the default -.

followup_request_id
integer

ID of the Followup request that generated this spectrum, if any.

group_ids
Array of integers

The IDs of the groups to share this spectrum with.

ascii
required
string

The content of the ASCII file to be parsed.

The file can optionally contain a header which will be parsed and stored.

The lines that make up the ASCII header must appear at the beginning of the file and all be formatted the same way within a single file. They can be formatted in one of two ways.

1) # KEY: VALUE
2) # KEY = VALUE / COMMENT

astropy.io.ascii.read is used to load the table into Python memory. An attempt is made to parse the header first using method 1, then method 2.

Example of format 1:

# XTENSION: IMAGE
# BITPIX: -32
# NAXIS: 2
# NAXIS1: 433
# NAXIS2: 1
# RA: 230.14

Example of format 2:

# FILTER  = 'clear   '           / Filter
# EXPTIME =              600.003 / Total exposure time (sec); avg. of R&B
# OBJECT  = 'ZTF20abpuxna'       / User-specified object name
# TARGNAME= 'ZTF20abpuxna_S1'    / Target name (from starlist)
# DICHNAME= '560     '           / Dichroic
# GRISNAME= '400/3400'           / Blue grism
# GRANAME = '400/8500'           / Red grating
# WAVELEN =        7829.41406250 / Red specified central wavelength
# BLUFILT = 'clear   '           / Blue filter
# REDFILT = 'Clear   '           / Red filter
# SLITNAME= 'long_1.0'           / Slitmask
# INSTRUME= 'LRIS+LRISBLUE'      / Camera
# TELESCOP= 'Keck I  '           / Telescope name
# BLUDET  = 'LRISB   '           / LRIS blue detector
# REDDET  = 'LRISR3  '           / LRIS red detector
# OBSERVER= 'Andreoni Anand De'  / Observer name
# REDUCER = '        '           / Name of reducer
# LPIPEVER= '2020.06 '           / LPipe version number
# HOSTNAME= 'gayatri '           / LPipe host computer name
# IDLVER  = '8.1     '           / IDL version number
# DATE    = '2020-09-15T09:47:10' / UT end of last exposure

The data must be at least 2 column ascii (wavelength, flux). If flux errors are provided in an additional column, the column must be specified in the call. If more than 2 columns are given, by default the first two are interpreted as (wavelength, flux). The column indices of each of these arguments can be controlled by passing the integer column index to the POST JSON.

Examples of valid data sections:

Many-column ASCII:

   10295.736  2.62912e-16  1.67798e-15  2.24407e-17    4084    75.956  5.48188e+15  0
   10296.924  2.96887e-16  1.57197e-15  2.21469e-17    4085    75.959  5.42569e+15  0
   10298.112  3.20429e-16  1.45017e-15  2.16863e-17    4086    75.962  5.36988e+15  0
   10299.301  3.33367e-16  1.06116e-15  1.94187e-17    4087    75.965  5.31392e+15  0
   10300.489  3.09943e-16  6.99539e-16  1.67183e-17    4088    75.968  5.25836e+15  0
   10301.678  3.48273e-16  5.56194e-16  1.59555e-17    4089    75.972  5.20314e+15  0
   10302.866  3.48102e-16  5.28483e-16  1.58033e-17    4090    75.975  5.15146e+15  0
   10304.055  3.78640e-16  6.00997e-16  1.67462e-17    4091    75.978  5.10058e+15  0
   10305.243  4.28820e-16  7.18759e-16  1.81534e-17    4092    75.981  5.05032e+15  0
   10306.432  4.13152e-16  7.54203e-16  1.83965e-17    4093    75.984  5.00097e+15  0

3-column ASCII:

8993.2 1.148e-16 7.919e-34
9018.7 1.068e-16 6.588e-34
9044.3 1.056e-16 5.660e-34
9069.9 9.763e-17 5.593e-34
9095.4 1.048e-16 8.374e-34
9121.0 1.026e-16 8.736e-34
9146.6 8.472e-17 9.505e-34
9172.1 9.323e-17 7.592e-34
9197.7 1.050e-16 7.863e-34
9223.3 8.701e-17 7.135e-34

2-column ASCII:

      10045.1    0.0217740
      10046.3    0.0182158
      10047.4    0.0204764
      10048.6    0.0231833
      10049.8    0.0207157
      10051.0    0.0185226
      10052.2    0.0200072
      10053.4    0.0205159
      10054.5    0.0199460
      10055.7    0.0210533

2-column ASCII:

7911.60 1.045683
7920.80 1.046414
7930.00 1.235362
7939.20 0.783466
7948.40 1.116153
7957.60 1.375844
7966.80 1.029127
7976.00 1.019637
7985.20 0.732859
7994.40 1.236514
filename
required
string

The original filename (for bookkeeping purposes).

observed_at
required
string <date-time>

The ISO UTC time the spectrum was taken.

observed_by
Array of integers
Default: []

IDs of the Users who observed this Spectrum, or to use as points of contact given an external observer.

external_observer
string Nullable
Default: null

Free text provided as an external observer

flux_column
integer
Default: 1

The 0-based index of the ASCII column corresponding to the flux values of the spectrum (default 1).

instrument_id
required
integer

The ID of the instrument that took the spectrum.

fluxerr_column
integer Nullable
Default: null

The 0-based index of the ASCII column corresponding to the flux error values of the spectrum (default None). If a column for errors is provided, set to the corresponding 0-based column number, otherwise, it will be ignored.

type
string
Enum: "source" "host" "host_center"

Type of spectrum. One of: 'source', 'host', 'host_center'. Defaults to 'fsource'.

obj_id
required
string

The ID of the object that the spectrum is of.

reduced_by
Array of integers
Default: []

IDs of the Users who reduced this Spectrum, or to use as points of contact given an external reducer.

Responses

200
400
post/api/spectra/ascii
https://fritz.science/api/spectra/ascii

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "wave_column": 0,
  • "assignment_id": 0,
  • "external_reducer": null,
  • "label": "string",
  • "followup_request_id": 0,
  • "group_ids":
    [
    ],
  • "ascii": "string",
  • "filename": "string",
  • "observed_at": "2022-08-17T20:51:00Z",
  • "observed_by": [ ],
  • "external_observer": null,
  • "flux_column": 1,
  • "instrument_id": 0,
  • "fluxerr_column": null,
  • "type": "source",
  • "obj_id": "string",
  • "reduced_by": [ ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Create synthetic photometry from a spectrum

Create synthetic photometry from a spectrum

path Parameters
spectrum_id
required
integer
query Parameters
filters
required
list

List of filters

Responses

200
400
post/api/spectra/synthphot/spectrum_id
https://fritz.science/api/spectra/synthphot/spectrum_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve spectra for given instrument within date

Retrieve spectra for given instrument within date range

query Parameters
instrument_ids
list of integers

Instrument id numbers of spectrum. If None, retrieve for all instruments.

min_date
ISO UTC date string

Minimum UTC date of range in ISOT format. If None, open ended range.

max_date
ISO UTC date string

Maximum UTC date of range in ISOT format. If None, open ended range.

Responses

200
400
get/api/spectra/range
https://fritz.science/api/spectra/range

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a spectrum

Retrieve a spectrum

path Parameters
spectrum_id
required
integer

Responses

200
403
get/api/spectrum/spectrum_id
https://fritz.science/api/spectrum/spectrum_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Update spectrum

Update spectrum

path Parameters
spectrum_id
required
integer
Request Body schema: application/json
assignment_id
integer

ID of the classical assignment that generated this spectrum, if any.

altdata
any

Miscellaneous alternative metadata.

wavelengths
required
Array of numbers

Wavelengths of the spectrum [Angstrom].

external_reducer
string Nullable
Default: null

Free text provided as an external reducer

label
string

User defined label (can be used to replace default instrument/date labeling on plot legends).

followup_request_id
integer

ID of the Followup request that generated this spectrum, if any.

units
string

Units of the fluxes/errors. Options are Jy, AB, or erg/s/cm/cm/AA).

group_ids
any
Default: []

IDs of the Groups to share this spectrum with. Set to "all" to make this spectrum visible to all users.

errors
Array of numbers

Errors on the fluxes of the spectrum [F_lambda, same units as fluxes.]

external_observer
string Nullable
Default: null

Free text provided as an external observer

observed_at
required
string <date-time>

The ISO UTC time the spectrum was taken.