nais package¶
nais.checker module¶
- nais.checker.startNaisChecker(dataset_path, bounding_boxes_path)¶
Manually check a NAIS dataset, draw bounding boxes around bad data and save the boundaries into a netcdf file for later use.
- Parameters:
- data_filestr
Absolute path to NAIS netcdf data file
- boundary_filestr
Absolyte path to file where to save the coordinates of bad data bounding boxes.
nais.processor module¶
- nais.processor.make_config_template(file_name)¶
Make a configuration file template
- Parameters:
- file_namestr
full path to configuration file. For example /home/user/config.yml
- nais.processor.nais_processor(config_file)¶
Processes NAIS data
- Parameters:
- config_filestr
full path to configuration file
nais.utils module¶
- nais.utils.combine_data(source_dir, date_range, time_reso, flag_sensitivity=0.5)¶
Combine netcdf datafiles and resample to new resolution on continuous time index
- Parameters:
- source_dirstr
Directory for NAIS datafiles
- date_rangepandas.DatetimeIndex
Range of dates for combining data
- time_resostr
A pandas date frequency string. See for all options here: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
- flag_sensitivityfloat
fraction of time flag needs to be present in resampling
- Returns:
- xarray.Dataset or None
Combined dataset, None if no data in the date range
- nais.utils.combine_databases(database_list, combined_database)¶
Combine JSON databases
- Parameters:
- database_listlist of str
List of full paths to databases that should be combined. First database should have the earliest data, second database the second earliest and so on
- combined_databasestr
full path to combined database
- nais.utils.remove_bad_data(ds, bad_data)¶
Set bad data to NaNs
- Parameters:
- dsxarray.Dataset
NAIS datafile
- bad_dataxarray.Dataset
user-determined bad data boundaries using the NaisChecker()
- Returns:
- xarray.Dataset
Dataset with possible bad data set to NaN
- nais.utils.remove_flagged_rows(ds, flag)¶
Set data associated with given flag as NaN
- Parameters:
- dsxarray.Dataset
NAIS dataset
- flagstr
Flag to be removed
- Returns:
- xarray.Dataset
NAIS dataset with flag rows set to NaN