cardat / air-health-bushfire-smoke-netcdf

Software to share australian bushfire smoke data funded by CAR and ARDC. Supported by CurtinIC and ASDAF
MIT License
1 stars 0 forks source link

hard coded elements in scripts need to be removed #4

Closed ivanhanigan closed 1 year ago

ivanhanigan commented 2 years ago
  1. batch_translate has "Current data revision date: 20220211"
  2. netcdf_translate has Global Section / references "Pang, C" but should be the actual authors
ivanhanigan commented 2 years ago

merge_clean also needs the global section edited

calvin-curtin commented 2 years ago

Can add revision date as an argument. Ideally it should be the date in which the GeoTIFFs were generated or could set it as the date the GeoTIFFs were converted.

Please provide the following information for the metadata fields to ensure CF compliance.

@MilesSowden Please advise if there is any further information that is required for CF compliance.

MilesSowden commented 2 years ago

I would like to see an XML (or similar) file rather than hard coded

<Projection>-a_srs EPSG:3577</Projection>
<Attributes>
<Institution>Curtin</Institution>
<Title>ADAF Bushdire</Title>
</Attributes>
<layers>
<NoOfLayers>20</NoOfLayers>
<Layer1><old>active_10000</old><new>active_fires_10000</new></Layer1>
<Layer2><old>active_5000</old><new>active_fires_5000</new></Layer2>
</layers>
ivanhanigan commented 2 years ago

we can use the tool that I already use to generate XML using the Ecological Metadata Language (EML) schema https://github.com/ropensci/EML and https://sbclter.msi.ucsb.edu/external/InformationManagement/EML_211_schema/docs/eml-2.1.1/index.html

I will have a go at generating an example XML now

ivanhanigan commented 2 years ago

I was creating the XML as mentioned, and I want to put the CRS (EPSG:3577 GDA94 / Australian Albers) into the horizCoordSysName tag of the https://sbclter.msi.ucsb.edu/external/InformationManagement/EML_211_schema/docs/eml-2.1.1/eml-spatialReference.html

Also here https://raw.githubusercontent.com/NCEAS/eml/main/eml-spatialReferenceDictionary.xml

But the list of Allowed values does not have this option. @MilesSowden any ideas?

ivanhanigan commented 2 years ago

Any objections to parsing the geographicDescription For eg.

geographicDescription <- 'OGC WKT = PROJCS["GDA94 / Australian Albers",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6283"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4283"]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["standard_parallel_1",-18],PARAMETER["standard_parallel_2",-36],PARAMETER["latitude_of_center",0],PARAMETER["longitude_of_center",132],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","3577"]]'
ivanhanigan commented 2 years ago

here is a test XML that is also a valid EML metadata file (without the variables done yet) https://github.com/cardat/air-health-bushfire-smoke-netcdf/blob/main/working_ivan/Bushfire_specific_PM25_Aus_2001_2020_v1_2.xml

ivanhanigan commented 2 years ago

This is not the absolutely correct way to use EML, but it is one way I think that we can make sure that all the required fields for CF compliant netCDFs will be autopopulated from the CARDAT data inventory

Rather than the dataTable type I should use instead the eml-spatialRaster module https://sbclter.msi.ucsb.edu/external/InformationManagement/EML_211_schema/docs/eml-2.1.1/index.html#N10158

ivanhanigan commented 2 years ago

I may have gone with overkill by quoting the whole OGC WKT for the CRS. I can see Miles is only asking for EPSG:XYZ in the code.

MilesSowden commented 2 years ago

XML input a subsequent phase. Interim solution (Tiff2NetCDF_.sh hard codes elements at the start of the file making it easy to amend the code for different files

MilesSowden commented 2 years ago

Made a few changes to the XML tags. @ivanhanigan are these good or do you want to rename them.

inner tag is unmatched?
ivanhanigan commented 2 years ago

@MilesSowden we want to make a valid EML 2.1.1 metadata XML so have to use the tags as specified like how the CRS should go into the horizCoordSysName tag of the https://sbclter.msi.ucsb.edu/external/InformationManagement/EML_211_schema/docs/eml-2.1.1/eml-spatialReference.html But (EPSG:3577 GDA94 / Australian Albers) is not in their list. I also checked here https://raw.githubusercontent.com/NCEAS/eml/main/eml-spatialReferenceDictionary.xml

so that is when I thought we could just use the geographicDescription tag

geographicDescription is a short text description of a dataset's geographic areal domain...

This element can also contain ... the projection system that the latitude and longitude coordinates were taken from.

The years should be in the temporalCoverage tag

This field specifies temporal coverage, and allows coverages to be a single point in time, multiple points in time, or a range of dates.

https://sbclter.msi.ucsb.edu/external/InformationManagement/EML_211_schema/docs/eml-2.1.1/eml-coverage.html

ivanhanigan commented 1 year ago

moving to new code with @truth-quark

ivanhanigan commented 1 year ago

moving to new code