pyIntensityFeatures.utils.coords

Coordinate handling and conversion functions.

Attributes

apexpy

Functions

convert_geo_to_mag(ctime, glat, glon, alt[, method])

Convert and reshape GUVI location output to magnetic coordinates.

get_slice_mlat_max_min(num_samples, mlat_bins, mlt_bins)

Get latitude range of the auroral intensity slice.

as_datetime(time_val)

Ensure a time value is cast as datetime without timezone information.

Module Contents

pyIntensityFeatures.utils.coords.apexpy = None[source]
pyIntensityFeatures.utils.coords.convert_geo_to_mag(ctime, glat, glon, alt, method='ALLOWTRACE')[source]

Convert and reshape GUVI location output to magnetic coordinates.

Parameters:
ctimedt.datetime

Conversion time

glatarray-like

2D array of geodetic latitudes

glonarray-like

2D array of geographic longitudes

altfloat

Altitude of the auroral data in km

methodstr

Magnetic method to use, expects one of the AACGMV2 codes (‘TRACE’, ‘ALLOWTRACE’, ‘BADIDEA’, ‘GEOCENTRIC’), ‘apex’, or ‘qd’. The last two methods correspond to apex and quasi-dipole coordiantes, and only work if apexpy is available. (default=’ALLOWTRACE’)

Returns:
mlatarray-like

2D array of magnetic latitudes

mlonarray-like

2D array of magnetic longitudes

mltarray-like

2D array of magnetic local times

Raises:
ValueError

If ‘apex’ or ‘qd’ is requested, but apexpy is not available.

pyIntensityFeatures.utils.coords.get_slice_mlat_max_min(num_samples, mlat_bins, mlt_bins, mlat_inc=1.0)[source]

Get latitude range of the auroral intensity slice.

Parameters:
num_samplesarray-like

2D array with number of samples in each mlat/mlt bin

mlat_binsnp.array

Magnetic latitude of output bin centres

mlt_binsnp.array

Magnetic local time of output bin centres

mlat_incfloat

Magnetic latitude increment for output (default=1.0)

Returns:
mlat_minfloat

Minimum magnetic latitude along MLT slice that also contains the magnetic latitude maximum in degrees

mlat_maxfloat

Maximum magnetic latitude of slice in degrees

pyIntensityFeatures.utils.coords.as_datetime(time_val)[source]

Ensure a time value is cast as datetime without timezone information.

Parameters:
time_valobject

Date and time object that may be np.datetime64, pds.datetime, dt.datetime, or dt.date

Returns:
out_timedt.datetime

desired casting of the datetime object