download_airnow.cwl

 1#!/usr/bin/env cwl-runner
 2### Downloader of AirNow 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: CommandLineTool
24baseCommand: [python, -m, dorieh.epa.airnow]
25requirements:
26  InlineJavascriptRequirement: {}
27  NetworkAccess:
28    networkAccess: True
29  EnvVarRequirement:
30    envDef:
31      HTTPS_PROXY: $(inputs.proxy)
32      HTTP_PROXY: $(inputs.proxy)
33
34doc: |
35  This tool downloads AirNow data from EPA website
36
37# -p pm25 --dest airnow_pm25.json.gz --from 2020-12-25 --to 2020-12-31 --qc
38inputs:
39  proxy:
40    type: string?
41    default: ""
42    doc: HTTP/HTTPS Proxy if required
43  parameter_code:
44    type: string
45    doc: |
46      Parameter code. Either a numeric code (e.g. 88101, 44201)
47      or symbolic name (e.g. PM25, NO2).
48      See more: [AQS Code List](https://www.epa.gov/aqs/aqs-code-list)
49    inputBinding:
50      prefix: --parameters
51  from:
52    type: string
53    doc: Start date for downolading, in YYYY-MM-DD format
54    inputBinding:
55      prefix: --from
56  to:
57    type: string
58    doc: End date for downolading, in YYYY-MM-DD format
59    inputBinding:
60      prefix: --to
61  shapes:
62    type: File[]
63    inputBinding:
64      prefix: --shapes
65    secondaryFiles:
66      - "^.dbf"
67      - "^.shx"
68      - "^.prj"
69      - "^.cpg"
70  table:
71    type: string
72    doc: the name of the table to be created
73  api-key:
74    type: string?
75    inputBinding:
76      prefix: --api_key
77
78arguments:
79    - valueFrom: "--qc"
80    - valueFrom: $(inputs.table + ".json.gz")
81      prefix: --destination
82
83
84outputs:
85  log:
86    type: File
87    outputBinding:
88      glob: "*.log"
89  data:
90    type: File
91    outputBinding:
92      glob: "*.json*"