Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not printing empty variable to files #198

Open
BaptisteVandecrux opened this issue Nov 1, 2023 · 1 comment
Open

Not printing empty variable to files #198

BaptisteVandecrux opened this issue Nov 1, 2023 · 1 comment

Comments

@BaptisteVandecrux
Copy link
Member

BaptisteVandecrux commented Nov 1, 2023

At KAN_B for example, there is no GPS, no ice temperature, no pressure transducer

We had already removed the variables cc, dlhf, dshf from the tundra sites:
#155

Should we also do the same with t_i and z_pt?
Some tundra sites might have active GPS ?

Same thing for KAN_U that never had a pressure transducer.

@BaptisteVandecrux
Copy link
Member Author

This could be fixed by adding:

        # removing empty variables
        for var in self.L3.data_vars:
            if self.L3[var].isnull().all():
                logger.info(f'removing {var} because empty')
                col_names.remove(var)

right after colname is being defined:

def writeArr(self, outpath):
'''Write L3 data to .nc and .csv hourly and daily files
Parameters
----------
outpath : str
Output directory
L3 : AWS.L3
Level-3 data object
'''
outdir = os.path.join(outpath, self.L3.attrs['station_id'])
if not os.path.isdir(outdir):
os.mkdir(outdir)
col_names = getColNames(
self.vars,
self.L3.attrs['number_of_booms'],
self.L3.attrs['format'],
self.L3.attrs['bedrock'],
)

But we need to decide:

  • if there's never been a pressure transducer at a site (like KAN_U) do we want that variable removed?
  • if there's been a pressure transducer but it has never been functional (like KPC_Uv3), do we want that variable removed?
  • At the moment, for both cases above, the final files contain variables z_pt and z_pt_cor full of NaN. Is that confusing for the data users? If not then I am fine closing this as "won't fix".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant