Skip to content

Commit

Permalink
Add tds download url to Info section
Browse files Browse the repository at this point in the history
  • Loading branch information
lstillwe committed Jul 20, 2023
1 parent ef1e7eb commit a882a58
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
3 changes: 2 additions & 1 deletion asgs_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def getRunMetadata(self):
'ADCIRCgrid': '',
'monitoring.rmqmessaging.locationname': '',
'instancename': '',
'stormnumber': ''
'stormnumber': '',
'downloadurl': ''
}
self.logger.info(f'Retrieving DB record metadata - instance id: {self.instance} uid: {self.uid}')

Expand Down
11 changes: 7 additions & 4 deletions load-geoserver-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def create_cat_info(meta_dict):
info_dict.update({"stormname": meta_dict['forcing.tropicalcyclone.stormname']})
info_dict.update({"location": meta_dict['monitoring.rmqmessaging.locationname']})
info_dict.update({"stormnumber": meta_dict['stormnumber']})
# reformat tds download url
url = f"{meta_dict['downloadurl'].replace('fileServer', 'catalog', 1)}/catalog.html"
info_dict.update({"downloadurl": url})

# added for PSC
info_dict.update({"meteorological_model": meta_dict['forcing.tropicalcyclone.vortexmodel']})
Expand Down Expand Up @@ -88,9 +91,9 @@ def update_layer_title(logger, geo, instance_id, worksp, layer_name, kalpana=Fal

title = "N/A"
if (meta_dict['forcing.metclass'] == 'synoptic'):
title = f"Date: {run_date} Cycle: {meta_dict['currentcycle']} Forecast Type: {meta_dict['asgs.enstorm']} Location: {meta_dict['monitoring.rmqmessaging.locationname']} Instance: {meta_dict['instancename']} ADCIRC Grid: {meta_dict['ADCIRCgrid']} ({title_layer_name})"
title = f"Date: {run_date} Cycle: {meta_dict['currentcycle']} Type: {meta_dict['asgs.enstorm']} Location: {meta_dict['monitoring.rmqmessaging.locationname']} Instance: {meta_dict['instancename']} ADCIRC Grid: {meta_dict['ADCIRCgrid']} ({title_layer_name})"
else: # tropical
title = f"Date: {run_date} Storm Name: {meta_dict['forcing.tropicalcyclone.stormname']}({meta_dict['stormnumber']}) Advisory:{meta_dict['advisory']} Forecast Type: {meta_dict['asgs.enstorm']} Location: {meta_dict['monitoring.rmqmessaging.locationname']} Instance: {meta_dict['instancename']} ADCIRC Grid: {meta_dict['ADCIRCgrid']} ({title_layer_name})"
title = f"Date: {run_date} Storm Name: {meta_dict['forcing.tropicalcyclone.stormname']}({meta_dict['stormnumber']}) Advisory:{meta_dict['advisory']} Type: {meta_dict['asgs.enstorm']} Location: {meta_dict['monitoring.rmqmessaging.locationname']} Instance: {meta_dict['instancename']} ADCIRC Grid: {meta_dict['ADCIRCgrid']} ({title_layer_name})"
# title = f"Date: {run_date} Cycle: {meta_dict['currentcycle']} Storm Name: {meta_dict['forcing.tropicalcyclone.stormname']} Advisory:{meta_dict['advisory']} Forecast Type: {meta_dict['asgs.enstorm']} Location: {meta_dict['monitoring.rmqmessaging.locationname']} Instance: {meta_dict['instancename']} ADCIRC Grid: {meta_dict['ADCIRCgrid']} ({layer_name.split('_')[1]})"
logger.debug(f"setting this coverage: {layer_name} to {title}")

Expand Down Expand Up @@ -339,10 +342,10 @@ def add_props_datastore(logger, geo, instance_id, worksp, final_path, geoserver_
if len(date_list) == 3:
run_date = f"{date_list[1]}-{date_list[2]}-20{date_list[0]}"
if (meta_dict['forcing.metclass'] == 'synoptic'):
title = f"Observations - Date: {run_date} Cycle: {meta_dict['currentcycle']} Forecast Type: {meta_dict['asgs.enstorm']} Location: {meta_dict['monitoring.rmqmessaging.locationname']} Instance: {meta_dict['instancename']} ADCIRC Grid: {meta_dict['ADCIRCgrid']}"
title = f"Observations - Date: {run_date} Cycle: {meta_dict['currentcycle']} Type: {meta_dict['asgs.enstorm']} Location: {meta_dict['monitoring.rmqmessaging.locationname']} Instance: {meta_dict['instancename']} ADCIRC Grid: {meta_dict['ADCIRCgrid']}"
else: # tropical
# title = f"Observations - Date: {run_date} Cycle: {meta_dict['currentcycle']} Storm Name: {meta_dict['forcing.tropicalcyclone.stormname']} Advisory:{meta_dict['advisory']} Forecast Type: {meta_dict['asgs.enstorm']} Location: {meta_dict['monitoring.rmqmessaging.locationname']} Instance: {meta_dict['instancename']} ADCIRC Grid: {meta_dict['ADCIRCgrid']}"
title = f"Observations - Date: {run_date} Storm Name: {meta_dict['forcing.tropicalcyclone.stormname']}({meta_dict['stormnumber']}) Advisory:{meta_dict['advisory']} Forecast Type: {meta_dict['asgs.enstorm']} Location: {meta_dict['monitoring.rmqmessaging.locationname']} Instance: {meta_dict['instancename']} ADCIRC Grid: {meta_dict['ADCIRCgrid']}"
title = f"Observations - Date: {run_date} Storm Name: {meta_dict['forcing.tropicalcyclone.stormname']}({meta_dict['stormnumber']}) Advisory:{meta_dict['advisory']} Type: {meta_dict['asgs.enstorm']} Location: {meta_dict['monitoring.rmqmessaging.locationname']} Instance: {meta_dict['instancename']} ADCIRC Grid: {meta_dict['ADCIRCgrid']}"
geo.publish_featurestore_sqlview(name, title, store_name, sql, key_column='gid', geom_name='the_geom', geom_type='Geometry', workspace=worksp)

# now set the default style
Expand Down
11 changes: 11 additions & 0 deletions terria_catalogV8DB.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ class TerriaCatalogDB:
'"name": "Product Type",' \
'"content": "Content",' \
'"show": false' \
'},' \
'{' \
'"name": "TDS Download URL",' \
'"content": "Content",' \
'"show": false' \
'}' \
']' \
'}'
Expand Down Expand Up @@ -261,6 +266,11 @@ class TerriaCatalogDB:
'"name": "Product Type",' \
'"content": "Content",' \
'"show": false' \
'},' \
'{' \
'"name": "TDS Download URL",' \
'"content": "Content",' \
'"show": false' \
'}' \
']' \
'}'
Expand Down Expand Up @@ -521,6 +531,7 @@ def update_item_info(self, info, layer_info, product_type):
info[10]["content"] = layer_info["stormnumber"]
# layer type - i.e. maxele, maxwvel, etc.
info[11]["content"] = product_type
info[12]["content"] = layer_info["downloadurl"]

return info

Expand Down

0 comments on commit a882a58

Please sign in to comment.