Skip to content

Commit

Permalink
Merge pull request #4 from bio-oracle/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
bart-v authored Jun 20, 2024
2 parents dc35dc8 + a0060ab commit fa2acd1
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ erddap/conf/config.sh
erddap/content/history/*.xml
erddap/content/datasets.xml
erddap/content/setup.xml
.envrc
3 changes: 2 additions & 1 deletion GenerateDatasetsXml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ echo $CMD
docker run --rm -it \
-v "/data/layers:/datasets" \
-v "$(pwd)/logs:/erddapData/logs" \
axiom/docker-erddap:2.18 \
-v $(pwd)/erddap/content:/usr/local/tomcat/content/erddap \
axiom/docker-erddap:2.23-jdk17-openjdk \
bash -c "cd webapps/erddap/WEB-INF/ && $CMD"
33 changes: 28 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
version: '2'
services:
erddap:
container_name: "bio-oracle-erddap"
image: axiom/docker-erddap:2.22-jdk17-openjdk
image: axiom/docker-erddap:2.23-jdk17-openjdk
restart: unless-stopped
ports:
- "8080:8080"
environment:
ERDDAP_MIN_MEMORY: 1G
ERDDAP_MAX_MEMORY: 12G
volumes:
- "${PWD}/erddap/conf/config.sh:/usr/local/tomcat/bin/config.sh"
- "${PWD}/erddap/conf/robots.txt:/usr/local/tomcat/webapps/ROOT/robots.txt"
- "${PWD}/erddap/content:/usr/local/tomcat/content/erddap"
- "${PWD}/erddap/data:/erddapData"
- "/data/layers:/datasets"
- "/tmp/:/usr/local/tomcat/temp/"
environment:
#note: these can also be set in /usr/local/tomcat/bin/config.sh
ERDDAP_MIN_MEMORY: 2G
ERDDAP_MAX_MEMORY: 12G
ERDDAP_bigParentDirectory: /erddapData/
ERDDAP_baseUrl: "http://erddap.bio-oracle.org:8080"
ERDDAP_baseHttpsUrl: "http://erddap.bio-oracle.org:8080"
ERDDAP_flagKeyKey: "4a0c345f-d494-4edc-b8c7-640c6d99f4b1"
ERDDAP_emailEverythingT: [email protected]
ERDDAP_emailDailyReportsTo:
ERDDAP_emailFromAddress:
ERDDAP_emailUserName:
ERDDAP_emailPassword:
ERDDAP_emailProperties:
ERDDAP_emailSmtpHost:
ERDDAP_emailSmtpPort:
ERDDAP_adminInstitution: Flanders Marine Institute (VLIZ)
ERDDAP_adminInstitutionUrl: https://vliz.be/en/
ERDDAP_adminIndividualName: VLIZ Data Manager
ERDDAP_adminPosition: Data Manager
ERDDAP_adminPhone:
ERDDAP_adminAddress:
ERDDAP_adminCity:
ERDDAP_adminStateOrProvince:
ERDDAP_adminPostalCode:
ERDDAP_adminCountry:
ERDDAP_adminEmail:
24 changes: 12 additions & 12 deletions erddap/conf/config_template.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ERDDAP_MIN_MEMORY="1G"
ERDDAP_MAX_MEMORY="12G"
ERDDAP_bigParentDirectory="/erddapData/"
ERDDAP_baseUrl="http://erddap.bio-oracle.org:8080"
ERDDAP_baseHttpsUrl="http://erddap.bio-oracle.org:8080"
ERDDAP_flagKeyKey="4a0c345f-d494-4edc-b8c7-640c6d99f4b1"

ERDDAP_emailEverythingTo="[email protected]"
ERDDAP_emailDailyReportsTo=""
ERDDAP_emailFromAddress=""
Expand All @@ -11,15 +12,14 @@ ERDDAP_emailPassword=""
ERDDAP_emailProperties=""
ERDDAP_emailSmtpHost=""
ERDDAP_emailSmtpPort=""

ERDDAP_adminInstitution="Integrated Ocean Observing System (IOOS)"
ERDDAP_adminInstitutionUrl="https://ioos.github.io/"
ERDDAP_adminIndividualName="Micah Wengren"
ERDDAP_adminInstitution="Flanders Marine Institute (VLIZ)"
ERDDAP_adminInstitutionUrl="https://vliz.be/en/"
ERDDAP_adminIndividualName="VLIZ Data Manager"
ERDDAP_adminPosition="Data Manager"
ERDDAP_adminPhone="240-533-9441"
ERDDAP_adminAddress="1315 East-West Highway 2nd Floor"
ERDDAP_adminCity="Silver Spring"
ERDDAP_adminStateOrProvince="MD"
ERDDAP_adminPostalCode="20910"
ERDDAP_adminCountry="USA"
ERDDAP_adminEmail="[email protected]"
ERDDAP_adminPhone=""
ERDDAP_adminAddress=""
ERDDAP_adminCity=""
ERDDAP_adminStateOrProvince=""
ERDDAP_adminPostalCode=""
ERDDAP_adminCountry=""
ERDDAP_adminEmail=""
30 changes: 30 additions & 0 deletions utils/convert_nc_cdl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from netCDF4 import Dataset


def convert_nc_to_cdl(nc_fname):
cdl_fname = nc_fname.with_suffix(".cdl")
if cdl_fname.exists():
print(f"The {cdl_fname} file already exists, not overwriting it.")
return
with Dataset(nc_fname) as nc:
print(f"Converting {nc_fname} to {cdl_fname}.")
nc.tocdl(coordvars=True, data=True, outfile=cdl_fname)

def convert_cdl_to_nc(cdl_name):
nc_fname = cdl_fname.with_suffix(".nc")
if nc_fname.exists():
print(f"The {nc_fname} file already exists, not overwriting it.")
return
print(f"Converting {cdl_fname} to {nc_fname}.")
Dataset.fromcdl(cdl_fname)


if __name__ == "__main__":
from pathlib import Path

datasets_path = Path("datasets")
for nc_fname in datasets_path.glob("*.nc"):
convert_nc_to_cdl(nc_fname)

for cdl_fname in datasets_path.glob("*.cdl"):
convert_cdl_to_nc(cdl_fname)

0 comments on commit fa2acd1

Please sign in to comment.