deepcontrail-core 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,211 @@
1
+ Copyright (c) 2026 EUROCONTROL
2
+
3
+ # European Union Public Licence v. 1.2
4
+
5
+ EUPL © the European Union 2007, 2016
6
+
7
+ This European Union Public Licence (the *EUPL*) applies to the Work (as defined below) which is provided under the
8
+ terms of this Licence. Any use of the Work, other than as authorised under this Licence is prohibited (to the extent such
9
+ use is covered by a right of the copyright holder of the Work).
10
+ The Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following
11
+ notice immediately following the copyright notice for the Work:
12
+
13
+ *Licensed under the EUPL or has expressed by any other means his willingness to license under the EUPL.*
14
+
15
+ ## 1. Definitions
16
+
17
+ In this Licence, the following terms have the following meaning:
18
+
19
+ * *The Licence*:this Licence.
20
+ * *The Original Work*:the work or software distributed or communicated by the Licensor under this Licence, available
21
+ as Source Code and also as Executable Code as the case may be.
22
+ * *Derivative Works*:the works or software that could be created by the Licensee, based upon the Original Work or
23
+ modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work
24
+ required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in
25
+ the country mentioned in Article 15.
26
+ * *The Work*:the Original Work or its Derivative Works.
27
+ * *The Source Code*:the human-readable form of the Work which is the most convenient for people to study and
28
+ modify.
29
+ * *The Executable Code*:any code which has generally been compiled and which is meant to be interpreted by
30
+ a computer as a program.
31
+ * *The Licensor*:the natural or legal person that distributes or communicates the Work under the Licence.
32
+ * *Contributor(s)*:any natural or legal person who modifies the Work under the Licence, or otherwise contributes to
33
+ the creation of a Derivative Work.
34
+ * *The Licensee* or *You*:any natural or legal person who makes any usage of the Work under the terms of the
35
+ Licence.
36
+ * *Distribution* or *Communication*:any act of selling, giving, lending, renting, distributing, communicating,
37
+ transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential
38
+ functionalities at the disposal of any other natural or legal person.
39
+
40
+ ## 2. Scope of the rights granted by the Licence
41
+
42
+ The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for
43
+ the duration of copyright vested in the Original Work:
44
+
45
+ * use the Work in any circumstance and for all usage,
46
+ * reproduce the Work,
47
+ * modify the Work, and make Derivative Works based upon the Work,
48
+ * communicate to the public, including the right to make available or display the Work or copies thereof to the public
49
+ and perform publicly, as the case may be, the Work,
50
+ * distribute the Work or copies thereof,
51
+ * lend and rent the Work or copies thereof,
52
+ * sublicense rights in the Work or copies thereof.
53
+ Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the
54
+ applicable law permits so.
55
+ In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed
56
+ by law in order to make effective the licence of the economic rights here above listed.
57
+ The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the
58
+ extent necessary to make use of the rights granted on the Work under this Licence.
59
+
60
+ ## 3. Communication of the Source Code
61
+
62
+ The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as
63
+ Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with
64
+ each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to
65
+ the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to
66
+ distribute or communicate the Work.
67
+
68
+ ## 4. Limitations on copyright
69
+
70
+ Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the
71
+ exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations
72
+ thereto.
73
+
74
+ ## 5. Obligations of the Licensee
75
+
76
+ The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those
77
+ obligations are the following:
78
+
79
+ **Attribution right**: The Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to
80
+ the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the
81
+ Licence with every copy of the Work he/she distributes or communicates. The Licensee must cause any Derivative Work
82
+ to carry prominent notices stating that the Work has been modified and the date of modification.
83
+
84
+ **Copyleft clause**: If the Licensee distributes or communicates copies of the Original Works or Derivative Works, this
85
+ Distribution or Communication will be done under the terms of this Licence or of a later version of this Licence unless
86
+ the Original Work is expressly distributed only under this version of the Licence — for example by communicating
87
+ *EUPL v. 1.2 only*. The Licensee (becoming Licensor) cannot offer or impose any additional terms or conditions on the
88
+ Work or Derivative Work that alter or restrict the terms of the Licence.
89
+
90
+ **Compatibility clause**: If the Licensee Distributes or Communicates Derivative Works or copies thereof based upon both
91
+ the Work and another work licensed under a Compatible Licence, this Distribution or Communication can be done
92
+ under the terms of this Compatible Licence. For the sake of this clause, *Compatible Licence* refers to the licences listed
93
+ in the appendix attached to this Licence. Should the Licensee's obligations under the Compatible Licence conflict with
94
+ his/her obligations under this Licence, the obligations of the Compatible Licence shall prevail.
95
+
96
+ **Provision of Source Code**: When distributing or communicating copies of the Work, the Licensee will provide
97
+ a machine-readable copy of the Source Code or indicate a repository where this Source will be easily and freely available
98
+ for as long as the Licensee continues to distribute or communicate the Work.
99
+ Legal Protection: This Licence does not grant permission to use the trade names, trademarks, service marks, or names
100
+ of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and
101
+ reproducing the content of the copyright notice.
102
+
103
+ ## 6. Chain of Authorship
104
+
105
+ The original Licensor warrants that the copyright in the Original Work granted hereunder is owned by him/her or
106
+ licensed to him/her and that he/she has the power and authority to grant the Licence.
107
+ Each Contributor warrants that the copyright in the modifications he/she brings to the Work are owned by him/her or
108
+ licensed to him/her and that he/she has the power and authority to grant the Licence.
109
+ Each time You accept the Licence, the original Licensor and subsequent Contributors grant You a licence to their contributions
110
+ to the Work, under the terms of this Licence.
111
+
112
+ ## 7. Disclaimer of Warranty
113
+
114
+ The Work is a work in progress, which is continuously improved by numerous Contributors. It is not a finished work
115
+ and may therefore contain defects or *bugs* inherent to this type of development.
116
+ For the above reason, the Work is provided under the Licence on an *as is* basis and without warranties of any kind
117
+ concerning the Work, including without limitation merchantability, fitness for a particular purpose, absence of defects or
118
+ errors, accuracy, non-infringement of intellectual property rights other than copyright as stated in Article 6 of this
119
+ Licence.
120
+ This disclaimer of warranty is an essential part of the Licence and a condition for the grant of any rights to the Work.
121
+
122
+ ## 8. Disclaimer of Liability
123
+
124
+ Except in the cases of wilful misconduct or damages directly caused to natural persons, the Licensor will in no event be
125
+ liable for any direct or indirect, material or moral, damages of any kind, arising out of the Licence or of the use of the
126
+ Work, including without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, loss
127
+ of data or any commercial damage, even if the Licensor has been advised of the possibility of such damage. However,
128
+ the Licensor will be liable under statutory product liability laws as far such laws apply to the Work.
129
+
130
+ ## 9. Additional agreements
131
+
132
+ While distributing the Work, You may choose to conclude an additional agreement, defining obligations or services
133
+ consistent with this Licence. However, if accepting obligations, You may act only on your own behalf and on your sole
134
+ responsibility, not on behalf of the original Licensor or any other Contributor, and only if You agree to indemnify,
135
+ defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against such Contributor by
136
+ the fact You have accepted any warranty or additional liability.
137
+
138
+ ## 10. Acceptance of the Licence
139
+
140
+ The provisions of this Licence can be accepted by clicking on an icon *I agree* placed under the bottom of a window
141
+ displaying the text of this Licence or by affirming consent in any other similar way, in accordance with the rules of
142
+ applicable law. Clicking on that icon indicates your clear and irrevocable acceptance of this Licence and all of its terms
143
+ and conditions.
144
+ Similarly, you irrevocably accept this Licence and all of its terms and conditions by exercising any rights granted to You
145
+ by Article 2 of this Licence, such as the use of the Work, the creation by You of a Derivative Work or the Distribution
146
+ or Communication by You of the Work or copies thereof.
147
+
148
+ ## 11. Information to the public
149
+
150
+ In case of any Distribution or Communication of the Work by means of electronic communication by You (for example,
151
+ by offering to download the Work from a remote location) the distribution channel or media (for example, a website)
152
+ must at least provide to the public the information requested by the applicable law regarding the Licensor, the Licence
153
+ and the way it may be accessible, concluded, stored and reproduced by the Licensee.
154
+
155
+ ## 12. Termination of the Licence
156
+
157
+ The Licence and the rights granted hereunder will terminate automatically upon any breach by the Licensee of the terms
158
+ of the Licence.
159
+ Such a termination will not terminate the licences of any person who has received the Work from the Licensee under
160
+ the Licence, provided such persons remain in full compliance with the Licence.
161
+
162
+ ## 13. Miscellaneous
163
+
164
+ Without prejudice of Article 9 above, the Licence represents the complete agreement between the Parties as to the
165
+ Work.
166
+ If any provision of the Licence is invalid or unenforceable under applicable law, this will not affect the validity or
167
+ enforceability of the Licence as a whole. Such provision will be construed or reformed so as necessary to make it valid
168
+ and enforceable.
169
+ The European Commission may publish other linguistic versions or new versions of this Licence or updated versions of
170
+ the Appendix, so far this is required and reasonable, without reducing the scope of the rights granted by the Licence.
171
+ New versions of the Licence will be published with a unique version number.
172
+ All linguistic versions of this Licence, approved by the European Commission, have identical value. Parties can take
173
+ advantage of the linguistic version of their choice.
174
+
175
+ ## 14. Jurisdiction
176
+
177
+ Without prejudice to specific agreement between parties,
178
+
179
+ * any litigation resulting from the interpretation of this License, arising between the European Union institutions,
180
+ bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice
181
+ of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union,
182
+ * any litigation arising between other parties and resulting from the interpretation of this License, will be subject to
183
+ the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business.
184
+
185
+ ## 15. Applicable Law
186
+
187
+ Without prejudice to specific agreement between parties,
188
+
189
+ * this Licence shall be governed by the law of the European Union Member State where the Licensor has his seat,
190
+ resides or has his registered office,
191
+ * this licence shall be governed by Belgian law if the Licensor has no seat, residence or registered office inside
192
+ a European Union Member State.
193
+
194
+ ## Appendix
195
+
196
+ *Compatible* Licences according to Article 5 EUPL are:
197
+
198
+ * GNU General Public License (GPL) v. 2, v. 3
199
+ * GNU Affero General Public License (AGPL) v. 3
200
+ * Open Software License (OSL) v. 2.1, v. 3.0
201
+ * Eclipse Public License (EPL) v. 1.0
202
+ * CeCILL v. 2.0, v. 2.1
203
+ * Mozilla Public Licence (MPL) v. 2
204
+ * GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
205
+ * Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for works other than software
206
+ * European Union Public Licence (EUPL) v. 1.1, v. 1.2
207
+ * Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong Reciprocity (LiLiQ-R+).
208
+ The European Commission may update this Appendix to later versions of the above licences without producing
209
+ a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the
210
+ covered Source Code from exclusive appropriation.
211
+ All other changes or additions to this Appendix require the production of a new EUPL version.
@@ -0,0 +1,149 @@
1
+ Metadata-Version: 2.4
2
+ Name: deepcontrail-core
3
+ Version: 0.1.0
4
+ Summary: DeepContrail core — torch-free dataset config, spectral bands, composites, splits and metrics.
5
+ Keywords: contrails,remote-sensing,satellite,GOES
6
+ Author: EUROCONTROL
7
+ License-Expression: EUPL-1.2
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
15
+ Requires-Dist: numpy>=1.24
16
+ Requires-Dist: pillow>=10.0
17
+ Requires-Dist: pydantic>=2.0
18
+ Requires-Dist: pyyaml>=6.0
19
+ Requires-Python: >=3.11
20
+ Project-URL: Homepage, https://github.com/eurocontrol-asu/deepcontrail
21
+ Project-URL: Documentation, https://github.com/eurocontrol-asu/deepcontrail/tree/main/packages/core#readme
22
+ Project-URL: Repository, https://github.com/eurocontrol-asu/deepcontrail
23
+ Project-URL: Issues, https://github.com/eurocontrol-asu/deepcontrail/issues
24
+ Project-URL: Changelog, https://github.com/eurocontrol-asu/deepcontrail/blob/main/CHANGELOG.md
25
+ Description-Content-Type: text/markdown
26
+
27
+ # deepcontrail-core
28
+
29
+ Torch-free foundations of [DeepContrail](https://github.com/eurocontrol-asu/deepcontrail): the
30
+ **dataset format** every task reads, its validation, false-colour composites built from named
31
+ bands, the train/validation/fold partition, and Dice/IoU metrics.
32
+
33
+ Depends only on numpy, Pillow, pydantic and PyYAML. `import deepcontrail.core` never imports torch.
34
+
35
+ ```bash
36
+ pip install deepcontrail-core
37
+ ```
38
+
39
+ ## The DeepContrail dataset format (version 1)
40
+
41
+ The library reads this layout and nothing else. Any producer can write it; for OpenContrails
42
+ the [converter](https://github.com/eurocontrol-asu/deepcontrail/tree/main/tools/opencontrails) does.
43
+
44
+ ```
45
+ <root>/
46
+ ├── metadata/dataset_info.json required: source, record counts, labels, pixel shift
47
+ ├── spectral_bands/bands.json required: what each channel of the arrays holds
48
+ ├── spectral_bands/{train,test}/<id>.npy required: (H, W, C) float32, e.g. brightness temperatures (K)
49
+ ├── semantic_masks/{train,test}/<id>.png binary consensus mask: 0 background, 255 contrail (1 accepted)
50
+ ├── probability_masks/{train,test}/<id>.npy (H, W) float32 annotator agreement in [0, 1]
51
+ ├── annotator_masks/{train,test}/<id>.npy (H, W, A) uint8 {0, 1}, one mask per annotator
52
+ ├── instance_masks/{train,test}/<id>.npy (N, H, W, A) int8: 1 = pixel of instance n for annotator a,
53
+ │ 0 = not, -1 = instance not drawn by that annotator
54
+ ├── images_semantic/{train,test}/<id>.jpg optional preview for people; never read by the library
55
+ └── splits_{train,test}.txt optional: the labelled ids of each split
56
+ ```
57
+
58
+ - **Splits.** `test/` is a holdout. The validation set is drawn from `train/` at load time:
59
+ the sorted ids are shuffled with the seed and the first `val_fraction` go to validation (or
60
+ k-fold with `fold` / `num_folds`). Training runs record the exact lists and their fingerprints.
61
+ - **Ids** are unique across splits and used as written: any file name is a valid id.
62
+ - **Context frames** (unlabelled neighbouring time steps of a scene) exist only in a dataset
63
+ that declares `"temporal": true` in `dataset_info.json`. There, `<id>_b<k>.npy` /
64
+ `<id>_a<k>.npy` (k steps before / after scene `<id>`, which must exist) are context frames
65
+ and need no labels. In any other dataset every file is a scene, so an id such as `tile_a1`
66
+ is an ordinary scene.
67
+ - **Labels** are only required for the task at hand: `semantic` for segmentation, `instance`
68
+ for instance segmentation. Every label kind declared in `dataset_info.json` must cover every
69
+ labelled scene, at the size of its spectral array.
70
+
71
+ All JSON and text files (`bands.json`, `dataset_info.json`, `splits_*.txt`) must be UTF-8 encoded.
72
+
73
+ ### `spectral_bands/bands.json`
74
+
75
+ ```json
76
+ {
77
+ "format_version": 1,
78
+ "sensor": "GOES-16 ABI",
79
+ "dtype": "float32",
80
+ "channels": [
81
+ {"index": 0, "key": "data_10um", "units": "K", "sensor_band": "13", "wavelength_um": 10.33},
82
+ {"index": 1, "key": "data_11um", "units": "K", "sensor_band": "14", "wavelength_um": 11.19}
83
+ ]
84
+ }
85
+ ```
86
+
87
+ `key` (unique, snake_case) is the name configs use; `index` is the channel's position. The
88
+ optional `sensor_band`, `wavelength_um`, `name` and `derived_from` (`[a, b]` for a channel
89
+ stored as `a - b`) describe the band for people; the library never interprets them. Another
90
+ sensor declares its own keys (for example `ir_105`, `ir_123` for MTG FCI).
91
+
92
+ ### `metadata/dataset_info.json`
93
+
94
+ ```json
95
+ {
96
+ "format_version": 1,
97
+ "source": "OpenContrails GOES-16 ABI TFRecords",
98
+ "records": {"train": 20088, "test": 1879},
99
+ "labels": ["semantic", "probability", "annotator", "instance"],
100
+ "recommended_pixel_shift": 0.0
101
+ }
102
+ ```
103
+
104
+ `recommended_pixel_shift` is the shift (pixels, right and down) that aligns the images with the
105
+ masks, or `null` if unknown. The data config's `pixel_shift` should use it; a dataset warns when
106
+ they differ.
107
+
108
+ Optional fields:
109
+ - `temporal` (`true`/`false`): whether the dataset stores context frames (see **Context
110
+ frames** above). Absent means `false`.
111
+ - `export`, `naming`, `pixel_shift_note`: provenance notes for people (for OpenContrails: the
112
+ export date, how files are named, why the shift is what it is); the library does not read
113
+ them.
114
+
115
+ Read both with `read_band_manifest(root)` and `read_dataset_info(root)`; a missing or invalid file
116
+ raises `DatasetContractError` naming the file.
117
+
118
+ Instance masks are read with `deepcontrail.core.readers.load_instance_masks(path)`, which raises
119
+ `ValueError` on an array that is not in the format above; `extract_all_annotator_instances(raw)`
120
+ turns one into each annotator's list of boolean contrail masks.
121
+
122
+ ## Composites
123
+
124
+ A composite is three channels built from named bands, each one band or the difference of two,
125
+ scaled from `bounds` to [0, 1]. The recipe lives in the experiment config:
126
+
127
+ ```yaml
128
+ data:
129
+ false_color:
130
+ channels:
131
+ - {bands: [data_12um, data_11um], bounds: [-4, 2]} # R
132
+ - {bands: [data_11um, cloud_top], bounds: [-4, 5]} # G
133
+ - {bands: [data_11um], bounds: [243, 303]} # B
134
+ ```
135
+
136
+ `false_color_from_spectral(bands, recipe, manifest)` builds it; a band key the dataset does not
137
+ declare is an error listing the available keys.
138
+
139
+ ## Validation
140
+
141
+ ```bash
142
+ deepcontrail-validate <root> [--task segmentation|instance] [--deep]
143
+ ```
144
+
145
+ The default checks read only the metadata and the file names (seconds): both metadata files,
146
+ the task's labels, every labelled scene has its labels and no label lacks its scene, record
147
+ counts and split lists. `--deep` also reads every file: arrays load with the declared channels
148
+ and finite values, masks match their scene's size and hold valid values, all scenes share one
149
+ size. It exits non-zero on any issue. From Python: `validate_dataset(root, task=..., deep=...)`.
@@ -0,0 +1,123 @@
1
+ # deepcontrail-core
2
+
3
+ Torch-free foundations of [DeepContrail](https://github.com/eurocontrol-asu/deepcontrail): the
4
+ **dataset format** every task reads, its validation, false-colour composites built from named
5
+ bands, the train/validation/fold partition, and Dice/IoU metrics.
6
+
7
+ Depends only on numpy, Pillow, pydantic and PyYAML. `import deepcontrail.core` never imports torch.
8
+
9
+ ```bash
10
+ pip install deepcontrail-core
11
+ ```
12
+
13
+ ## The DeepContrail dataset format (version 1)
14
+
15
+ The library reads this layout and nothing else. Any producer can write it; for OpenContrails
16
+ the [converter](https://github.com/eurocontrol-asu/deepcontrail/tree/main/tools/opencontrails) does.
17
+
18
+ ```
19
+ <root>/
20
+ ├── metadata/dataset_info.json required: source, record counts, labels, pixel shift
21
+ ├── spectral_bands/bands.json required: what each channel of the arrays holds
22
+ ├── spectral_bands/{train,test}/<id>.npy required: (H, W, C) float32, e.g. brightness temperatures (K)
23
+ ├── semantic_masks/{train,test}/<id>.png binary consensus mask: 0 background, 255 contrail (1 accepted)
24
+ ├── probability_masks/{train,test}/<id>.npy (H, W) float32 annotator agreement in [0, 1]
25
+ ├── annotator_masks/{train,test}/<id>.npy (H, W, A) uint8 {0, 1}, one mask per annotator
26
+ ├── instance_masks/{train,test}/<id>.npy (N, H, W, A) int8: 1 = pixel of instance n for annotator a,
27
+ │ 0 = not, -1 = instance not drawn by that annotator
28
+ ├── images_semantic/{train,test}/<id>.jpg optional preview for people; never read by the library
29
+ └── splits_{train,test}.txt optional: the labelled ids of each split
30
+ ```
31
+
32
+ - **Splits.** `test/` is a holdout. The validation set is drawn from `train/` at load time:
33
+ the sorted ids are shuffled with the seed and the first `val_fraction` go to validation (or
34
+ k-fold with `fold` / `num_folds`). Training runs record the exact lists and their fingerprints.
35
+ - **Ids** are unique across splits and used as written: any file name is a valid id.
36
+ - **Context frames** (unlabelled neighbouring time steps of a scene) exist only in a dataset
37
+ that declares `"temporal": true` in `dataset_info.json`. There, `<id>_b<k>.npy` /
38
+ `<id>_a<k>.npy` (k steps before / after scene `<id>`, which must exist) are context frames
39
+ and need no labels. In any other dataset every file is a scene, so an id such as `tile_a1`
40
+ is an ordinary scene.
41
+ - **Labels** are only required for the task at hand: `semantic` for segmentation, `instance`
42
+ for instance segmentation. Every label kind declared in `dataset_info.json` must cover every
43
+ labelled scene, at the size of its spectral array.
44
+
45
+ All JSON and text files (`bands.json`, `dataset_info.json`, `splits_*.txt`) must be UTF-8 encoded.
46
+
47
+ ### `spectral_bands/bands.json`
48
+
49
+ ```json
50
+ {
51
+ "format_version": 1,
52
+ "sensor": "GOES-16 ABI",
53
+ "dtype": "float32",
54
+ "channels": [
55
+ {"index": 0, "key": "data_10um", "units": "K", "sensor_band": "13", "wavelength_um": 10.33},
56
+ {"index": 1, "key": "data_11um", "units": "K", "sensor_band": "14", "wavelength_um": 11.19}
57
+ ]
58
+ }
59
+ ```
60
+
61
+ `key` (unique, snake_case) is the name configs use; `index` is the channel's position. The
62
+ optional `sensor_band`, `wavelength_um`, `name` and `derived_from` (`[a, b]` for a channel
63
+ stored as `a - b`) describe the band for people; the library never interprets them. Another
64
+ sensor declares its own keys (for example `ir_105`, `ir_123` for MTG FCI).
65
+
66
+ ### `metadata/dataset_info.json`
67
+
68
+ ```json
69
+ {
70
+ "format_version": 1,
71
+ "source": "OpenContrails GOES-16 ABI TFRecords",
72
+ "records": {"train": 20088, "test": 1879},
73
+ "labels": ["semantic", "probability", "annotator", "instance"],
74
+ "recommended_pixel_shift": 0.0
75
+ }
76
+ ```
77
+
78
+ `recommended_pixel_shift` is the shift (pixels, right and down) that aligns the images with the
79
+ masks, or `null` if unknown. The data config's `pixel_shift` should use it; a dataset warns when
80
+ they differ.
81
+
82
+ Optional fields:
83
+ - `temporal` (`true`/`false`): whether the dataset stores context frames (see **Context
84
+ frames** above). Absent means `false`.
85
+ - `export`, `naming`, `pixel_shift_note`: provenance notes for people (for OpenContrails: the
86
+ export date, how files are named, why the shift is what it is); the library does not read
87
+ them.
88
+
89
+ Read both with `read_band_manifest(root)` and `read_dataset_info(root)`; a missing or invalid file
90
+ raises `DatasetContractError` naming the file.
91
+
92
+ Instance masks are read with `deepcontrail.core.readers.load_instance_masks(path)`, which raises
93
+ `ValueError` on an array that is not in the format above; `extract_all_annotator_instances(raw)`
94
+ turns one into each annotator's list of boolean contrail masks.
95
+
96
+ ## Composites
97
+
98
+ A composite is three channels built from named bands, each one band or the difference of two,
99
+ scaled from `bounds` to [0, 1]. The recipe lives in the experiment config:
100
+
101
+ ```yaml
102
+ data:
103
+ false_color:
104
+ channels:
105
+ - {bands: [data_12um, data_11um], bounds: [-4, 2]} # R
106
+ - {bands: [data_11um, cloud_top], bounds: [-4, 5]} # G
107
+ - {bands: [data_11um], bounds: [243, 303]} # B
108
+ ```
109
+
110
+ `false_color_from_spectral(bands, recipe, manifest)` builds it; a band key the dataset does not
111
+ declare is an error listing the available keys.
112
+
113
+ ## Validation
114
+
115
+ ```bash
116
+ deepcontrail-validate <root> [--task segmentation|instance] [--deep]
117
+ ```
118
+
119
+ The default checks read only the metadata and the file names (seconds): both metadata files,
120
+ the task's labels, every labelled scene has its labels and no label lacks its scene, record
121
+ counts and split lists. `--deep` also reads every file: arrays load with the declared channels
122
+ and finite values, masks match their scene's size and hold valid values, all scenes share one
123
+ size. It exits non-zero on any issue. From Python: `validate_dataset(root, task=..., deep=...)`.
@@ -0,0 +1,54 @@
1
+ [project]
2
+ name = "deepcontrail-core"
3
+ version = "0.1.0"
4
+ description = "DeepContrail core — torch-free dataset config, spectral bands, composites, splits and metrics."
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "EUPL-1.2"
8
+ license-files = ["LICENSE"]
9
+ keywords = [
10
+ "contrails",
11
+ "remote-sensing",
12
+ "satellite",
13
+ "GOES",
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Science/Research",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Topic :: Scientific/Engineering :: Image Processing",
22
+ ]
23
+ dependencies = [
24
+ "numpy>=1.24",
25
+ "pillow>=10.0",
26
+ "pydantic>=2.0",
27
+ "pyyaml>=6.0",
28
+ ]
29
+
30
+ [[project.authors]]
31
+ name = "EUROCONTROL"
32
+
33
+ [project.scripts]
34
+ deepcontrail-validate = "deepcontrail.core.validate:main"
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/eurocontrol-asu/deepcontrail"
38
+ Documentation = "https://github.com/eurocontrol-asu/deepcontrail/tree/main/packages/core#readme"
39
+ Repository = "https://github.com/eurocontrol-asu/deepcontrail"
40
+ Issues = "https://github.com/eurocontrol-asu/deepcontrail/issues"
41
+ Changelog = "https://github.com/eurocontrol-asu/deepcontrail/blob/main/CHANGELOG.md"
42
+
43
+ [dependency-groups]
44
+ dev = [
45
+ "pytest>=7.4",
46
+ "pyright>=1.1",
47
+ ]
48
+
49
+ [build-system]
50
+ requires = ["uv_build>=0.10.2,<0.14.0"]
51
+ build-backend = "uv_build"
52
+
53
+ [tool.uv.build-backend]
54
+ module-name = "deepcontrail.core"
@@ -0,0 +1,44 @@
1
+ [project]
2
+ name = "deepcontrail-core"
3
+ version = "0.1.0"
4
+ description = "DeepContrail core — torch-free dataset config, spectral bands, composites, splits and metrics."
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "EUPL-1.2"
8
+ license-files = ["LICENSE"]
9
+ authors = [{ name = "EUROCONTROL" }]
10
+ keywords = ["contrails", "remote-sensing", "satellite", "GOES"]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Intended Audience :: Science/Research",
14
+ "Programming Language :: Python :: 3.11",
15
+ "Programming Language :: Python :: 3.12",
16
+ "Programming Language :: Python :: 3.13",
17
+ "Topic :: Scientific/Engineering :: Image Processing",
18
+ ]
19
+ dependencies = [
20
+ "numpy>=1.24",
21
+ "pillow>=10.0",
22
+ "pydantic>=2.0",
23
+ "pyyaml>=6.0",
24
+ ]
25
+
26
+ [project.scripts]
27
+ deepcontrail-validate = "deepcontrail.core.validate:main"
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/eurocontrol-asu/deepcontrail"
31
+ Documentation = "https://github.com/eurocontrol-asu/deepcontrail/tree/main/packages/core#readme"
32
+ Repository = "https://github.com/eurocontrol-asu/deepcontrail"
33
+ Issues = "https://github.com/eurocontrol-asu/deepcontrail/issues"
34
+ Changelog = "https://github.com/eurocontrol-asu/deepcontrail/blob/main/CHANGELOG.md"
35
+
36
+ [dependency-groups]
37
+ dev = ["pytest>=7.4", "pyright>=1.1"]
38
+
39
+ [build-system]
40
+ requires = ["uv_build>=0.10.2,<0.14.0"]
41
+ build-backend = "uv_build"
42
+
43
+ [tool.uv.build-backend]
44
+ module-name = "deepcontrail.core"
@@ -0,0 +1,49 @@
1
+ """Shared, torch-free foundations: dataset format, config, composites, splits, metrics."""
2
+
3
+ from importlib.metadata import version
4
+
5
+ from deepcontrail.core.config import DatasetConfig
6
+ from deepcontrail.core.contract import (
7
+ BandChannel,
8
+ BandManifest,
9
+ DatasetContractError,
10
+ DatasetInfo,
11
+ read_band_manifest,
12
+ read_dataset_info,
13
+ )
14
+ from deepcontrail.core.false_color import (
15
+ FalseColorChannel,
16
+ FalseColorConfig,
17
+ check_false_color,
18
+ false_color_from_spectral,
19
+ load_spectral_false_color,
20
+ )
21
+ from deepcontrail.core.metrics import dice_coefficient, iou_score
22
+ from deepcontrail.core.splits import context_frames, partition_stems, split_fingerprint
23
+ from deepcontrail.core.validate import Issue, ValidationReport, validate_dataset
24
+
25
+ __version__ = version("deepcontrail-core")
26
+
27
+ __all__ = [
28
+ "BandChannel",
29
+ "BandManifest",
30
+ "DatasetConfig",
31
+ "DatasetContractError",
32
+ "DatasetInfo",
33
+ "FalseColorChannel",
34
+ "FalseColorConfig",
35
+ "Issue",
36
+ "ValidationReport",
37
+ "__version__",
38
+ "check_false_color",
39
+ "context_frames",
40
+ "dice_coefficient",
41
+ "false_color_from_spectral",
42
+ "iou_score",
43
+ "load_spectral_false_color",
44
+ "partition_stems",
45
+ "read_band_manifest",
46
+ "read_dataset_info",
47
+ "split_fingerprint",
48
+ "validate_dataset",
49
+ ]