add_daily_data.cwl

  1#!/usr/bin/env cwl-runner
  2### Downloader of gridMET Data
  3#  Copyright (c) 2021. Harvard University
  4#
  5#  Developed by Research Software Engineering,
  6#  Faculty of Arts and Sciences, Research Computing (FAS RC)
  7#  Author: Michael A Bouzinier
  8#
  9#  Licensed under the Apache License, Version 2.0 (the "License");
 10#  you may not use this file except in compliance with the License.
 11#  You may obtain a copy of the License at
 12#
 13#         http://www.apache.org/licenses/LICENSE-2.0
 14#
 15#  Unless required by applicable law or agreed to in writing, software
 16#  distributed under the License is distributed on an "AS IS" BASIS,
 17#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 18#  See the License for the specific language governing permissions and
 19#  limitations under the License.
 20#
 21
 22cwlVersion: v1.2
 23class: Workflow
 24
 25requirements:
 26  InlineJavascriptRequirement: {}
 27
 28
 29doc: |
 30  This tool preprocesses gridMET to aggregate over shapes
 31  (zip codes or counties) and time. It produces daily mean values
 32
 33inputs:
 34  proxy:
 35    type: string?
 36    default: ""
 37    doc: HTTP/HTTPS Proxy if required
 38  strategy:
 39    type: string
 40    default: downscale
 41    doc: "Rasterization strategy"
 42  ram:
 43    type: string
 44    default: 2GB
 45    doc: Runtime memory, available to the process
 46  shapes:
 47    type: Directory?
 48  geography:
 49    type: string
 50    doc: |
 51      Type of geography: zip codes or counties
 52  year:
 53    type: string
 54    doc: "Year to process"
 55  month:
 56    type: int?
 57    doc: If given, then process just one month
 58  band:
 59    type: string
 60    doc: |
 61      [Gridmet Band](https://developers.google.com/earth-engine/datasets/catalog/IDAHO_EPSCOR_GRIDMET#bands)
 62  dates:
 63    type: string?
 64    doc: 'dates restriction, for testing purposes only'
 65  input:
 66    type: File
 67    doc: "Downloaded file"
 68  shape_files:
 69    type: File[]
 70    doc: "Paths to shape files"
 71  domain:
 72    type: string
 73  table:
 74    type: string
 75  database:
 76    type: File
 77  connection_name:
 78    type: string
 79  registry:
 80    type: File
 81
 82steps:
 83  aggregate:
 84    run: aggregate_daily.cwl
 85    in:
 86      proxy: proxy
 87      shapes: shapes
 88      geography: geography
 89      year: year
 90      dates: dates
 91      band: band
 92      input: input
 93      strategy: strategy
 94      ram: ram
 95      shape_files: shape_files
 96      month: month
 97    out:
 98      - data
 99      - log
100      - errors
101
102  ingest:
103    run: add_data.cwl
104    doc: Uploads data into the database
105    in:
106      registry: registry
107      domain: domain
108      table: table
109      input: aggregate/data
110      database: database
111      connection_name: connection_name
112    out:
113      - log
114      - errors
115
116
117outputs:
118  aggregate_log:
119    type: File?
120    outputSource: aggregate/log
121  data:
122    type: File?
123    outputSource: aggregate/data
124  aggregate_errors:
125    type: File?
126    outputSource: aggregate/errors
127  ingest_log:
128    type: File?
129    outputSource: ingest/log
130  ingest_errors:
131    type: File
132    outputSource: ingest/errors