Commit 260c559f71b65e74dc3129785a9f0e5b84a50368

Authored by Nathanael Jourdane
1 parent 24d5da49
Exists in master

Add the Granule enumeration.

src/main/java/eu/omp/irap/vespa/epntapclient/granule/GranuleEnum.java 0 → 100644
... ... @@ -0,0 +1,141 @@
  1 +/*
  2 + * This file is a part of EpnTAPClient.
  3 + * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
  4 + * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
  5 + * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
  6 + *
  7 + * This program is free software: you can
  8 + * redistribute it and/or modify it under the terms of the GNU General Public License as published
  9 + * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
  10 + * version. This program is distributed in the hope that it will be useful, but WITHOUT ANY
  11 + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  12 + * PURPOSE. See the GNU General Public License for more details. You should have received a copy of
  13 + * the GNU General Public License along with this program. If not, see
  14 + * <http://www.gnu.org/licenses/>.
  15 + */
  16 +
  17 +package eu.omp.irap.vespa.epntapclient.granule;
  18 +
  19 +import java.util.Date;
  20 +
  21 +/**
  22 + * Enumeration list generated with the Python script in main/resources/scripts.
  23 + *
  24 + * @author N. Jourdane
  25 + */
  26 +public enum GranuleEnum {
  27 +
  28 + //@noformat
  29 + GRANULE_UID("granule_uid", String.class, true, true, "", "meta.id", ""),
  30 + GRANULE_GID("granule_gid", String.class, true, true, "", "meta.id", "Common to granules of same type (e.g. same map projection, or geometry data products). Can be alphanum."),
  31 + OBS_ID("obs_id", String.class, true, true, "", "meta.id", "Associates granules derived from the same data (e.g. various representations / processing levels). Can be alphanum., may be the ID of original observation."),
  32 + DATAPRODUCT_TYPE("dataproduct_type", String.class, true, true, "", "meta.code.class", "Organization of the data product, from enumerated list"),
  33 + TARGET_NAME("target_name", String.class, true, true, "", "meta.id;src", "Standard IAU name of target (from a list related to target class), case sensitive"),
  34 + TARGET_CLASS("target_class", String.class, true, true, "", "meta.code.class;src", "Type of target, from enumerated list"),
  35 + TIME_MIN("time_min", Double.class, true, false, "d (date as JD)", "time.start", ""),
  36 + TIME_MAX("time_max", Double.class, true, false, "d (date as JD)", "time.end", ""),
  37 + TIME_SAMPLING_STEP_MIN("time_sampling_step_min", Double.class, true, false, "s", "time.interval;stat.min", "Min time sampling step"),
  38 + TIME_SAMPLING_STEP_MAX("time_sampling_step_max", Double.class, true, false, "s", "time.interval;stat.max", "Max time sampling step"),
  39 + TIME_EXP_MIN("time_exp_min", Double.class, true, false, "s", "", "Min integration time"),
  40 + TIME_EXP_MAX("time_exp_max", Double.class, true, false, "s", "time.duration;obs.exposure;stat.max", "Max integration time"),
  41 + SPECTRAL_RANGE_MIN("spectral_range_min", Double.class, true, false, "Hz", "em.freq;stat.min", "Min spectral range (frequency)"),
  42 + SPECTRAL_RANGE_MAX("spectral_range_max", Double.class, true, false, "Hz", "em.freq;stat.max", "Max spectral range (frequency)"),
  43 + SPECTRAL_SAMPLING_STEP_MIN("spectral_sampling_step_min", Double.class, true, false, "Hz", "", "Min spectral sampling step"),
  44 + SPECTRAL_SAMPLING_STEP_MAX("spectral_sampling_step_max", Double.class, true, false, "Hz", "", "Max spectral sampling step"),
  45 + SPECTRAL_RESOLUTION_MIN("spectral_resolution_min", Double.class, true, false, "Hz", "spect.resolution;stat.min", ""),
  46 + SPECTRAL_RESOLUTION_MAX("spectral_resolution_max", Double.class, true, false, "Hz", "spect.resolution;stat.max", "Max spectral resolution"),
  47 + C1MIN("c1min", Double.class, true, false, "", "pos;stat.min", "Min of first coordinate"),
  48 + C1MAX("c1max", Double.class, true, false, "", "pos;stat.max", "Max of first coordinate"),
  49 + C2MIN("c2min", Double.class, true, false, "", "pos;stat.min", "Min of second coordinate"),
  50 + C2MAX("c2max", Double.class, true, false, "", "pos;stat.max", "Max of second coordinate"),
  51 + C3MIN("c3min", Double.class, true, false, "", "pos;stat.min", "Min of third coordinate"),
  52 + C3MAX("c3max", Double.class, true, false, "", "pos;stat.max", "Max of third coordinate"),
  53 + S_REGION("s_region", String.class, true, false, "", "instr.fov", "ObsCore-like footprint, assume spatial_coordinate_description"),
  54 + C1_RESOL_MIN("c1_resol_min", Double.class, true, false, "", "", "Min resolution in first coordinate"),
  55 + C1_RESOL_MAX("c1_resol_max", Double.class, true, false, "", "pos.resolution;stat.max", "Max resolution in first coordinate"),
  56 + C2_RESOL_MIN("c2_resol_min", Double.class, true, false, "", "pos.resolution;stat.min", "Min resolution in second coordinate"),
  57 + C2_RESOL_MAX("c2_resol_max", Double.class, true, false, "", "pos.resolution;stat.max", "Max resolution in second coordinate"),
  58 + C3_RESOL_MIN("c3_resol_min", Double.class, true, false, "", "pos.resolution;stat.min", "Min resolution in third coordinate"),
  59 + C3_RESOL_MAX("c3_resol_max", Double.class, true, false, "", "pos.resolution;stat.max", "Max resolution in third coordinate"),
  60 + SPATIAL_FRAME_TYPE("spatial_frame_type", String.class, true, false, "", "meta.code.class;pos.frame", "Flavor of coordinate system, defines the nature of coordinates. From enumerated list"),
  61 + INCIDENCE_MIN("incidence_min", Double.class, true, false, "deg", "pos.posAng;stat.min", "Min incidence angle (solar zenithal angle)"),
  62 + INCIDENCE_MAX("incidence_max", Double.class, true, false, "deg", "pos.posAng;stat.max", "Max incidence angle (solar zenithal angle)"),
  63 + EMERGENCE_MIN("emergence_min", Double.class, true, false, "deg", "pos.posAng;stat.min", "Min emergence angle"),
  64 + EMERGENCE_MAX("emergence_max", Double.class, true, false, "deg", "pos.posAng;stat.max", "Max emergence angle"),
  65 + PHASE_MIN("phase_min", Double.class, true, false, "deg", "pos.phaseAng;stat.min", "Min phase angle"),
  66 + PHASE_MAX("phase_max", Double.class, true, false, "deg", "pos.phaseAng;stat.max", "Max phase angle"),
  67 + INSTRUMENT_HOST_NAME("instrument_host_name", String.class, true, false, "", "", "Standard name of the observatory or spacecraft"),
  68 + INSTRUMENT_NAME("instrument_name", String.class, true, false, "", "meta.id;instr", "Standard name of instrument"),
  69 + MEASUREMENT_TYPE("measurement_type", String.class, true, false, "", "meta.ucd", "UCD(s) defining the data"),
  70 + PROCESSING_LEVEL("processing_level", Integer.class, true, false, "", "meta.code;obs.calib", "CODMAC calibration level in v1"),
  71 + CREATION_DATE("creation_date", Date.class, true, true, "", "time.creation", "Date of first entry of this granule"),
  72 + MODIFICATION_DATE("modification_date", Date.class, true, true, "", "time.update", "Date of last modification (used to handle mirroring)"),
  73 + RELEASE_DATE("release_date", Date.class, true, true, "", "time.release", ""),
  74 + SERVICE_TITLE("service_title", String.class, true, true, "", "meta.title", ""),
  75 + ACCESS_URL("access_url", String.class, false, false, "", "meta.ref.url;meta.file", ""),
  76 + ACCESS_FORMAT("access_format", String.class, false, false, "", "meta.code.mime", ""),
  77 + ACCESS_ESTSIZE("access_estsize", Integer.class, false, false, "kbyte", "", "Estimate file size in kbyte (with this spelling)"),
  78 + DATA_ACCESS_URL("data_access_url", String.class, false, false, "", "", "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"),
  79 + ACCESS_MD5("access_md5", String.class, false, false, "", "", "MD5 Hash for the file when available (real file)"),
  80 + THUMBNAIL_URL("thumbnail_url", String.class, false, false, "", "meta.ref.url;meta.file", "URL of a thumbnail image with predefined size (png ~200 pix, for use in a client only)"),
  81 + FILE_NAME("file_name", String.class, false, false, "", "meta.id;meta.file", "Name of the data file only, case sensitive"),
  82 + SPECIES("species", String.class, false, false, "", "meta.id;phys.atmol", "Identifies a chemical species, case sensitive"),
  83 + ALT_TARGET_NAME("alt_target_name", String.class, false, false, "", "meta.id;src", "Provides alternative target name if more common (e.g. comets)"),
  84 + TARGET_REGION("target_region", String.class, false, false, "", "meta.id;class", ""),
  85 + FEATURE_NAME("feature_name", String.class, false, false, "", "meta.id;pos", ""),
  86 + BIB_REFERENCE("bib_reference", String.class, false, false, "", "meta.bib", "Bibcode, doi, or other biblio id, URL"),
  87 + RA("ra", Double.class, false, false, "deg or h:m:s?", "pos.eq.ra;meta.main", ""),
  88 + DEC("dec", Double.class, false, false, "deg", "pos.eq.dec;meta.main", "Declination"),
  89 + SOLAR_LONGITUDE_MIN("solar_longitude_min", Double.class, false, false, "deg", "pos.posangle (TBC)", "Min Solar longitude Ls (location on orbit / season)"),
  90 + SOLAR_LONGITUDE_MAX("solar_longitude_max", Double.class, false, false, "deg", "pos.posangle (TBC)", "Max Solar longitude Ls (location on orbit / season)"),
  91 + LOCAL_TIME_MIN("local_time_min", Double.class, false, false, "h", "time.phase;stat.min?", "Local time at observed region"),
  92 + LOCAL_TIME_MAX("local_time_max", Double.class, false, false, "h", "time.phase;stat.max?", "Local time at observed region"),
  93 + TARGET_DISTANCE_MIN("target_distance_min", Double.class, false, false, "km", "pos.distance;stat.min", "Observer-target distance"),
  94 + TARGET_DISTANCE_MAX("target_distance_max", Double.class, false, false, "km", "pos.distance;stat.max", "Observer-target distance"),
  95 + TARGET_TIME_MIN("target_time_min", Double.class, false, false, "d", "", ""),
  96 + TARGET_TIME_MAX("target_time_max", Double.class, false, false, "d", "", ""),
  97 + PARTICLE_SPECTRAL_TYPE("particle_spectral_type", String.class, false, false, "", "", ""),
  98 + PARTICLE_SPECTRAL_RANGE_MIN("particle_spectral_range_min", Double.class, false, false, "", "", ""),
  99 + PARTICLE_SPECTRAL_RANGE_MAX("particle_spectral_range_max", Double.class, false, false, "", "", ""),
  100 + PARTICLE_SPECTRAL_SAMPLING_STEP_MIN("particle_spectral_sampling_step_min", Double.class, false, false, "", "", ""),
  101 + PARTICLE_SPECTRAL_SAMPLING_STEP_MAX("particle_spectral_sampling_step_max", Double.class, false, false, "", "", ""),
  102 + PARTICLE_SPECTRAL_RESOLUTION_MIN("particle_spectral_resolution_min", Double.class, false, false, "", "spect.resolution;stat.min", ""),
  103 + PARTICLE_SPECTRAL_RESOLUTION_MAX("particle_spectral_resolution_max", Double.class, false, false, "", "spect.resolution;stat.max", ""),
  104 + PUBLISHER("publisher", String.class, false, false, "", "meta.name", "Resource publisher"),
  105 + SPATIAL_COORDINATE_DESCRIPTION("spatial_coordinate_description", String.class, false, false, "", "", "ID of specific coordinate system and version"),
  106 + SPATIAL_ORIGIN("spatial_origin", String.class, false, false, "", "meta.ref;pos.frame", "Defines the frame origin"),
  107 + TIME_ORIGIN("time_origin", String.class, false, false, "", "", ""),
  108 + TIME_SCALE("time_scale", String.class, false, false, "", "time.scale", "");
  109 + //@format
  110 +
  111 + private String name;
  112 +
  113 + private Class type;
  114 +
  115 + private boolean isMandatory;
  116 +
  117 + private boolean mustbeFilled;
  118 +
  119 + private String unit;
  120 +
  121 + private String ucd;
  122 +
  123 + private String description;
  124 +
  125 +
  126 + GranuleEnum(String name, Class type, boolean isMandatory, boolean mustBeFilled, String unit,
  127 + String ucd, String description) {
  128 + this.name = name;
  129 + this.type = type;
  130 + this.isMandatory = isMandatory;
  131 + mustbeFilled = mustBeFilled;
  132 + this.unit = unit;
  133 + this.ucd = ucd;
  134 + this.description = description;
  135 + }
  136 +
  137 + @Override
  138 + public String toString() {
  139 + return name;
  140 + }
  141 +}
... ...