Skip to content

Latest commit

 

History

History
289 lines (289 loc) · 14.1 KB

pandataset.md

File metadata and controls

289 lines (289 loc) · 14.1 KB

Documentation

pangaeapy/pandataset module

Created on Tue Aug 21 13:31:30 2018

@author: Robert Huber @author: Markus Stocker

Classes

class PanAuthor

PANGAEA Author Class. A simple helper class to declare 'author' objects which are associated as part of the metadata of a given PANGAEA dataset object

Parameters

lastname : str
The author's first name
firstname : str
The authors's last name

Attributes

lastname : str
The author's first name
firstname : str
The authors's last name
fullname : str
Combination of lastname, firstname. This attribute is created by the constructor

Methods

def __init__(self, lastname, firstname=None)

Initialize self. See help(type(self)) for accurate signature.

class PanDataSet

PANGAEA DataSet The PANGAEA PanDataSet class enables the creation of objects which hold the necessary information, including data as well as metadata, to analyse a given PANGAEA dataset.

Parameters

id : str
The identifier of a PANGAEA dataset. An integer number or a DOI is accepted here
deleteFlag : str
in case quality flags are avialable, this parameter defines a flag for which data should not be included in the data dataFrame. Possible values are listed here: https://wiki.pangaea.de/wiki/Quality_flag

Attributes

id : str
The identifier of a PANGAEA dataset. An integer number or a DOI is accepted here
uri : str
The PANGAEA DOI
title : str
The title of the dataset
year : int
The publication year of teh dataset
authors : list of PanAuthor
a list containing the PanAuthot objects (author info) of the dataset
citation : str
the full citation of the dataset including e.g. author, year, title etc..
params : list of PanParam
a list of all PanParam objects (the parameters) used in this dataset
events : list of PanEvent
a list of all PanEvent objects (the events) used in this dataset
data : pandas.DataFrame
a pandas dataframe holding all the data
loginstatus : str
a label which indicates if the data set is protected or not default value: 'unrestricted'
isParent : boolean
indicates if this dataset is a parent data set within a collection of child data sets

Methods

def __init__(self, id=None, deleteFlag='')

Initialize self. See help(type(self)) for accurate signature.

def setData(self, addEventColumns=True)

This method populates the data DataFrame with data from a PANGAEA dataset. In addition to the data given in the tabular ASCII file delivered by PANGAEA.

Parameters:

addEventColumns : boolean
In case Latitude, Longititude, Elevation, Date/Time and Event are not given in the ASCII matrix, which sometimes is possible in single Event datasets, the setData could add these columns to the dataframe using the information given in the metadata for Event. Default is 'True'
def setID(self, id)

Initialize the ID of a data set in case it was not defined in the constructur Parameters


id : str
The identifier of a PANGAEA dataset. An integer number or a DOI is accepted here
def setMetadata(self)

The method initializes the metadata of the PanDataSet object using the information of a PANGAEA metadata XML file.

class PanEvent

PANGAEA Event Class. An Event can be regarded as a named entity which is defined by the usage of a distinct method or device at a distinct location during a given time interval for scientific purposes. More infos on PANGAEA's Evenmts can be found here: https://wiki.pangaea.de/wiki/Event

Parameters

label : str
A label which is used to name the event
latitude : float
The latitude of the event location
longitude : float
The longitude of the event location
elevation : float
The elevation (relative to sea level) of the event location
datetime : str
The date and time of the event in ´%Y/%m/%dT%H:%M:%S´ format
device : str
The device which was used during the event

Attributes

label : str
A label which is used to name the event
latitude : float
The latitude of the event location
longitude : float
The longitude of the event location
elevation : float
The elevation (relative to sea level) of the event location
datetime : str
The date and time of the event in ´%Y/%m/%dT%H:%M:%S´ format
device : str
The device which was used during the event

Methods

def __init__(self, label, latitude, longitude, elevation=None, datetime=None, device=None)

Initialize self. See help(type(self)) for accurate signature.

class PanParam

PANGAEA Parameter Shoud be used to create PANGAEA parameter objects. Parameter is used here to represent 'measured variables'

Parameters

id : int
the identifier for the parameter
name : str
A long name or title used for the parameter
shortName : str
A short name or label to identify the parameter
param_type : str
indicates the data type of the parameter (string, numeric, datetime etc..)
source : str
defines the category or source for a parameter (e.g. geocode, data, event)… very PANGAEA specific ;)
unit : str
the unit of measurement used with this parameter (e.g. m/s, kg etc..)

Attributes

id : int
the identifier for the parameter
name : str
A long name or title used for the parameter
shortName : str
A short name or label to identify the parameter
synonym : dict
A diconary of synonyms for the parameter whcih e.g. is used by other archives or communities. The dict key indicates the namespace (possible values currently are CF and OS)
type : str
indicates the data type of the parameter (string, numeric, datetime etc..)
source : str
defines the category or source for a parameter (e.g. geocode, data, event)… very PANGAEA specific ;)
unit : str
the unit of measurement used with this parameter (e.g. m/s, kg etc..)

Methods

def __init__(self, id, name, shortName, param_type, source, unit=None)

Initialize self. See help(type(self)) for accurate signature.

def addSynonym(name, ns)

Creates a new synonym for a parameter which is valid within the given name space. Synonyms are stored in the synonym attribute which is a dictionary

Parameters

name : str
the name of the synonym
ns : str
the namespace indicator for the sysnonym

Index