Blame view

src/main/java/eu/omp/irap/vespa/epntapclient/granule/Granule.java 8.82 KB
2eda27c0   Nathanael Jourdane   Start VOResource ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * This file is a part of EpnTAPClient.
 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
 *
 * This program is free software: you can
 * redistribute it and/or modify it under the terms of the GNU General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
 * version. This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE. See the GNU General Public License for more details. You should have received a copy of
 * the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */

5e72363b   Nathanael Jourdane   Change project ar...
17
package eu.omp.irap.vespa.epntapclient.granule;
2eda27c0   Nathanael Jourdane   Start VOResource ...
18
19
20
21
22
23

import java.util.Date;

/**
 * @author N. Jourdane
 */
5e72363b   Nathanael Jourdane   Change project ar...
24
public class Granule {
2eda27c0   Nathanael Jourdane   Start VOResource ...
25

eda63a5c   Nathanael Jourdane   Add Javadoc.
26
	/** Internal table row index. Unique ID in data service, also in v2. Can be alphanum. */
2eda27c0   Nathanael Jourdane   Start VOResource ...
27
28
	public String granuleUid;

eda63a5c   Nathanael Jourdane   Add Javadoc.
29
30
31
32
	/**
	 * Common to granules of same type (e.g. same map projection, or geometry data products). Can be
	 * alphanum.
	 */
2eda27c0   Nathanael Jourdane   Start VOResource ...
33
34
	public String granuleGid;

eda63a5c   Nathanael Jourdane   Add Javadoc.
35
36
37
38
	/**
	 * Associates granules derived from the same data (e.g. various representations / processing
	 * levels). Can be alphanum., may be the ID of original observation.
	 */
2eda27c0   Nathanael Jourdane   Start VOResource ...
39
40
	public String obsId;

eda63a5c   Nathanael Jourdane   Add Javadoc.
41
	/** Organization of the data product, from enumerated list. */
2eda27c0   Nathanael Jourdane   Start VOResource ...
42
43
	public String dataproductType;

eda63a5c   Nathanael Jourdane   Add Javadoc.
44
	/** Standard IAU name of target (from a list related to target class), case sensitive. */
2eda27c0   Nathanael Jourdane   Start VOResource ...
45
46
	public String targetName;

eda63a5c   Nathanael Jourdane   Add Javadoc.
47
	/** Type of target, from enumerated list. */
2eda27c0   Nathanael Jourdane   Start VOResource ...
48
49
	public String targetClass;

eda63a5c   Nathanael Jourdane   Add Javadoc.
50
51
52
53
	/**
	 * Acquisition start time (in JD). UTC measured at time_origin location (default is observer's
	 * frame)
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
54
	public Double timeMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
55

eda63a5c   Nathanael Jourdane   Add Javadoc.
56
57
58
59
	/**
	 * Acquisition stop time (in JD). UTC measured at time_origin location (default is observer's
	 * frame).
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
60
	public Double timeMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
61

eda63a5c   Nathanael Jourdane   Add Javadoc.
62
	/** Min time sampling step. */
cfbb6d07   Nathanael Jourdane   Implement most of...
63
	public Double timeSamplingStepMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
64

eda63a5c   Nathanael Jourdane   Add Javadoc.
65
	/** Max time sampling step. */
cfbb6d07   Nathanael Jourdane   Implement most of...
66
	public Double timeSamplingStepMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
67

eda63a5c   Nathanael Jourdane   Add Javadoc.
68
	/** Min integration time. */
cfbb6d07   Nathanael Jourdane   Implement most of...
69
	public Double timeExpMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
70

eda63a5c   Nathanael Jourdane   Add Javadoc.
71
	/** Max integration time. */
cfbb6d07   Nathanael Jourdane   Implement most of...
72
	public Double timeExpMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
73

eda63a5c   Nathanael Jourdane   Add Javadoc.
74
	/** Min spectral range (frequency). */
cfbb6d07   Nathanael Jourdane   Implement most of...
75
	public Double spectralRangeMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
76

eda63a5c   Nathanael Jourdane   Add Javadoc.
77
	/** Max spectral range (frequency). */
cfbb6d07   Nathanael Jourdane   Implement most of...
78
	public Double spectralRangeMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
79

eda63a5c   Nathanael Jourdane   Add Javadoc.
80
	/** Min spectral sampling step. */
cfbb6d07   Nathanael Jourdane   Implement most of...
81
	public Double spectralSamplingStepMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
82

eda63a5c   Nathanael Jourdane   Add Javadoc.
83
	/** Max spectral sampling step. */
cfbb6d07   Nathanael Jourdane   Implement most of...
84
	public Double spectralSamplingStepMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
85

eda63a5c   Nathanael Jourdane   Add Javadoc.
86
	/** Min spectral resolution. */
cfbb6d07   Nathanael Jourdane   Implement most of...
87
	public Double spectralResolutionMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
88

eda63a5c   Nathanael Jourdane   Add Javadoc.
89
	/** Max spectral resolution. */
cfbb6d07   Nathanael Jourdane   Implement most of...
90
	public Double spectralResolutionMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
91

eda63a5c   Nathanael Jourdane   Add Javadoc.
92
	/** Min of first coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
93
	public Double c1Min;
2eda27c0   Nathanael Jourdane   Start VOResource ...
94

eda63a5c   Nathanael Jourdane   Add Javadoc.
95
	/** Max of first coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
96
	public Double c1Max;
2eda27c0   Nathanael Jourdane   Start VOResource ...
97

eda63a5c   Nathanael Jourdane   Add Javadoc.
98
	/** Min of second coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
99
	public Double c2Min;
2eda27c0   Nathanael Jourdane   Start VOResource ...
100

eda63a5c   Nathanael Jourdane   Add Javadoc.
101
	/** Max of second coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
102
	public Double c2Max;
2eda27c0   Nathanael Jourdane   Start VOResource ...
103

eda63a5c   Nathanael Jourdane   Add Javadoc.
104
	/** Min of third coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
105
	public Double c3Min;
2eda27c0   Nathanael Jourdane   Start VOResource ...
106

eda63a5c   Nathanael Jourdane   Add Javadoc.
107
	/** Max of third coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
108
	public Double c3Max;
2eda27c0   Nathanael Jourdane   Start VOResource ...
109

eda63a5c   Nathanael Jourdane   Add Javadoc.
110
	/** ObsCore-like footprint, assume spatial_coordinate_description. */
cfbb6d07   Nathanael Jourdane   Implement most of...
111
	public String sRegion;
2eda27c0   Nathanael Jourdane   Start VOResource ...
112

eda63a5c   Nathanael Jourdane   Add Javadoc.
113
	/** Min resolution in first coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
114
	public Double c1ResolMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
115

eda63a5c   Nathanael Jourdane   Add Javadoc.
116
	/** Max resolution in first coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
117
	public Double c1ResolMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
118

eda63a5c   Nathanael Jourdane   Add Javadoc.
119
	/** Min resolution in second coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
120
	public Double c2ResolMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
121

eda63a5c   Nathanael Jourdane   Add Javadoc.
122
	/** Max resolution in second coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
123
	public Double c2ResolMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
124

eda63a5c   Nathanael Jourdane   Add Javadoc.
125
	/** Min resolution in third coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
126
127
	public Double c3ResolMin;

eda63a5c   Nathanael Jourdane   Add Javadoc.
128
	/** Max resolution in third coordinate. */
cfbb6d07   Nathanael Jourdane   Implement most of...
129
	public Double c3ResolMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
130

eda63a5c   Nathanael Jourdane   Add Javadoc.
131
	/** Flavor of coordinate system, defines the nature of coordinates. From enumerated list. */
2eda27c0   Nathanael Jourdane   Start VOResource ...
132
133
	public String spatialFrameType;

eda63a5c   Nathanael Jourdane   Add Javadoc.
134
	/** Min incidence angle (solar zenithal angle). */
cfbb6d07   Nathanael Jourdane   Implement most of...
135
	public Double incidenceMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
136

eda63a5c   Nathanael Jourdane   Add Javadoc.
137
	/** Max incidence angle (solar zenithal angle). */
cfbb6d07   Nathanael Jourdane   Implement most of...
138
	public Double incidenceMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
139

eda63a5c   Nathanael Jourdane   Add Javadoc.
140
	/** Min emergence angle. */
cfbb6d07   Nathanael Jourdane   Implement most of...
141
	public Double emergenceMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
142

eda63a5c   Nathanael Jourdane   Add Javadoc.
143
	/** Max emergence angle. */
cfbb6d07   Nathanael Jourdane   Implement most of...
144
	public Double emergenceMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
145

eda63a5c   Nathanael Jourdane   Add Javadoc.
146
	/** Min phase angle. */
cfbb6d07   Nathanael Jourdane   Implement most of...
147
	public Double phaseMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
148

eda63a5c   Nathanael Jourdane   Add Javadoc.
149
	/** Max phase angle. */
cfbb6d07   Nathanael Jourdane   Implement most of...
150
	public Double phaseMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
151

eda63a5c   Nathanael Jourdane   Add Javadoc.
152
	/** Standard name of the observatory or spacecraft. */
2eda27c0   Nathanael Jourdane   Start VOResource ...
153
154
	public String instrumentHostName;

eda63a5c   Nathanael Jourdane   Add Javadoc.
155
	/** Standard name of instrument */
2eda27c0   Nathanael Jourdane   Start VOResource ...
156
157
	public String instrumentName;

eda63a5c   Nathanael Jourdane   Add Javadoc.
158
	/** UCD(s) defining the data */
2eda27c0   Nathanael Jourdane   Start VOResource ...
159
160
	public String measurementType;

eda63a5c   Nathanael Jourdane   Add Javadoc.
161
	/** CODMAC calibration level in v1 */
cfbb6d07   Nathanael Jourdane   Implement most of...
162
	public Integer processingLevel;
2eda27c0   Nathanael Jourdane   Start VOResource ...
163

eda63a5c   Nathanael Jourdane   Add Javadoc.
164
	/** Date of first entry of this granule */
2eda27c0   Nathanael Jourdane   Start VOResource ...
165
166
	public Date creationDate;

eda63a5c   Nathanael Jourdane   Add Javadoc.
167
	/** Date of last modification (used to handle mirroring) */
2eda27c0   Nathanael Jourdane   Start VOResource ...
168
169
	public Date modificationDate;

eda63a5c   Nathanael Jourdane   Add Javadoc.
170
	/**  */
2eda27c0   Nathanael Jourdane   Start VOResource ...
171
172
	public Date releaseDate;

eda63a5c   Nathanael Jourdane   Add Javadoc.
173
	/**  */
2eda27c0   Nathanael Jourdane   Start VOResource ...
174
175
	public String serviceTitle;

eda63a5c   Nathanael Jourdane   Add Javadoc.
176
	/**  */
2eda27c0   Nathanael Jourdane   Start VOResource ...
177
178
	public String accessUrl;

eda63a5c   Nathanael Jourdane   Add Javadoc.
179
	/**  */
2eda27c0   Nathanael Jourdane   Start VOResource ...
180
181
	public String accessFormat;

eda63a5c   Nathanael Jourdane   Add Javadoc.
182
183
	/** Estimate file size in kbyte (with this spelling) */
	public int accessEstsize;
2eda27c0   Nathanael Jourdane   Start VOResource ...
184

eda63a5c   Nathanael Jourdane   Add Javadoc.
185
186
187
188
189
	/**
	 * If access_format indicates a detached label, this parameter is mandatory and points to the
	 * corresponding data file - both will be handled by the client before samping it to tools or
	 * downloading
	 */
2eda27c0   Nathanael Jourdane   Start VOResource ...
190
191
	public String dataAccessUrl;

eda63a5c   Nathanael Jourdane   Add Javadoc.
192
	/** MD5 Hash for the file when available (real file) */
2eda27c0   Nathanael Jourdane   Start VOResource ...
193
194
	public String accessMd5;

eda63a5c   Nathanael Jourdane   Add Javadoc.
195
	/** URL of a thumbnail image with predefined size (png ~200 pix, for use in a client only) */
2eda27c0   Nathanael Jourdane   Start VOResource ...
196
197
	public String thumbnailUrl;

eda63a5c   Nathanael Jourdane   Add Javadoc.
198
	/** Name of the data file only, case sensitive */
2eda27c0   Nathanael Jourdane   Start VOResource ...
199
200
	public String fileName;

eda63a5c   Nathanael Jourdane   Add Javadoc.
201
	/** Identifies a chemical species, case sensitive */
2eda27c0   Nathanael Jourdane   Start VOResource ...
202
203
	public String species;

eda63a5c   Nathanael Jourdane   Add Javadoc.
204
	/** Provides alternative target name if more common (e.g. comets) */
2eda27c0   Nathanael Jourdane   Start VOResource ...
205
206
	public String altTargetName;

eda63a5c   Nathanael Jourdane   Add Javadoc.
207
	/**  */
2eda27c0   Nathanael Jourdane   Start VOResource ...
208
209
	public String targetRegion;

eda63a5c   Nathanael Jourdane   Add Javadoc.
210
	/**  */
2eda27c0   Nathanael Jourdane   Start VOResource ...
211
212
	public String featureName;

eda63a5c   Nathanael Jourdane   Add Javadoc.
213
	/** Bibcode, doi, or other biblio id, URL */
2eda27c0   Nathanael Jourdane   Start VOResource ...
214
215
	public String bibReference;

eda63a5c   Nathanael Jourdane   Add Javadoc.
216
217
	/**  */
	public double ra;
2eda27c0   Nathanael Jourdane   Start VOResource ...
218

eda63a5c   Nathanael Jourdane   Add Javadoc.
219
220
	/** Declination */
	public double dec;
2eda27c0   Nathanael Jourdane   Start VOResource ...
221

eda63a5c   Nathanael Jourdane   Add Javadoc.
222
223
	/** Min Solar longitude Ls (location on orbit / season) */
	public double solarLongitudeMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
224

eda63a5c   Nathanael Jourdane   Add Javadoc.
225
226
	/** Max Solar longitude Ls (location on orbit / season) */
	public double solarLongitudeMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
227

eda63a5c   Nathanael Jourdane   Add Javadoc.
228
229
	/** Local time at observed region */
	public double localTimeMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
230

eda63a5c   Nathanael Jourdane   Add Javadoc.
231
232
	/** Local time at observed region */
	public double localTimeMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
233

eda63a5c   Nathanael Jourdane   Add Javadoc.
234
235
	/** Observer-target distance */
	public double targetDistanceMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
236

eda63a5c   Nathanael Jourdane   Add Javadoc.
237
238
	/** Observer-target distance */
	public double targetDistanceMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
239

eda63a5c   Nathanael Jourdane   Add Javadoc.
240
241
	/**  */
	public double targetTimeMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
242

eda63a5c   Nathanael Jourdane   Add Javadoc.
243
244
	/**  */
	public double targetTimeMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
245

eda63a5c   Nathanael Jourdane   Add Javadoc.
246
	/**  */
2eda27c0   Nathanael Jourdane   Start VOResource ...
247
248
	public String particleSpectralType;

eda63a5c   Nathanael Jourdane   Add Javadoc.
249
250
	/**  */
	public double particleSpectralRangeMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
251

eda63a5c   Nathanael Jourdane   Add Javadoc.
252
253
	/**  */
	public double particleSpectralRangeMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
254

eda63a5c   Nathanael Jourdane   Add Javadoc.
255
256
	/**  */
	public double particleSpectralSamplingStepMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
257

eda63a5c   Nathanael Jourdane   Add Javadoc.
258
259
	/**  */
	public double particleSpectralSamplingStepMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
260

eda63a5c   Nathanael Jourdane   Add Javadoc.
261
262
	/**  */
	public double particleSpectralResolutionMin;
2eda27c0   Nathanael Jourdane   Start VOResource ...
263

eda63a5c   Nathanael Jourdane   Add Javadoc.
264
265
	/**  */
	public double particleSpectralResolutionMax;
2eda27c0   Nathanael Jourdane   Start VOResource ...
266

eda63a5c   Nathanael Jourdane   Add Javadoc.
267
	/** Resource publisher */
2eda27c0   Nathanael Jourdane   Start VOResource ...
268
269
	public String publisher;

eda63a5c   Nathanael Jourdane   Add Javadoc.
270
	/** ID of specific coordinate system and version */
2eda27c0   Nathanael Jourdane   Start VOResource ...
271
272
	public String spatialCoordinateDescription;

eda63a5c   Nathanael Jourdane   Add Javadoc.
273
	/** Defines the frame origin */
2eda27c0   Nathanael Jourdane   Start VOResource ...
274
275
	public String spatialOrigin;

eda63a5c   Nathanael Jourdane   Add Javadoc.
276
	/**  */
2eda27c0   Nathanael Jourdane   Start VOResource ...
277
278
	public String timeOrigin;

eda63a5c   Nathanael Jourdane   Add Javadoc.
279
	/**  */
2eda27c0   Nathanael Jourdane   Start VOResource ...
280
	public String timeScale;
cfbb6d07   Nathanael Jourdane   Implement most of...
281
282


eda63a5c   Nathanael Jourdane   Add Javadoc.
283
	/** Private constructor to hide the default public one. */
cfbb6d07   Nathanael Jourdane   Implement most of...
284
	private Granule() {
cfbb6d07   Nathanael Jourdane   Implement most of...
285
286
	}

eda63a5c   Nathanael Jourdane   Add Javadoc.
287
288
289
290
291
	/**
	 * Constructor of Granule
	 *
	 * @param granuleUid The granule identifier.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
292
293
294
295
296
	public Granule(String granuleUid) {
		this.granuleUid = granuleUid;
	}

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
297
	 * A granule is valid if all mandatory parameters are filled.
cfbb6d07   Nathanael Jourdane   Implement most of...
298
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
299
	 * @return true if the Granule is valid, false otherwise.
cfbb6d07   Nathanael Jourdane   Implement most of...
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
	 */
	public boolean isValid() {
		boolean valid = granuleUid != null && granuleGid != null && obsId != null;
		valid = valid && dataproductType != null && targetName != null && targetClass != null;
		valid = valid && timeMin != null && timeMax != null;
		valid = valid && timeSamplingStepMin != null && timeSamplingStepMax != null;
		valid = valid && timeExpMin != null && timeExpMax != null;
		valid = valid && spectralRangeMin != null && spectralRangeMax != null;
		valid = valid && timeSamplingStepMin != null && timeSamplingStepMax != null;
		valid = valid && spectralResolutionMin != null && spectralResolutionMax != null;
		valid = valid && c1Min != null && c1Max != null;
		valid = valid && c2Min != null && c2Max != null;
		valid = valid && c3Min != null && c3Max != null;
		valid = valid && sRegion != null;
		valid = valid && c1ResolMin != null && c1ResolMax != null;
		valid = valid && c2ResolMin != null && c2ResolMax != null;
		valid = valid && c3ResolMin != null && c3ResolMax != null;
		valid = valid && spatialFrameType != null;
		valid = valid && incidenceMin != null && incidenceMax != null;
		valid = valid && emergenceMin != null && emergenceMax != null;
		valid = valid && phaseMin != null && phaseMax != null;
		valid = valid && instrumentHostName != null && instrumentName != null;
		valid = valid && measurementType != null && processingLevel != null;
		valid = valid && creationDate != null && modificationDate != null;
		valid = valid && releaseDate != null && serviceTitle != null;

		return valid;
	}

	@Override
	public String toString() {
		return granuleUid;
	}

2eda27c0   Nathanael Jourdane   Start VOResource ...
334
}