nanotune.data.export_data

nanotune.data.export_data.export_label(ds_label: List[str], quality: int, category: str) int[source]

Merges binary labels of single and double dot qualities to a single label. Only if dotregime is specified, for all other the initial quality labels are returned. It translates a dot regime label to: 0 - poor singledot, 1 - good singledot, 2 - poor doubledot, 3 - good doubledot.

Returns

int – new label.

nanotune.data.export_data.prep_data(dataset: Dataset, category: str, flip_data: bool = False, readout_method_to_use: str = 'transport') List[List[List[float]]][source]

Prepares data for classification. It combines normalized data, its gradient, Fourier frequencies and extracted features into a multidimensional list. All sublists are reshaped to a standard shape, defined in config.json under the standard_shapes key.

Parameters
  • dataset – instance of nanotune dataset whose data should be prepared.

  • category – as which category/type of data, e.g. pinchoff, singledot etc, it should be treated.

  • flip_data – whether data should be flipped. Used to simulate pinchoff curves measured in rf sensing.

Returns

list – multidimensional list. First sublist is normalized data, second Fourier frequencies, third gradient and fourth features.

nanotune.data.export_data.export_data(category: str, db_names: List[str], skip_ids: Optional[Dict[str, List[int]]] = None, add_flipped_data: bool = False, quality: Optional[int] = None, filename: Optional[str] = None, db_folder: Optional[str] = None, readout_method_to_use: str = 'transport') None[source]

Exports condensed data to a numpy file in a format used by nanotune’s Classifier.

The saved array contains the normalized signal, gradient, Fourier frequencies and extracted features of each dataset. The machine learning labels are attached to each of them to the very end. A dataset of 15 1D measurements results in an array of (4, 15, 101), where each trace has been reshaped to 100 points plus the label. The first array[0, :, :] are all signals, array[1, :, :] the frequencies, array is defined in config.json under data_types.

Parameters
  • category – nt.config[‘core’][‘features’].keys()

  • db_names – names of databases whose data should be exported.

  • skip_ids – dict mapping database names to list of run IDs which should be skipped.

  • add_flipped_data – whether or flipped data should be added as well. a flipped pinchoff curve measured in transport for example reproduces a pinchoff measured in rf.

  • quality – which qualities, e.g. only good or poor data, should be exported. If none give, both will be taken.

  • filename – name of resulting numpy file. Default is the category name.

  • db_folder – folder where databases are located.

  • readout_method_to_use – which readout method to use if more than one is available. Default is ‘transport’.

nanotune.data.export_data.correct_normalizations(filename: str, db_folder: Optional[str] = None) None[source]