pyPSCF package¶
Submodules¶
pyPSCF.BackTrajHysplit module¶
pyPSCF.pyPSCF module¶
-
class
pyPSCF.pyPSCF.
PSCF
(station, specie, lat0, lon0, folder, prefix, add_hour, concFile, dateMin, dateMax, percentile=75, threshold=None, wfunc=True, wfunc_type='auto', resQuality='110m', smoothplot=True, mapMinMax=None, cutWithRain=True, hourinthepast=72, plotBT=True, plotPolar=True, pd_kwarg=None)[source]¶ Bases:
object
- Parameters
station (str) – The name of the station.
specie (str) – The specie to study. Must be specified in the concentration file.
lat0 (float) – The latitude of the starting point.
lon0 (float) – The longitude of the starting point.
folder (str, path) – Path to the backtrajectories files.
prefix (str) – Prefix of all backtrajectories. Something like ‘traj_OPE_’
add_hour (list or array) –
List of backtrajecories starting hours around the reference hour. Example: add_hour=[-3,0,3] and reference hour of 2017-03-15 09:00, the following backtrajectories will be used:
2017-03-15 06:00
2017-03-15 09:00
2017-03-15 12:00
All theses backtrajecories are associated to the concentration of the refrence hour.
concFile (str, path.) – The path to the concentration file.
dateMin (str or datetime object) – The minimal date to account.
dateMax (str or datetime object) – The maximal date to account.
percentile (int, default 75) – The percentile to use as threshold.
threshold (float, default None) – The concentration threshold. It overrides the percentile value.
wfunc (boolean, default True) – Either or not use a weighting function.
wfunc_type ("manual" or "auto", default "auto") – Type of weighting function. “auto” is continuous.
mapMinMax (dict) – Dictionary of minimun/maximum of lat/lon for the map. Example: mapMinMax = {‘latmin’: 37.5, ‘latmax’: 60, ‘lonmin’: -10, ‘lonmax’: 20} This example is the default (France centered).
cutWithRain (boolean, default True) – Either or not cut the backtrajectory to the last rainning date.
hourinthepast (integer, default 72) – Number of hour considered for the backtrajectory life.
resQuality ('110m' or '50m', default '110m') – The quality of the map.
smoothplot (boolean, default True) – Use a gaussian filter to smooth the map plot.
plotBT (boolean, default True) – Either or not plot all the backtraj in a new axe.
plotPolar (boolean, default True) – Either or not plot the direction the distribution of the PSCF in a polar plot.
- Other Parameters
pd_kwarg (dict, optional) – Dictionary of option pass to pd.read_csv to read the concentration file. By default, pd_kwarg={‘index_col’=0, ‘parse_date’=[‘date’]}.
-
extractBackTraj
()[source]¶ Sum up back trajectories file into a pandas DataFrame according to the class parameters.
- Returns
df
- Return type
pd.DataFrame
-
run
()[source]¶ Run the PSCF model and add 4 attributes to the PSCF object:
- Returns
ngrid_ (ndarray) – The number of end-point of back-trajectories in each grid cell
mgrid_ (ndarray) – The number of en-point of back-trajectories in each grid cell accociated with concentration > self.concCrit
PSCF_ (ndarray) – mgrid/ngrid, the PSCF data.
trajdensity_ (ndarray) – log_10(ngrid)