Occasionally, we get a netCDF file that is missing a particular window's variables. I suspect this is accidental, like they commented out a window in the multiggg.sh file and forgot to put it back. While we want the private writer to be flexible for default use for non-TCCON output, when used in GGG post processing, it should expect that the minimum set of windows is present.
I think I can handle this by adding a require_windows input to the file readers, or a separate method that checks the data that we can call first with these required windows. Then it will be up to each handler to figure out what variables that means it must have.
However, this might fail for things like the extract_pth.out file. So the other way to go would be to define a trait for types that return the required variables for each file. This could be given the file name or an enum of the file (with an Other variant), and return the exact list of required variables for that file.
A third option would be similar to the second, but returning a list of files expected as inputs or checking the list. This would be much easier to check, but would miss the case where a variable in the file is missing. We could maybe combine the second and third approaches, the third for a quick first check, the second for a check after the netCDF file is written, or it could still be done during the write.
Occasionally, we get a netCDF file that is missing a particular window's variables. I suspect this is accidental, like they commented out a window in the multiggg.sh file and forgot to put it back. While we want the private writer to be flexible for default use for non-TCCON output, when used in GGG post processing, it should expect that the minimum set of windows is present.
I think I can handle this by adding a
require_windowsinput to the file readers, or a separate method that checks the data that we can call first with these required windows. Then it will be up to each handler to figure out what variables that means it must have.However, this might fail for things like the
extract_pth.outfile. So the other way to go would be to define a trait for types that return the required variables for each file. This could be given the file name or an enum of the file (with anOthervariant), and return the exact list of required variables for that file.A third option would be similar to the second, but returning a list of files expected as inputs or checking the list. This would be much easier to check, but would miss the case where a variable in the file is missing. We could maybe combine the second and third approaches, the third for a quick first check, the second for a check after the netCDF file is written, or it could still be done during the write.