Add a method which will take as input the netcdf resource, the plottable variable and return the data in csv format. This can be accomplished using the pandas.to_csv functionalities or by returning a proper formatted string in the fastapi rest method.
A link to this functionality has to be available in a dedicated DIV into the drupal module