Proposal API¤
This is an API for working with proposals. It lets you list runs, read metadata from MyMDC, open data with EXtra-data, access DAMNIT results, and make simple run timelines.
Quick example:
from extra.proposal import Proposal
# Open a proposal
proposal = Proposal(1234)
# Print general information about the proposal
proposal.info()
# Get a table of samples and the runs they have
proposal.samples_table()
# Get DAQ data from extra-data for run 10
proposal[10].data()
# Get DAMNIT data through the DAMNIT API
proposal[10].damnit()
extra.proposal.Proposal ¤
Proposal(proposal: int | str, user_id: Optional[str] = None, user_secret: Optional[str] = None, user_email: Optional[str] = None, timeout=10)
Proposal object.
It can be instantiated as Proposal(2112) or Proposal("p002112")
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
proposal
|
int | str
|
Proposal number. |
required |
user_id
|
Optional[str]
|
UID (can be generated at https://in.xfel.eu/metadata/oauth/applications). Defaults to None. |
None
|
user_secret
|
Optional[str]
|
Secret (can be generated at https://in.xfel.eu/metadata/oauth/applications). Defaults to None. |
None
|
user_email
|
Optional[str]
|
User's email. Defaults to None. |
None
|
Raises:
| Type | Description |
|---|---|
ProposalNotFoundError
|
The proposal does not exist. |
extra.proposal.RunReference ¤
A reference to a specific run within a proposal.
Provides access to run data, metadata, and DAMNIT results. Typically obtained by indexing a Proposal object.
Example:
prop = Proposal(1234)
run = prop[42] # Returns a RunReference
data = run.data() # Open DAQ data with extra_data
data ¤
Open the data of this run with extra_data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Additional arguments passed to open_run(). |
{}
|
Returns:
| Type | Description |
|---|---|
DataCollection
|
A DataCollection for this run. |
damnit ¤
Access DAMNIT results from this run.
Returns:
| Type | Description |
|---|---|
RunVariables
|
A RunVariables object for this run. |
sample_name ¤
run_type ¤
Get the run type from myMdC for this run.
Returns:
| Type | Description |
|---|---|
str
|
The run type (e.g. "Sample", "Dark", "Calibration"). |
techniques ¤
plot_timeline ¤
Plot a timeline of when this run was taken, migrated, and calibrated.
Returns:
| Type | Description |
|---|---|
Axes
|
A matplotlib.axes.Axes object. |