Open honzaflash opened 1 month ago
Steps to reproduce
.nc
file is available at https://files.stage.platforms.axds.co/axiom/netcdf_harvest/smru/ct145-427-BAT-18/processed.ncfileDir
to where the server will access it from)
subsetVariables
attributeAlso
docker exec -it erddap-container bash
GenerateDatasetsXml.sh
scriptsusbsetVariables
in the commented "sourceAttributes" section
Describe the bug When using
EDDTableFromNcCFFiles
ERDDAP unexpectedly showssourceVariables
attribute in dataset's metadata even though the attribute is not added in thedatasets.xml
configuration nor is it present in the source netCDF file. Furthermore, it seems to use source variable names - this means that if you rename the variables by using a different<destinationName>
the dataset won't load. Also when using theGenerateDatasetsXml
tool thesourceVariables
attribute also shows up in the commented "sourceAttributes" section (despite not being an attribute in the source file).To Reproduce I will add a separate comment with example files, xml, and instructions.
Expected behavior
sourceVariables
attribute continues to be generated but using variable destination names.sourceVariables
will be printed under<addAttributes>
and not in the source attributes section when usingGenerateDatasetsXml
scripts. Also this behavior should be documented. I did not find any mention of the attribute being generated besides for SOS datasets.Additional context I have traced the problem for dataset xml generation. I believe the "sourceAttributes" in the output xml come from here: https://github.com/ERDDAP/erddap/blob/2ef97c8207ab161126f4de419dd2289a0dd9be04/WEB-INF/classes/gov/noaa/pfel/erddap/dataset/EDDTableFromNcCFFiles.java#L467
Table
class is used for thedataSourceTable
: https://github.com/ERDDAP/erddap/blob/2ef97c8207ab161126f4de419dd2289a0dd9be04/WEB-INF/classes/gov/noaa/pfel/erddap/dataset/EDDTableFromNcCFFiles.java#L318readNcCF
sets the global attribute to a value computed from other attributes: https://github.com/ERDDAP/erddap/blob/2ef97c8207ab161126f4de419dd2289a0dd9be04/WEB-INF/classes/gov/noaa/pfel/coastwatch/pointdata/Table.java#L8301