Spaces:
Sleeping

File size: 2,025 Bytes
1a49047
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3b22049
1a49047
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c5c7be4
1a49047
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// API types — mirror src/jellyscope/model/schemas.py. Keep in sync by hand;
// the wire contract is small and stable.

export interface FilterInfo {
  index: number;
  name: string;
  wavelength: number;
}

export interface ClumpListItem {
  clump_id: number;
  x0: number;
  y0: number;
  area_pix: number;
  component: string;
  inside: boolean | null;
}

export interface DatasetsResponse {
  datasets: string[];
  default: string;
}
export interface DatacubesResponse {
  datacubes: string[];
}
export interface FiltersResponse {
  filters: FilterInfo[];
}
export interface ClumpsListResponse {
  clumps: ClumpListItem[];
}

export interface ClumpPropertyEntry {
  label: string;
  value: string;
}
export interface ClumpDetailResponse {
  properties: { entries: ClumpPropertyEntry[] };
  boundary: [number, number][];
}

export interface PixelClumpResponse {
  clump_id: number | null;
  ambiguous: boolean;
}

export interface ClumpSeparation {
  clump_a: number;
  clump_b: number;
  sep_arcsec: number;
  sep_pc: number | null;
}
export interface ClumpSeparationsResponse {
  distance_mpc: number | null;
  pairs: ClumpSeparation[];
}

// Plotly figure as delivered by the backend. We treat data/layout loosely —
// the science core reads specific keys (meta.wcs, meta.imageBounds, trace
// names) but Plotly owns the full shape.
export interface Figure {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  data: Record<string, any>[];
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  layout: Record<string, any>;
}

export interface ViewerResponse {
  figure: Figure;
  filter_name: string;
}
export interface RGBViewerResponse {
  figure: Figure;
  r_filter: string;
  g_filter: string;
  b_filter: string;
}

// Injected by the Jinja template as a <script id="bootstrap"> JSON block.
export interface Bootstrap {
  datasets: string[];
  default_dataset: string;
  default_datacube: string;
  datacubes: string[];
  filters: string[];
  wavelengths: Record<string, number>;
}