From 8032bfe363a542af1c39518c5e6ea846531a20f3 Mon Sep 17 00:00:00 2001 From: Darren Chaddock Date: Sun, 8 Dec 2024 00:03:05 +0000 Subject: [PATCH] updated docs --- docs/generated/index.js | 174 +++++--- .../pyaurorax/data/ucalgary/index.html | 98 ++++- .../pyaurorax/data/ucalgary/read/index.html | 395 +++++++++++++++++- .../pyaurorax/tools/classes/keogram.html | 26 +- .../pyaurorax/tools/classes/mosaic.html | 119 +++++- docs/generated/pyaurorax/tools/index.html | 150 +++++-- .../pyaurorax/tools/keogram/index.html | 16 +- .../pyaurorax/tools/mosaic/index.html | 24 +- .../pyaurorax/tools/spectra/index.html | 192 +++++++++ 9 files changed, 1042 insertions(+), 152 deletions(-) create mode 100644 docs/generated/pyaurorax/tools/spectra/index.html diff --git a/docs/generated/index.js b/docs/generated/index.js index 8586d4c5..2f3a77f5 100644 --- a/docs/generated/index.js +++ b/docs/generated/index.js @@ -42,12 +42,13 @@ URLS=[ "pyaurorax/tools/ccd_contour/index.html", "pyaurorax/tools/classes/index.html", "pyaurorax/tools/classes/montage.html", -"pyaurorax/tools/classes/mosaic.html", "pyaurorax/tools/classes/keogram.html", +"pyaurorax/tools/classes/mosaic.html", "pyaurorax/tools/keogram/index.html", "pyaurorax/tools/montage/index.html", "pyaurorax/tools/mosaic/index.html", -"pyaurorax/tools/grid_files/index.html" +"pyaurorax/tools/grid_files/index.html", +"pyaurorax/tools/spectra/index.html" ]; INDEX=[ { @@ -244,7 +245,7 @@ INDEX=[ { "ref":"pyaurorax.data.ucalgary.UCalgaryManager.read", "url":2, -"doc":"Read in data files for a given dataset. Note that only one type of dataset's data should be read in using a single call. Args: dataset (Dataset): The dataset object for which the files are associated with. This parameter is required. file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXUnsupportedReadError: an unsupported dataset was used when trying to read files. pyaurorax.exceptions.AuroraXError: a generic read error was encountered Notes: - For users who are familiar with the themis-imager-readfile and trex-imager-readfile libraries, the read function provides a near-identical usage. Further improvements have been integrated, and those libraries are anticipated to be deprecated at some point in the future.", +"doc":"Read in data files for a given dataset. Note that only one type of dataset's data should be read in using a single call. Args: dataset (Dataset): The dataset object for which the files are associated with. This parameter is required. file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. start_time (datetime.datetime): The start timestamp to read data onwards from (inclusive). This can be utilized to read a portion of a data file, and could be paired with the end_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will assume the start time is the timestamp of the first record in the first file supplied (ie. beginning of the supplied data). This parameter is optional. end_time (datetime.datetime): The end timestamp to read data up to (inclusive). This can be utilized to read a portion of a data file, and could be paired with the start_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will it will assume the end time is the timestamp of the last record in the last file supplied (ie. end of the supplied data). This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXUnsupportedReadError: an unsupported dataset was used when trying to read files. pyaurorax.exceptions.AuroraXError: a generic read error was encountered Notes: - For users who are familiar with the themis-imager-readfile and trex-imager-readfile libraries, the read function provides a near-identical usage. Further improvements have been integrated, and those libraries are anticipated to be deprecated at some point in the future.", "func":1 }, { @@ -279,7 +280,7 @@ INDEX=[ { "ref":"pyaurorax.data.ucalgary.Dataset", "url":2, -"doc":"A dataset available from the UCalgary Space Remote Sensing API, with possibly support for downloading and/or reading. Attributes: name (str): Dataset name short_description (str): A short description about the dataset long_description (str): A longer description about the dataset data_tree_url (str): The data tree URL prefix. Used for saving data locally with a similar data tree structure compared to the UCalgary Open Data archive. file_listing_supported (bool): Flag indicating if file listing (downloading) is supported for this dataset. file_reading_supported (bool): Flag indicating if file reading is supported for this dataset. level (str): Dataset level as per L0/L1/L2/etc standards. doi (str): Dataset DOI unique identifier. doi_details (str): Further details about the DOI. citation (str): String to use when citing usage of the dataset. provider (str): Data provider. supported_libraries (List[str]): Libraries that support usage of this dataset." +"doc":"A dataset available from the UCalgary Space Remote Sensing API, with possibly support for downloading and/or reading. Attributes: name (str): Dataset name short_description (str): A short description about the dataset long_description (str): A longer description about the dataset data_tree_url (str): The data tree URL prefix. Used for saving data locally with a similar data tree structure compared to the UCalgary Open Data archive. file_listing_supported (bool): Flag indicating if file listing (downloading) is supported for this dataset. file_reading_supported (bool): Flag indicating if file reading is supported for this dataset. file_time_resolution (str): Time resolution of the files for this dataset, represented as a string. Possible values are: 1min, 1hr, 1day, not_applicable. level (str): Dataset level as per L0/L1/L2/etc standards. doi (str): Dataset DOI unique identifier. doi_details (str): Further details about the DOI. citation (str): String to use when citing usage of the dataset. provider (str): Data provider. supported_libraries (List[str]): Libraries that support usage of this dataset." }, { "ref":"pyaurorax.data.ucalgary.Dataset.pretty_print", @@ -403,7 +404,7 @@ INDEX=[ { "ref":"pyaurorax.data.ucalgary.Skymap", "url":2, -"doc":"Representation for a skymap file. Attributes: filename (str): Filename for the skymap file, as an absolute path of its location on the local machine. project_uid (str): Project unique identifier site_uid (str): Site unique identifier imager_uid (str): Imager/device unique identifier site_map_latitude (float): Geodetic latitude of instrument site_map_longitude (float): Geodetic longitude of instrument site_map_altitude (float): Altitude of the instrument (in meters) full_elevation (ndarray): Elevation angle from horizon, for each image pixel (in degrees) full_azimuth (ndarray): Local azimuth angle from 0 degrees north, positive moving east (in degrees) full_map_altitude (ndarray): Altitudes that image coordinates are mapped to (in kilometers) full_map_latitude (ndarray): Geodetic latitudes of pixel corners, mapped to various altitudes (specified by full_map_altitude ) full_map_longitude (ndarray): Geodetic longitudes of pixel corners, mapped to various altitudes (specified by full_map_altitude ) generation_info (SkymapGenerationInfo): Metadata describing details about this skymap's generation process version (str): Version of the skymap dataset (Dataset): The Dataset object for this data." +"doc":"Representation for a skymap file. Attributes: filename (str): Filename for the skymap file, as an absolute path of its location on the local machine. project_uid (str): Project unique identifier site_uid (str): Site unique identifier imager_uid (str): Imager/device unique identifier site_map_latitude (float): Geodetic latitude of instrument site_map_longitude (float): Geodetic longitude of instrument site_map_altitude (float): Altitude of the instrument (in meters) full_elevation (ndarray): Elevation angle from horizon, for each image pixel (in degrees) full_azimuth (ndarray | None): Local azimuth angle from 0 degrees north, positive moving east (in degrees). None for TREx Spectrograph. full_map_altitude (ndarray): Altitudes that image coordinates are mapped to (in kilometers) full_map_latitude (ndarray): Geodetic latitudes of pixel corners, mapped to various altitudes (specified by full_map_altitude ) full_map_longitude (ndarray): Geodetic longitudes of pixel corners, mapped to various altitudes (specified by full_map_altitude ) generation_info (SkymapGenerationInfo): Metadata describing details about this skymap's generation process version (str): Version of the skymap dataset (Dataset): The Dataset object for this data." }, { "ref":"pyaurorax.data.ucalgary.Skymap.filename", @@ -558,7 +559,7 @@ INDEX=[ { "ref":"pyaurorax.data.ucalgary.read.ReadManager.read", "url":3, -"doc":"Read in data files for a given dataset. Note that only one type of dataset's data should be read in using a single call. Args: dataset (Dataset): The dataset object for which the files are associated with. This parameter is required. file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXUnsupportedReadError: an unsupported dataset was used when trying to read files. pyaurorax.exceptions.AuroraXError: a generic read error was encountered Notes: - For users who are familiar with the themis-imager-readfile and trex-imager-readfile libraries, the read function provides a near-identical usage. Further improvements have been integrated, and those libraries are anticipated to be deprecated at some point in the future.", +"doc":"Read in data files for a given dataset. Note that only one type of dataset's data should be read in using a single call. Args: dataset (Dataset): The dataset object for which the files are associated with. This parameter is required. file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. start_time (datetime.datetime): The start timestamp to read data onwards from (inclusive). This can be utilized to read a portion of a data file, and could be paired with the end_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will assume the start time is the timestamp of the first record in the first file supplied (ie. beginning of the supplied data). This parameter is optional. end_time (datetime.datetime): The end timestamp to read data up to (inclusive). This can be utilized to read a portion of a data file, and could be paired with the start_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will it will assume the end time is the timestamp of the last record in the last file supplied (ie. end of the supplied data). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXUnsupportedReadError: an unsupported dataset was used when trying to read files. pyaurorax.exceptions.AuroraXError: a generic read error was encountered Notes: - For users who are familiar with the themis-imager-readfile and trex-imager-readfile libraries, the read function provides a near-identical usage. Further improvements have been integrated, and those libraries are anticipated to be deprecated at some point in the future.", "func":1 }, { @@ -570,31 +571,31 @@ INDEX=[ { "ref":"pyaurorax.data.ucalgary.read.ReadManager.read_rego", "url":3, -"doc":"Read in REGO raw data (stream0 pgm files). Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. dataset (Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXError: a generic read error was encountered", +"doc":"Read in REGO raw data (stream0 pgm files). Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. start_time (datetime.datetime): The start timestamp to read data onwards from (inclusive). This can be utilized to read a portion of a data file, and could be paired with the end_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will assume the start time is the timestamp of the first record in the first file supplied (ie. beginning of the supplied data). This parameter is optional. end_time (datetime.datetime): The end timestamp to read data up to (inclusive). This can be utilized to read a portion of a data file, and could be paired with the start_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will it will assume the end time is the timestamp of the last record in the last file supplied (ie. end of the supplied data). This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. dataset (Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXError: a generic read error was encountered", "func":1 }, { "ref":"pyaurorax.data.ucalgary.read.ReadManager.read_trex_nir", "url":3, -"doc":"Read in TREx near-infrared (NIR) raw data (stream0 pgm files). Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. dataset (Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXError: a generic read error was encountered", +"doc":"Read in TREx near-infrared (NIR) raw data (stream0 pgm files). Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. start_time (datetime.datetime): The start timestamp to read data onwards from (inclusive). This can be utilized to read a portion of a data file, and could be paired with the end_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will assume the start time is the timestamp of the first record in the first file supplied (ie. beginning of the supplied data). This parameter is optional. end_time (datetime.datetime): The end timestamp to read data up to (inclusive). This can be utilized to read a portion of a data file, and could be paired with the start_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will it will assume the end time is the timestamp of the last record in the last file supplied (ie. end of the supplied data). This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. dataset (Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXError: a generic read error was encountered", "func":1 }, { "ref":"pyaurorax.data.ucalgary.read.ReadManager.read_trex_blue", "url":3, -"doc":"Read in TREx Blueline raw data (stream0 pgm files). Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. dataset (Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXError: a generic read error was encountered", +"doc":"Read in TREx Blueline raw data (stream0 pgm files). Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. start_time (datetime.datetime): The start timestamp to read data onwards from (inclusive). This can be utilized to read a portion of a data file, and could be paired with the end_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will assume the start time is the timestamp of the first record in the first file supplied (ie. beginning of the supplied data). This parameter is optional. end_time (datetime.datetime): The end timestamp to read data up to (inclusive). This can be utilized to read a portion of a data file, and could be paired with the start_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will it will assume the end time is the timestamp of the last record in the last file supplied (ie. end of the supplied data). This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. dataset (Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXError: a generic read error was encountered", "func":1 }, { "ref":"pyaurorax.data.ucalgary.read.ReadManager.read_trex_rgb", "url":3, -"doc":"Read in TREx RGB raw data (stream0 h5, stream0.burst png.tar, unstable stream0 and stream0.colour pgm and png ). Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. dataset (Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXError: a generic read error was encountered", +"doc":"Read in TREx RGB raw data (stream0 h5, stream0.burst png.tar, unstable stream0 and stream0.colour pgm and png ). Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. start_time (datetime.datetime): The start timestamp to read data onwards from (inclusive). This can be utilized to read a portion of a data file, and could be paired with the end_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will assume the start time is the timestamp of the first record in the first file supplied (ie. beginning of the supplied data). This parameter is optional. end_time (datetime.datetime): The end timestamp to read data up to (inclusive). This can be utilized to read a portion of a data file, and could be paired with the start_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will it will assume the end time is the timestamp of the last record in the last file supplied (ie. end of the supplied data). This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. dataset (Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXError: a generic read error was encountered", "func":1 }, { "ref":"pyaurorax.data.ucalgary.read.ReadManager.read_trex_spectrograph", "url":3, -"doc":"Read in TREx Spectrograph raw data (stream0 pgm files). Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. dataset (Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXError: a generic read error was encountered", +"doc":"Read in TREx Spectrograph raw data (stream0 pgm files). Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. start_time (datetime.datetime): The start timestamp to read data onwards from (inclusive). This can be utilized to read a portion of a data file, and could be paired with the end_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will assume the start time is the timestamp of the first record in the first file supplied (ie. beginning of the supplied data). This parameter is optional. end_time (datetime.datetime): The end timestamp to read data up to (inclusive). This can be utilized to read a portion of a data file, and could be paired with the start_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will it will assume the end time is the timestamp of the last record in the last file supplied (ie. end of the supplied data). This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned Data object. This parameter is optional. dataset (Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A [ Data ](https: docs-pyucalgarysrs.phys.ucalgary.ca/data/classes.html pyucalgarysrs.data.classes.Data) object containing the data read in, among other values. Raises: pyaurorax.exceptions.AuroraXError: a generic read error was encountered", "func":1 }, { @@ -610,6 +611,12 @@ INDEX=[ "func":1 }, { +"ref":"pyaurorax.data.ucalgary.read.ReadManager.read_grid", +"url":3, +"doc":"Read in grid files. Args: file_list (List[str], List[Path], str, Path): The files to read in. Absolute paths are recommended, but not technically necessary. This can be a single string for a file, or a list of strings to read in multiple files. This parameter is required. n_parallel (int): Number of data files to read in parallel using multiprocessing. Default value is 1. Adjust according to your computer's available resources. This parameter is optional. first_record (bool): Only read in the first record in each file. This is the same as the first_frame parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False . This parameter is optional. start_time (datetime.datetime): The start timestamp to read data onwards from (inclusive). This can be utilized to read a portion of a data file, and could be paired with the end_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will assume the start time is the timestamp of the first record in the first file supplied (ie. beginning of the supplied data). This parameter is optional. end_time (datetime.datetime): The end timestamp to read data up to (inclusive). This can be utilized to read a portion of a data file, and could be paired with the start_time parameter. This tends to be utilized for datasets that are hour or day-long files where it is possible to only read a smaller bit of that file. An example is the TREx Spectrograph processed data (1 hour files), or the riometer data (1 day files). If not supplied, it will it will assume the end time is the timestamp of the last record in the last file supplied (ie. end of the supplied data). This parameter is optional. quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files attribute of the returned pyucalgarysrs.data.classes.Data object. This parameter is optional. dataset (pyucalgarysrs.data.classes.Dataset): The dataset object for which the files are associated with. This parameter is optional. Returns: A pyucalgarysrs.data.classes.Data object containing the data read in, among other values. Raises: pyucalgarysrs.exceptions.SRSError: a generic read error was encountered", +"func":1 +}, +{ "ref":"pyaurorax.exceptions", "url":4, "doc":"Unique exception classes utilized by PyAuroraX. These exceptions can be used to help trap specific errors raised by this library. Note that all exceptions are imported at the root level of the library. They can be referenced using [ pyaurorax.AuroraXError ](exceptions.html pyaurorax.exceptions.AuroraXError) or pyaurorax.exceptions.AuroraXError ." @@ -2105,7 +2112,7 @@ INDEX=[ { "ref":"pyaurorax.tools.Keogram", "url":36, -"doc":"Class representation for a keogram Attributes: data (numpy.ndarray): The derived keogram data. timestamp (List[datetime.datetime]): Timestamps corresponding to each keogram slice. ccd_y (numpy.ndarray): The y-axis representing CCD Y coordinates for the keogram. mag_y (numpy.ndarray): The y-axis representing magnetic latitude for the keogram. geo_y (numpy.ndarray): The y-axis representing geographic latitude for the keogram." +"doc":"Class representation for a keogram Attributes: data (numpy.ndarray): The derived keogram data. timestamp (List[datetime.datetime]): Timestamps corresponding to each keogram slice. instrument_type (str): String giving instrument type, either 'asi' or 'spectrograph'. ccd_y (numpy.ndarray): The y-axis representing CCD Y coordinates for the keogram. mag_y (numpy.ndarray): The y-axis representing magnetic latitude for the keogram. geo_y (numpy.ndarray): The y-axis representing geographic latitude for the keogram." }, { "ref":"pyaurorax.tools.Keogram.set_geographic_latitudes", @@ -2139,7 +2146,7 @@ INDEX=[ { "ref":"pyaurorax.tools.Mosaic", "url":36, -"doc":"Class representation for a generated mosaic. Attributes: polygon_data (matplotlib.collections.PolyCollection): Generated polygons containing rendered data. cartopy_projection (cartopy.crs.Projection): Cartopy projection to utilize. contour_data (Dict[str, List[Any ): Generated contour data." +"doc":"Class representation for a generated mosaic. Attributes: polygon_data (matplotlib.collections.PolyCollection): Generated polygons containing rendered data. cartopy_projection (cartopy.crs.Projection): Cartopy projection to utilize. contour_data (Dict[str, List[Any ): Generated contour data. spect_cmap (str): String giving the cmap to use for spect legend. spect_intensity_scale (Tuple[int]): The min and max values that spectrograph data is scaled to in the mosaic, if any is present." }, { "ref":"pyaurorax.tools.Mosaic.polygon_data", @@ -2157,9 +2164,19 @@ INDEX=[ "doc":"" }, { +"ref":"pyaurorax.tools.Mosaic.spect_cmap", +"url":36, +"doc":"" +}, +{ +"ref":"pyaurorax.tools.Mosaic.spect_intensity_scale", +"url":36, +"doc":"" +}, +{ "ref":"pyaurorax.tools.Mosaic.plot", "url":36, -"doc":"Generate a plot of the mosaic data. Either display it (default behaviour), save it to disk (using the savefig parameter), or return the matplotlib plot object for further usage (using the returnfig parameter). Args: map_extent (List[int]): Latitude/longitude range to be visible on the rendered map. This is a list of 4 integers and/or floats, in the order of [min_lon, max_lon, min_lat, max_lat]. figsize (tuple): The matplotlib figure size to use when plotting. For example figsize=(14,4) . rayleighs (bool): Set to True if the data being plotted is in Rayleighs. Defaults to False . max_rayleighs (int): Max intensity scale for Rayleighs. Defaults to 20000 . ocean_color (str): Colour of the ocean. Default is cartopy's default shade of blue. Colours can be supplied as a word, or hexcode prefixed with a ' ' character (ie. 55AADD ). land_color (str): Colour of the land. Default is gray . Colours can be supplied as a word, or hexcode prefixed with a ' ' character (ie. 41BB87 ). land_edgecolor (str): Color of the land edges. Default is 8A8A8A . Colours can be supplied as a word, or hexcode prefixed with a ' ' character. borders_color (str): Color of the country borders. Default is AEAEAE . Colours can be supplied as a word, or hexcode prefixed with a ' ' character. borders_disable (bool): Disbale rendering of the borders. Default is False . cbar_colorcmap (str): The matplotlib colormap to use for the plotted color bar. Default is gray . Commonly used colormaps are: - REGO: gist_heat - THEMIS ASI: gray - TREx Blue: Blues_r - TREx NIR: gray - TREx RGB: None A list of all available colormaps can be found on the [matplotlib documentation](https: matplotlib.org/stable/gallery/color/colormap_reference.html). returnfig (bool): Instead of displaying the image, return the matplotlib figure object. This allows for further plot manipulation, for example, adding labels or a title in a different location than the default. Remember - if this parameter is supplied, be sure that you close your plot after finishing work with it. This can be achieved by doing plt.close(fig) . Note that this method cannot be used in combination with savefig . savefig (bool): Save the displayed image to disk instead of displaying it. The parameter savefig_filename is required if this parameter is set to True. Defaults to False . savefig_filename (str): Filename to save the image to. Must be specified if the savefig parameter is set to True. savefig_quality (int): Quality level of the saved image. This can be specified if the savefig_filename is a JPG image. If it is a PNG, quality is ignored. Default quality level for JPGs is matplotlib/Pillow's default of 75%. Returns: The displayed montage, by default. If savefig is set to True, nothing will be returned. If returnfig is set to True, the plotting variables (fig, ax) will be returned. Raises:", +"doc":"Generate a plot of the mosaic data. Either display it (default behaviour), save it to disk (using the savefig parameter), or return the matplotlib plot object for further usage (using the returnfig parameter). Args: map_extent (List[int]): Latitude/longitude range to be visible on the rendered map. This is a list of 4 integers and/or floats, in the order of [min_lon, max_lon, min_lat, max_lat]. figsize (tuple): The matplotlib figure size to use when plotting. For example figsize=(14,4) . rayleighs (bool): Set to True if the data being plotted is in Rayleighs. Defaults to False . max_rayleighs (int): Max intensity scale for Rayleighs. Defaults to 20000 . ocean_color (str): Colour of the ocean. Default is cartopy's default shade of blue. Colours can be supplied as a word, or hexcode prefixed with a ' ' character (ie. 55AADD ). land_color (str): Colour of the land. Default is gray . Colours can be supplied as a word, or hexcode prefixed with a ' ' character (ie. 41BB87 ). land_edgecolor (str): Color of the land edges. Default is 8A8A8A . Colours can be supplied as a word, or hexcode prefixed with a ' ' character. borders_color (str): Color of the country borders. Default is AEAEAE . Colours can be supplied as a word, or hexcode prefixed with a ' ' character. borders_disable (bool): Disbale rendering of the borders. Default is False . cbar_colorcmap (str): The matplotlib colormap to use for the plotted color bar. Default is gray , unless mosaic was created with spectrograph data, in which case defaults to the colormap used for spectrograph data Commonly used colormaps are: - REGO: gist_heat - THEMIS ASI: gray - TREx Blue: Blues_r - TREx NIR: gray - TREx RGB: None A list of all available colormaps can be found on the [matplotlib documentation](https: matplotlib.org/stable/gallery/color/colormap_reference.html). returnfig (bool): Instead of displaying the image, return the matplotlib figure object. This allows for further plot manipulation, for example, adding labels or a title in a different location than the default. Remember - if this parameter is supplied, be sure that you close your plot after finishing work with it. This can be achieved by doing plt.close(fig) . Note that this method cannot be used in combination with savefig . savefig (bool): Save the displayed image to disk instead of displaying it. The parameter savefig_filename is required if this parameter is set to True. Defaults to False . savefig_filename (str): Filename to save the image to. Must be specified if the savefig parameter is set to True. savefig_quality (int): Quality level of the saved image. This can be specified if the savefig_filename is a JPG image. If it is a PNG, quality is ignored. Default quality level for JPGs is matplotlib/Pillow's default of 75%. Returns: The displayed montage, by default. If savefig is set to True, nothing will be returned. If returnfig is set to True, the plotting variables (fig, ax) will be returned. Raises:", "func":1 }, { @@ -2177,7 +2194,7 @@ INDEX=[ { "ref":"pyaurorax.tools.MosaicData", "url":36, -"doc":"Prepared image data for use by mosaic routines. Attributes: site_uid_list (List[str]): List of site unique identifiers contained within this object. timestamps (List[datetime.datetime]): Timestamps of corresponding images. images (Dict[str, numpy.ndarray]): Image data prepared into the necessary format; a dictionary. Keys are the site UID, ndarray is the prepared data. images_dimensions (Dict[str, Tuple]): The image dimensions." +"doc":"Prepared image data for use by mosaic routines. Attributes: site_uid_list (List[str]): List of site unique identifiers contained within this object. timestamps (List[datetime.datetime]): Timestamps of corresponding images. images (Dict[str, numpy.ndarray]): Image data prepared into the necessary format; a dictionary. Keys are the site UID, ndarray is the prepared data. images_dimensions (Dict[str, Tuple]): The image dimensions. data_types (List[str]): The data types for each data object." }, { "ref":"pyaurorax.tools.MosaicData.site_uid_list", @@ -2200,6 +2217,11 @@ INDEX=[ "doc":"" }, { +"ref":"pyaurorax.tools.MosaicData.data_types", +"url":36, +"doc":"" +}, +{ "ref":"pyaurorax.tools.MosaicSkymap", "url":36, "doc":"Prepared skymap data for use by mosaic routines. Attributes: site_uid_list (List[str]): List of site unique identifiers contained within this object. elevation (List[numpy.ndarray]): List of elevation data, with each element corresponding to each site. Order matches that of the site_uid_list attribute. polyfoll_lat (List[numpy.ndarray]): List of latitude polygon data, with each element corresponding to each site. Order matches that of the site_uid_list attribute. polyfoll_lon (List[numpy.ndarray]): List of longitude polygon data, with each element corresponding to each site. Order matches that of the site_uid_list attribute." @@ -2332,124 +2354,139 @@ INDEX=[ "func":1 }, { -"ref":"pyaurorax.tools.classes.mosaic", +"ref":"pyaurorax.tools.classes.keogram", "url":43, +"doc":"Class representation for a keogram." +}, +{ +"ref":"pyaurorax.tools.classes.keogram.Keogram", +"url":43, +"doc":"Class representation for a keogram Attributes: data (numpy.ndarray): The derived keogram data. timestamp (List[datetime.datetime]): Timestamps corresponding to each keogram slice. instrument_type (str): String giving instrument type, either 'asi' or 'spectrograph'. ccd_y (numpy.ndarray): The y-axis representing CCD Y coordinates for the keogram. mag_y (numpy.ndarray): The y-axis representing magnetic latitude for the keogram. geo_y (numpy.ndarray): The y-axis representing geographic latitude for the keogram." +}, +{ +"ref":"pyaurorax.tools.classes.keogram.Keogram.set_geographic_latitudes", +"url":43, +"doc":"Set the geographic latitude values for this keogram, using the specified skymap data. The data will be set to the geo_y attribute of this Keogram object, which can then be used for plotting and/or further analysis. Args: skymap (pyaurorax.data.ucalgary.Skymap): The skymap object to use. This parameter is required. altitude_km (int): The altitude to use, in kilometers. If not specified, it will use the default in the skymap object. If the specified altitude is not valid, a ValueError will be raised. Returns: None. The Keogram object's geo_y attribute will be updated. Raises: ValueError: Issues with specified altitude.", +"func":1 +}, +{ +"ref":"pyaurorax.tools.classes.keogram.Keogram.set_magnetic_latitudes", +"url":43, +"doc":"Set the magnetic latitude values for this keogram, using the specified skymap data. AACGMv2 will be utilized to perform the calculations. The resulting data will be set to the mag_y attribute of this Keogram object, which can then be used for plotting and/or further analysis. Args: skymap (pyaurorax.data.ucalgary.Skymap): The skymap object to use. This parameter is required. timestamp (datetime.datetime): The timestamp to use when converting skymap data to magnetic coordinates. Utilizes AACGMv2 to do the conversion. altitude_km (int): The altitude to use. If not specified, it will use the default in the skymap object. If the specified altitude is not valid, a ValueError will be raised. Returns: None. The Keogram object's mag_y attribute will be updated. Raises: ValueError: Issues with specified altitude.", +"func":1 +}, +{ +"ref":"pyaurorax.tools.classes.keogram.Keogram.plot", +"url":43, +"doc":"Generate a plot of the keogram data. Either display it (default behaviour), save it to disk (using the savefig parameter), or return the matplotlib plot object for further usage (using the returnfig parameter). Args: y_type (str): Type of y-axis to use when plotting. Options are ccd , mag , or geo . The default is ccd . This parameter is required. title (str): The title to display above the plotted keogram. figsize (tuple): The matplotlib figure size to use when plotting. For example figsize=(14,4) . cmap (str): The matplotlib colormap to use. Commonly used colormaps are: - REGO: gist_heat - THEMIS ASI: gray - TREx Blue: Blues_r - TREx NIR: gray - TREx RGB: None A list of all available colormaps can be found on the [matplotlib documentation](https: matplotlib.org/stable/gallery/color/colormap_reference.html). aspect (str or float): The matplotlib imshow aspect ration to use. A common value for this is auto . All valid values can be found on the [matplotlib documentation](https: matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html). axes_visible (bool): Display the axes. Default is True . xlabel (str): The x-axis label to use. Default is Time (UTC) . ylabel (str): The y-axis label to use. Default is based on y_type. xtick_increment (int): The x-axis tick increment to use. Default is 100. ytick_increment (int): The y-axis tick increment to use. Default is 50. returnfig (bool): Instead of displaying the image, return the matplotlib figure object. This allows for further plot manipulation, for example, adding labels or a title in a different location than the default. Remember - if this parameter is supplied, be sure that you close your plot after finishing work with it. This can be achieved by doing plt.close(fig) . Note that this method cannot be used in combination with savefig . savefig (bool): Save the displayed image to disk instead of displaying it. The parameter savefig_filename is required if this parameter is set to True. Defaults to False . savefig_filename (str): Filename to save the image to. Must be specified if the savefig parameter is set to True. savefig_quality (int): Quality level of the saved image. This can be specified if the savefig_filename is a JPG image. If it is a PNG, quality is ignored. Default quality level for JPGs is matplotlib/Pillow's default of 75%. Returns: The displayed keogram, by default. If savefig is set to True, nothing will be returned. If returnfig is set to True, the plotting variables (fig, ax) will be returned. Raises: ValueError: Issues with the y-axis choice.", +"func":1 +}, +{ +"ref":"pyaurorax.tools.classes.mosaic", +"url":44, "doc":"Class representation for a mosaic." }, { "ref":"pyaurorax.tools.classes.mosaic.MosaicSkymap", -"url":43, +"url":44, "doc":"Prepared skymap data for use by mosaic routines. Attributes: site_uid_list (List[str]): List of site unique identifiers contained within this object. elevation (List[numpy.ndarray]): List of elevation data, with each element corresponding to each site. Order matches that of the site_uid_list attribute. polyfoll_lat (List[numpy.ndarray]): List of latitude polygon data, with each element corresponding to each site. Order matches that of the site_uid_list attribute. polyfoll_lon (List[numpy.ndarray]): List of longitude polygon data, with each element corresponding to each site. Order matches that of the site_uid_list attribute." }, { "ref":"pyaurorax.tools.classes.mosaic.MosaicSkymap.site_uid_list", -"url":43, +"url":44, "doc":"" }, { "ref":"pyaurorax.tools.classes.mosaic.MosaicSkymap.elevation", -"url":43, +"url":44, "doc":"" }, { "ref":"pyaurorax.tools.classes.mosaic.MosaicSkymap.polyfill_lat", -"url":43, +"url":44, "doc":"" }, { "ref":"pyaurorax.tools.classes.mosaic.MosaicSkymap.polyfill_lon", -"url":43, +"url":44, "doc":"" }, { "ref":"pyaurorax.tools.classes.mosaic.MosaicData", -"url":43, -"doc":"Prepared image data for use by mosaic routines. Attributes: site_uid_list (List[str]): List of site unique identifiers contained within this object. timestamps (List[datetime.datetime]): Timestamps of corresponding images. images (Dict[str, numpy.ndarray]): Image data prepared into the necessary format; a dictionary. Keys are the site UID, ndarray is the prepared data. images_dimensions (Dict[str, Tuple]): The image dimensions." +"url":44, +"doc":"Prepared image data for use by mosaic routines. Attributes: site_uid_list (List[str]): List of site unique identifiers contained within this object. timestamps (List[datetime.datetime]): Timestamps of corresponding images. images (Dict[str, numpy.ndarray]): Image data prepared into the necessary format; a dictionary. Keys are the site UID, ndarray is the prepared data. images_dimensions (Dict[str, Tuple]): The image dimensions. data_types (List[str]): The data types for each data object." }, { "ref":"pyaurorax.tools.classes.mosaic.MosaicData.site_uid_list", -"url":43, +"url":44, "doc":"" }, { "ref":"pyaurorax.tools.classes.mosaic.MosaicData.timestamps", -"url":43, +"url":44, "doc":"" }, { "ref":"pyaurorax.tools.classes.mosaic.MosaicData.images", -"url":43, +"url":44, "doc":"" }, { "ref":"pyaurorax.tools.classes.mosaic.MosaicData.images_dimensions", -"url":43, +"url":44, +"doc":"" +}, +{ +"ref":"pyaurorax.tools.classes.mosaic.MosaicData.data_types", +"url":44, "doc":"" }, { "ref":"pyaurorax.tools.classes.mosaic.Mosaic", -"url":43, -"doc":"Class representation for a generated mosaic. Attributes: polygon_data (matplotlib.collections.PolyCollection): Generated polygons containing rendered data. cartopy_projection (cartopy.crs.Projection): Cartopy projection to utilize. contour_data (Dict[str, List[Any ): Generated contour data." +"url":44, +"doc":"Class representation for a generated mosaic. Attributes: polygon_data (matplotlib.collections.PolyCollection): Generated polygons containing rendered data. cartopy_projection (cartopy.crs.Projection): Cartopy projection to utilize. contour_data (Dict[str, List[Any ): Generated contour data. spect_cmap (str): String giving the cmap to use for spect legend. spect_intensity_scale (Tuple[int]): The min and max values that spectrograph data is scaled to in the mosaic, if any is present." }, { "ref":"pyaurorax.tools.classes.mosaic.Mosaic.polygon_data", -"url":43, +"url":44, "doc":"" }, { "ref":"pyaurorax.tools.classes.mosaic.Mosaic.cartopy_projection", -"url":43, +"url":44, "doc":"" }, { "ref":"pyaurorax.tools.classes.mosaic.Mosaic.contour_data", -"url":43, +"url":44, "doc":"" }, { -"ref":"pyaurorax.tools.classes.mosaic.Mosaic.plot", -"url":43, -"doc":"Generate a plot of the mosaic data. Either display it (default behaviour), save it to disk (using the savefig parameter), or return the matplotlib plot object for further usage (using the returnfig parameter). Args: map_extent (List[int]): Latitude/longitude range to be visible on the rendered map. This is a list of 4 integers and/or floats, in the order of [min_lon, max_lon, min_lat, max_lat]. figsize (tuple): The matplotlib figure size to use when plotting. For example figsize=(14,4) . rayleighs (bool): Set to True if the data being plotted is in Rayleighs. Defaults to False . max_rayleighs (int): Max intensity scale for Rayleighs. Defaults to 20000 . ocean_color (str): Colour of the ocean. Default is cartopy's default shade of blue. Colours can be supplied as a word, or hexcode prefixed with a ' ' character (ie. 55AADD ). land_color (str): Colour of the land. Default is gray . Colours can be supplied as a word, or hexcode prefixed with a ' ' character (ie. 41BB87 ). land_edgecolor (str): Color of the land edges. Default is 8A8A8A . Colours can be supplied as a word, or hexcode prefixed with a ' ' character. borders_color (str): Color of the country borders. Default is AEAEAE . Colours can be supplied as a word, or hexcode prefixed with a ' ' character. borders_disable (bool): Disbale rendering of the borders. Default is False . cbar_colorcmap (str): The matplotlib colormap to use for the plotted color bar. Default is gray . Commonly used colormaps are: - REGO: gist_heat - THEMIS ASI: gray - TREx Blue: Blues_r - TREx NIR: gray - TREx RGB: None A list of all available colormaps can be found on the [matplotlib documentation](https: matplotlib.org/stable/gallery/color/colormap_reference.html). returnfig (bool): Instead of displaying the image, return the matplotlib figure object. This allows for further plot manipulation, for example, adding labels or a title in a different location than the default. Remember - if this parameter is supplied, be sure that you close your plot after finishing work with it. This can be achieved by doing plt.close(fig) . Note that this method cannot be used in combination with savefig . savefig (bool): Save the displayed image to disk instead of displaying it. The parameter savefig_filename is required if this parameter is set to True. Defaults to False . savefig_filename (str): Filename to save the image to. Must be specified if the savefig parameter is set to True. savefig_quality (int): Quality level of the saved image. This can be specified if the savefig_filename is a JPG image. If it is a PNG, quality is ignored. Default quality level for JPGs is matplotlib/Pillow's default of 75%. Returns: The displayed montage, by default. If savefig is set to True, nothing will be returned. If returnfig is set to True, the plotting variables (fig, ax) will be returned. Raises:", -"func":1 -}, -{ -"ref":"pyaurorax.tools.classes.mosaic.Mosaic.add_geo_contours", -"url":43, -"doc":"Add geographic contours to a mosaic. Args: lats (ndarray or list): Sequence of geographic latitudes defining a contour. lons (ndarray or list): Sequence of geographic longitudes defining a contour. constant_lats (float, int, or Sequence): Geographic Latitude(s) at which to add line(s) of constant latitude. constant_lons (float, int, or Sequence): Geographic Longitude(s) at which to add line(s) of constant longitude. color (str): The matplotlib color used for the contour(s). linewidth (float or int): The contour thickness. linestyle (str): The matplotlib linestyle used for the contour(s). marker (str): The matplotlib marker used for the contour(s). Returns: The object's contour_data parameter is populated appropriately. Raises: ValueError: issues encountered with supplied parameters.", -"func":1 -}, -{ -"ref":"pyaurorax.tools.classes.mosaic.Mosaic.add_mag_contours", -"url":43, -"doc":"Add geomagnetic contours to a mosaic. Args: timestamp (datetime.datetime): The timestamp used in computing AACGM coordinates. lats (ndarray or list): Sequence of geomagnetic latitudes defining a contour. lons (ndarray or list): Sequence of geomagnetic longitudes defining a contour. constant_lats (float, int, Sequence): Geomagnetic latitude(s) at which to add contour(s) of constant latitude. constant_lons (float, int, Sequence): Geomagnetic longitude(s) at which to add contours(s) of constant longitude. color (str): The matplotlib color used for the contour(s). linewidth (float or int): The contour thickness. linestyle (str): The matplotlib linestyle used for the contour(s). marker (str): The matplotlib marker used for the contour(s). Returns: The object's contour_data parameter is populated appropriately. Raises: ValueError: issues encountered with supplied parameters.", -"func":1 -}, -{ -"ref":"pyaurorax.tools.classes.keogram", +"ref":"pyaurorax.tools.classes.mosaic.Mosaic.spect_cmap", "url":44, -"doc":"Class representation for a keogram." +"doc":"" }, { -"ref":"pyaurorax.tools.classes.keogram.Keogram", +"ref":"pyaurorax.tools.classes.mosaic.Mosaic.spect_intensity_scale", "url":44, -"doc":"Class representation for a keogram Attributes: data (numpy.ndarray): The derived keogram data. timestamp (List[datetime.datetime]): Timestamps corresponding to each keogram slice. ccd_y (numpy.ndarray): The y-axis representing CCD Y coordinates for the keogram. mag_y (numpy.ndarray): The y-axis representing magnetic latitude for the keogram. geo_y (numpy.ndarray): The y-axis representing geographic latitude for the keogram." +"doc":"" }, { -"ref":"pyaurorax.tools.classes.keogram.Keogram.set_geographic_latitudes", +"ref":"pyaurorax.tools.classes.mosaic.Mosaic.plot", "url":44, -"doc":"Set the geographic latitude values for this keogram, using the specified skymap data. The data will be set to the geo_y attribute of this Keogram object, which can then be used for plotting and/or further analysis. Args: skymap (pyaurorax.data.ucalgary.Skymap): The skymap object to use. This parameter is required. altitude_km (int): The altitude to use, in kilometers. If not specified, it will use the default in the skymap object. If the specified altitude is not valid, a ValueError will be raised. Returns: None. The Keogram object's geo_y attribute will be updated. Raises: ValueError: Issues with specified altitude.", +"doc":"Generate a plot of the mosaic data. Either display it (default behaviour), save it to disk (using the savefig parameter), or return the matplotlib plot object for further usage (using the returnfig parameter). Args: map_extent (List[int]): Latitude/longitude range to be visible on the rendered map. This is a list of 4 integers and/or floats, in the order of [min_lon, max_lon, min_lat, max_lat]. figsize (tuple): The matplotlib figure size to use when plotting. For example figsize=(14,4) . rayleighs (bool): Set to True if the data being plotted is in Rayleighs. Defaults to False . max_rayleighs (int): Max intensity scale for Rayleighs. Defaults to 20000 . ocean_color (str): Colour of the ocean. Default is cartopy's default shade of blue. Colours can be supplied as a word, or hexcode prefixed with a ' ' character (ie. 55AADD ). land_color (str): Colour of the land. Default is gray . Colours can be supplied as a word, or hexcode prefixed with a ' ' character (ie. 41BB87 ). land_edgecolor (str): Color of the land edges. Default is 8A8A8A . Colours can be supplied as a word, or hexcode prefixed with a ' ' character. borders_color (str): Color of the country borders. Default is AEAEAE . Colours can be supplied as a word, or hexcode prefixed with a ' ' character. borders_disable (bool): Disbale rendering of the borders. Default is False . cbar_colorcmap (str): The matplotlib colormap to use for the plotted color bar. Default is gray , unless mosaic was created with spectrograph data, in which case defaults to the colormap used for spectrograph data Commonly used colormaps are: - REGO: gist_heat - THEMIS ASI: gray - TREx Blue: Blues_r - TREx NIR: gray - TREx RGB: None A list of all available colormaps can be found on the [matplotlib documentation](https: matplotlib.org/stable/gallery/color/colormap_reference.html). returnfig (bool): Instead of displaying the image, return the matplotlib figure object. This allows for further plot manipulation, for example, adding labels or a title in a different location than the default. Remember - if this parameter is supplied, be sure that you close your plot after finishing work with it. This can be achieved by doing plt.close(fig) . Note that this method cannot be used in combination with savefig . savefig (bool): Save the displayed image to disk instead of displaying it. The parameter savefig_filename is required if this parameter is set to True. Defaults to False . savefig_filename (str): Filename to save the image to. Must be specified if the savefig parameter is set to True. savefig_quality (int): Quality level of the saved image. This can be specified if the savefig_filename is a JPG image. If it is a PNG, quality is ignored. Default quality level for JPGs is matplotlib/Pillow's default of 75%. Returns: The displayed montage, by default. If savefig is set to True, nothing will be returned. If returnfig is set to True, the plotting variables (fig, ax) will be returned. Raises:", "func":1 }, { -"ref":"pyaurorax.tools.classes.keogram.Keogram.set_magnetic_latitudes", +"ref":"pyaurorax.tools.classes.mosaic.Mosaic.add_geo_contours", "url":44, -"doc":"Set the magnetic latitude values for this keogram, using the specified skymap data. AACGMv2 will be utilized to perform the calculations. The resulting data will be set to the mag_y attribute of this Keogram object, which can then be used for plotting and/or further analysis. Args: skymap (pyaurorax.data.ucalgary.Skymap): The skymap object to use. This parameter is required. timestamp (datetime.datetime): The timestamp to use when converting skymap data to magnetic coordinates. Utilizes AACGMv2 to do the conversion. altitude_km (int): The altitude to use. If not specified, it will use the default in the skymap object. If the specified altitude is not valid, a ValueError will be raised. Returns: None. The Keogram object's mag_y attribute will be updated. Raises: ValueError: Issues with specified altitude.", +"doc":"Add geographic contours to a mosaic. Args: lats (ndarray or list): Sequence of geographic latitudes defining a contour. lons (ndarray or list): Sequence of geographic longitudes defining a contour. constant_lats (float, int, or Sequence): Geographic Latitude(s) at which to add line(s) of constant latitude. constant_lons (float, int, or Sequence): Geographic Longitude(s) at which to add line(s) of constant longitude. color (str): The matplotlib color used for the contour(s). linewidth (float or int): The contour thickness. linestyle (str): The matplotlib linestyle used for the contour(s). marker (str): The matplotlib marker used for the contour(s). Returns: The object's contour_data parameter is populated appropriately. Raises: ValueError: issues encountered with supplied parameters.", "func":1 }, { -"ref":"pyaurorax.tools.classes.keogram.Keogram.plot", +"ref":"pyaurorax.tools.classes.mosaic.Mosaic.add_mag_contours", "url":44, -"doc":"Generate a plot of the keogram data. Either display it (default behaviour), save it to disk (using the savefig parameter), or return the matplotlib plot object for further usage (using the returnfig parameter). Args: y_type (str): Type of y-axis to use when plotting. Options are ccd , mag , or geo . The default is ccd . This parameter is required. title (str): The title to display above the plotted keogram. figsize (tuple): The matplotlib figure size to use when plotting. For example figsize=(14,4) . cmap (str): The matplotlib colormap to use. Commonly used colormaps are: - REGO: gist_heat - THEMIS ASI: gray - TREx Blue: Blues_r - TREx NIR: gray - TREx RGB: None A list of all available colormaps can be found on the [matplotlib documentation](https: matplotlib.org/stable/gallery/color/colormap_reference.html). aspect (str or float): The matplotlib imshow aspect ration to use. A common value for this is auto . All valid values can be found on the [matplotlib documentation](https: matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html). axes_visible (bool): Display the axes. Default is True . xlabel (str): The x-axis label to use. Default is Time (UTC) . ylabel (str): The y-axis label to use. Default is based on y_type. xtick_increment (int): The x-axis tick increment to use. Default is 100. ytick_increment (int): The y-axis tick increment to use. Default is 50. returnfig (bool): Instead of displaying the image, return the matplotlib figure object. This allows for further plot manipulation, for example, adding labels or a title in a different location than the default. Remember - if this parameter is supplied, be sure that you close your plot after finishing work with it. This can be achieved by doing plt.close(fig) . Note that this method cannot be used in combination with savefig . savefig (bool): Save the displayed image to disk instead of displaying it. The parameter savefig_filename is required if this parameter is set to True. Defaults to False . savefig_filename (str): Filename to save the image to. Must be specified if the savefig parameter is set to True. savefig_quality (int): Quality level of the saved image. This can be specified if the savefig_filename is a JPG image. If it is a PNG, quality is ignored. Default quality level for JPGs is matplotlib/Pillow's default of 75%. Returns: The displayed keogram, by default. If savefig is set to True, nothing will be returned. If returnfig is set to True, the plotting variables (fig, ax) will be returned. Raises: ValueError: Issues with the y-axis choice.", +"doc":"Add geomagnetic contours to a mosaic. Args: timestamp (datetime.datetime): The timestamp used in computing AACGM coordinates. lats (ndarray or list): Sequence of geomagnetic latitudes defining a contour. lons (ndarray or list): Sequence of geomagnetic longitudes defining a contour. constant_lats (float, int, Sequence): Geomagnetic latitude(s) at which to add contour(s) of constant latitude. constant_lons (float, int, Sequence): Geomagnetic longitude(s) at which to add contours(s) of constant longitude. color (str): The matplotlib color used for the contour(s). linewidth (float or int): The contour thickness. linestyle (str): The matplotlib linestyle used for the contour(s). marker (str): The matplotlib marker used for the contour(s). Returns: The object's contour_data parameter is populated appropriately. Raises: ValueError: issues encountered with supplied parameters.", "func":1 }, { @@ -2460,7 +2497,7 @@ INDEX=[ { "ref":"pyaurorax.tools.keogram.create", "url":45, -"doc":"Create a keogram from a set of images. Args: images (numpy.ndarray): A set of images. Normally this would come directly from a data read call, but can also be any arbitrary set of images. It is anticipated that the order of axes is [rows, cols, num_images] or [row, cols, channels, num_images]. If it is not, then be sure to specify the axis parameter accordingly. timestamp (List[datetime.datetime]): A list of timestamps corresponding to each image. axis (int): The axis to extract the keogram slice from. Default is 0 , meaning the rows (or Y) axis. Returns: A pyaurorax.tools.Keogram object. Raises: ValueError: issue with supplied parameters.", +"doc":"Create a keogram from a set of images. Args: images (numpy.ndarray): A set of images. Normally this would come directly from a data read call, but can also be any arbitrary set of images. It is anticipated that the order of axes is [rows, cols, num_images] or [row, cols, channels, num_images]. If it is not, then be sure to specify the axis parameter accordingly. timestamp (List[datetime.datetime]): A list of timestamps corresponding to each image. axis (int): The axis to extract the keogram slice from. Default is 0 , meaning the rows (or Y) axis. spectra (bool): Make a keogram out of spectrograph data, for a specific emission. Defaults to False (ASI data). wavelength (numpy.ndarray): The wavelength array corresponding to spectrograph data. If spectra=True, this parameter must be supplied. spect_emission (str): The emission (green, red, blue, hbeta) to prepare from spectrograph data. Default is 'green' (557.7 nm emission). spect_band (Tuple[float]): Manual selection of the wavelength region to integrate for obtaining emissions. Use this to prepare emissions that are not available in spect_emission. spect_band_bg (Tuple[float]): Manual selection of the wavelength region to subtract from integration for manually chosen emissions, via the spect_band argument. Returns: A pyaurorax.tools.Keogram object. Raises: ValueError: issue with supplied parameters.", "func":1 }, { @@ -2494,13 +2531,13 @@ INDEX=[ { "ref":"pyaurorax.tools.mosaic.prep_images", "url":47, -"doc":"Prepare the image data for use in a mosaic. Args: image_list (List[pyaurorax.data.ucalgary.Data]): List of image data. Each element of the list is the data for each site. data_attribute (str): The data attribute to use when prepping the images. Either data or calibrated_data . Default is data . Returns: The prepared data, as a pyaurorax.tools.MosaicData object. Raises: ValueError: issues encountered with supplied paramters.", +"doc":"Prepare the image data for use in a mosaic. Args: image_list (List[pyaurorax.data.ucalgary.Data]): List of image data. Each element of the list is the data for each site. data_attribute (str): The data attribute to use when prepping the images. Either data or calibrated_data . Default is data . spect_emission (str): The emission (green, red, blue, hbeta) to prepare from spectrograph data. Default is 'green' (557.7 nm emission). spect_band (Tuple[float]): Manual selection of the wavelength region to integrate for obtaining emissions. Use this to prepare emissions that are not available in spect_emission. spect_band_bg (Tuple[float]): Manual selection of the wavelength region to subtract from integration for manually chosen emissions, via the spect_band argument. Returns: The prepared data, as a pyaurorax.tools.MosaicData object. Raises: ValueError: issues encountered with supplied parameters.", "func":1 }, { "ref":"pyaurorax.tools.mosaic.create", "url":47, -"doc":"Create a mosaic object. Args: prepped_data (pyaurorax.tools.MosaicData): The prepared mosaic data. Generated from a prior prep_images() function call. prepped_skymap (pyaurorax.tools.MosaicSkymap): The prepared skymap data. Generated from a prior prep_skymaps() function call. timestamp (datetime.datetime): The timestamp to generate a mosaic for. Must be within the range of timestamps for which image data was prepped and provided. cartopy_projection (cartopy.crs.Projection): The cartopy projection to use when creating the mosaic. min_elevation (int): The minimum elevation cutoff when projecting images on the map, in degrees. Default is 5 . cbar_colorcmap (str): The matplotlib colormap to use for the rendered image data. Default is gray . Commonly used colormaps are: - REGO: gist_heat - THEMIS ASI: gray - TREx Blue: Blues_r - TREx NIR: gray - TREx RGB: None A list of all available colormaps can be found on the [matplotlib documentation](https: matplotlib.org/stable/gallery/color/colormap_reference.html). image_intensity_scaled (List or Dict): Ranges for scaling images. Either a a list with 2 elements which will scale all sites with the same range, or as a dictionary which can be used for scaling each site differently. Example of uniform scaling across all sites: image_intensity_scales = [2000, 8000] Example of scaling each site differently: image_intensity_scales = {\"fsmi\": [1000, 10000], \"gill\": [2000, 8000]} Returns: The generated pyaurorax.tools.Mosaic object. Raises: ValueError: issues with supplied parameters.", +"doc":"Create a mosaic object. Args: prepped_data (pyaurorax.tools.MosaicData): The prepared mosaic data. Generated from a prior prep_images() function call. prepped_skymap (pyaurorax.tools.MosaicSkymap): The prepared skymap data. Generated from a prior prep_skymaps() function call. timestamp (datetime.datetime): The timestamp to generate a mosaic for. Must be within the range of timestamps for which image data was prepped and provided. cartopy_projection (cartopy.crs.Projection): The cartopy projection to use when creating the mosaic. min_elevation (int): The minimum elevation cutoff when projecting images on the map, in degrees. Default is 5 . colormap (str): The matplotlib colormap to use for the rendered image data. Default is gray . Commonly used colormaps are: - REGO: gist_heat - THEMIS ASI: gray - TREx Blue: Blues_r - TREx NIR: gray - TREx RGB: None A list of all available colormaps can be found on the [matplotlib documentation](https: matplotlib.org/stable/gallery/color/colormap_reference.html). spect_cmap (str): The matplotlib colormap to use for the colorbar if working with spectrograph data. Default is gnuplot . image_intensity_scaled (List or Dict): Ranges for scaling images. Either a a list with 2 elements which will scale all sites with the same range, or as a dictionary which can be used for scaling each site differently. Example of uniform scaling across all sites: image_intensity_scales = [2000, 8000] Example of scaling each site differently: image_intensity_scales = {\"fsmi\": [1000, 10000], \"gill\": [2000, 8000]} spect_intensity_scaled (Tuple[int]): Min and max values, in Rayleighs, to scale ALL spectrograph data. Returns: The generated pyaurorax.tools.Mosaic object. Raises: ValueError: issues with supplied parameters.", "func":1 }, { @@ -2513,5 +2550,16 @@ INDEX=[ "url":48, "doc":"Takes a grid array, and converts it to RGBA format, masking all empty cells with max transparency, so that it can be plotted overtop of a map. Args: grid (numpy.ndarray): The grid array to prepare. Usually a result of reading a grid file and obtaining grid data from said file. fill_val (int or float): The fill value that was used to fill grid cells containing no data. Usually obtained from the grid file's metadata. scale (list or numpy.ndarray): A two-element vector specifying the minimum and maximum values to scale data between, optional (defaults to data min/max). cmap (str): A string giving the name of a matplotlib colormap to prep single-channel image data using, optional (defaults to \"Greys_r\"). Returns: The prepared RGBA grid array. Raises: ValueError: issues encountered with supplied parameters.", "func":1 +}, +{ +"ref":"pyaurorax.tools.spectra", +"url":49, +"doc":"Work with spectrograph data." +}, +{ +"ref":"pyaurorax.tools.spectra.plot", +"url":49, +"doc":"Generate a plot of one or more spectra from spectrograph data. Either display it (default behaviour), save it to disk (using the savefig parameter), or return the matplotlib plot object for further usage (using the returnfig parameter). Args: spect_data (pyaurorax.data.ucalgary.Data): The data object containing spectrograph data. timestamp (datetime.datetime): A timestamp or list of timestamps for which to plot spectra from. spect_loc (int): An int or list of ints giving the spectrograph spatial bin indices to plot. title (str): The title to display above the plotted spectra. figsize (tuple): The matplotlib figure size to use when plotting. For example figsize=(14,4) . color (str): A string or list of strings giving the matplotlib color names to use for plotting spectra. xlabel (str): The x-axis label to use. Default is Wavelength (nm) . ylabel (str): The y-axis label to use. Default is 'Intensity (Rayleighs)'. ylim (Tuple[int]): The min and max values to display on the y-axis, in units of Rayleighs/nm. xlim (Tuple[int]): The min and max values to display on the x-axis, in units of nm. plot_line (float): A float, or list of floats, giving wavelengths at which to plot a vertical line, useful for comparing to known emission wavelengths (e.g. 557.7). plot_line_color (str): A string or list of strings giving the colors to use for plotting lines specified by 'plot_lines'. returnfig (bool): Instead of displaying the image, return the matplotlib figure object. This allows for further plot manipulation, for example, adding labels or a title in a different location than the default. Remember - if this parameter is supplied, be sure that you close your plot after finishing work with it. This can be achieved by doing plt.close(fig) . Note that this method cannot be used in combination with savefig . savefig (bool): Save the displayed image to disk instead of displaying it. The parameter savefig_filename is required if this parameter is set to True. Defaults to False . savefig_filename (str): Filename to save the image to. Must be specified if the savefig parameter is set to True. savefig_quality (int): Quality level of the saved image. This can be specified if the savefig_filename is a JPG image. If it is a PNG, quality is ignored. Default quality level for JPGs is matplotlib/Pillow's default of 75%. Returns: The displayed spectra, by default. If savefig is set to True, nothing will be returned. If returnfig is set to True, the plotting variables (fig, ax) will be returned. Raises: ValueError: Issues with the y-axis choice.", +"func":1 } ] \ No newline at end of file diff --git a/docs/generated/pyaurorax/data/ucalgary/index.html b/docs/generated/pyaurorax/data/ucalgary/index.html index 6c37de32..a74e5210 100644 --- a/docs/generated/pyaurorax/data/ucalgary/index.html +++ b/docs/generated/pyaurorax/data/ucalgary/index.html @@ -151,7 +151,7 @@

Attributes

var_str = str(var_value) # print string for this var - print(" %-30s: %s" % (var_name, var_str)) + print(" %-27s: %s" % (var_name, var_str))

Class variables

@@ -342,7 +342,12 @@

Attributes

if (len(self.data) == 1): data_str = "[1 RiometerData object]" else: - data_str = "[%d RiometerData objects]" % (len(self.data)) + data_str = "[%d HSRData objects]" % (len(self.data)) + elif (isinstance(self.data[0], HSRData) is True): + if (len(self.data) == 1): + data_str = "[1 HSRData object]" + else: + data_str = "[%d HSRData objects]" % (len(self.data)) elif (len(self.data) == 1): data_str = "[1 item]" else: @@ -374,12 +379,12 @@

Attributes

# print print("Data:") - print(" %-22s: %s" % ("data", data_str)) - print(" %-22s: %s" % ("timestamp", timestamp_str)) - print(" %-22s: %s" % ("metadata", metadata_str)) - print(" %-22s: %s" % ("problematic_files", problematic_files_str)) - print(" %-22s: %s" % ("calibrated_data", calibrated_data_str)) - print(" %-22s: %s" % ("dataset", dataset_str)) + print(" %-19s: %s" % ("data", data_str)) + print(" %-19s: %s" % ("timestamp", timestamp_str)) + print(" %-19s: %s" % ("metadata", metadata_str)) + print(" %-19s: %s" % ("problematic_files", problematic_files_str)) + print(" %-19s: %s" % ("calibrated_data", calibrated_data_str)) + print(" %-19s: %s" % ("dataset", dataset_str))

Class variables

@@ -420,7 +425,7 @@

Methods

class Dataset -(name: str,
short_description: str,
long_description: str,
data_tree_url: str,
file_listing_supported: bool,
file_reading_supported: bool,
level: str,
supported_libraries: List[str],
doi: str | None = None,
doi_details: str | None = None,
citation: str | None = None)
+(name: str,
short_description: str,
long_description: str,
data_tree_url: str,
file_listing_supported: bool,
file_reading_supported: bool,
level: str,
supported_libraries: List[str],
file_time_resolution: str,
doi: str | None = None,
doi_details: str | None = None,
citation: str | None = None)

A dataset available from the UCalgary Space Remote Sensing API, with possibly @@ -440,6 +445,9 @@

Attributes

Flag indicating if file listing (downloading) is supported for this dataset.
file_reading_supported : bool
Flag indicating if file reading is supported for this dataset.
+
file_time_resolution : str
+
Time resolution of the files for this dataset, represented as a string. Possible values +are: 1min, 1hr, 1day, not_applicable.
level : str
Dataset level as per L0/L1/L2/etc standards.
doi : str
@@ -481,7 +489,11 @@

Attributes

file_reading_supported (bool): Flag indicating if file reading is supported for this dataset. - + + file_time_resolution (str): + Time resolution of the files for this dataset, represented as a string. Possible values + are: 1min, 1hr, 1day, not_applicable. + level (str): Dataset level as per L0/L1/L2/etc standards. @@ -510,6 +522,7 @@

Attributes

file_reading_supported: bool, level: str, supported_libraries: List[str], + file_time_resolution: str, doi: Optional[str] = None, doi_details: Optional[str] = None, citation: Optional[str] = None): @@ -525,6 +538,7 @@

Attributes

self.citation = citation self.provider = "UCalgary" self.supported_libraries = supported_libraries + self.file_time_resolution = file_time_resolution def __str__(self) -> str: return self.__repr__() @@ -550,7 +564,7 @@

Attributes

# convert var to string format we want var_value = getattr(self, var_name) - print(" %-27s: %s" % (var_name, None if var_value is None else var_value)) + print(" %-24s: %s" % (var_name, None if var_value is None else var_value))

Methods

@@ -839,7 +853,7 @@

Attributes

# convert var to string format we want var_value = getattr(self, var_name) - print(" %-22s: %s" % (var_name, None if var_value is None else var_value)) + print(" %-19s: %s" % (var_name, None if var_value is None else var_value))

Methods

@@ -853,7 +867,7 @@

Methods

class Skymap -(filename: str,
project_uid: str,
site_uid: str,
imager_uid: str,
site_map_latitude: float,
site_map_longitude: float,
site_map_altitude: float,
full_elevation: numpy.ndarray,
full_azimuth: numpy.ndarray,
full_map_altitude: numpy.ndarray,
full_map_latitude: numpy.ndarray,
full_map_longitude: numpy.ndarray,
generation_info: pyucalgarysrs.data.classes.SkymapGenerationInfo,
version: str)
+(filename: str,
project_uid: str,
site_uid: str,
imager_uid: str,
site_map_latitude: float,
site_map_longitude: float,
site_map_altitude: float,
full_elevation: numpy.ndarray,
full_azimuth: numpy.ndarray | None,
full_map_altitude: numpy.ndarray,
full_map_latitude: numpy.ndarray,
full_map_longitude: numpy.ndarray,
generation_info: pyucalgarysrs.data.classes.SkymapGenerationInfo,
version: str)

Representation for a skymap file.

@@ -875,8 +889,8 @@

Attributes

Altitude of the instrument (in meters)
full_elevation : ndarray
Elevation angle from horizon, for each image pixel (in degrees)
-
full_azimuth : ndarray
-
Local azimuth angle from 0 degrees north, positive moving east (in degrees)
+
full_azimuth : ndarray | None
+
Local azimuth angle from 0 degrees north, positive moving east (in degrees). None for TREx Spectrograph.
full_map_altitude : ndarray
Altitudes that image coordinates are mapped to (in kilometers)
full_map_latitude : ndarray
@@ -924,8 +938,8 @@

Attributes

full_elevation (ndarray): Elevation angle from horizon, for each image pixel (in degrees) - full_azimuth (ndarray): - Local azimuth angle from 0 degrees north, positive moving east (in degrees) + full_azimuth (ndarray | None): + Local azimuth angle from 0 degrees north, positive moving east (in degrees). None for TREx Spectrograph. full_map_altitude (ndarray): Altitudes that image coordinates are mapped to (in kilometers) @@ -953,7 +967,7 @@

Attributes

site_map_longitude: float site_map_altitude: float full_elevation: ndarray - full_azimuth: ndarray + full_azimuth: Union[ndarray, None] full_map_altitude: ndarray full_map_latitude: ndarray full_map_longitude: ndarray @@ -979,7 +993,7 @@

Attributes

print("Skymap:") for var_name in dir(self): # exclude methods - if (var_name.startswith("__") or var_name == "pretty_print"): + if (var_name.startswith("__") or var_name == "pretty_print" or var_name == "get_precalculated_altitudes"): continue # convert var to string format we want @@ -994,7 +1008,7 @@

Attributes

var_str = str(var_value) # print string for this var - print(" %-23s: %s" % (var_name, var_str)) + print(" %-20s: %s" % (var_name, var_str)) def get_precalculated_altitudes(self): """ @@ -1009,7 +1023,7 @@

Class variables

-
var full_azimuth : numpy.ndarray
+
var full_azimuth : numpy.ndarray | None
@@ -1537,6 +1551,8 @@

Methods

n_parallel: int = 1, first_record: bool = False, no_metadata: bool = False, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, quiet: bool = False) -> Data: """ Read in data files for a given dataset. Note that only one type of dataset's data @@ -1566,7 +1582,25 @@

Methods

no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is `False`. This parameter is optional. - + + start_time (datetime.datetime): + The start timestamp to read data onwards from (inclusive). This can be utilized to + read a portion of a data file, and could be paired with the `end_time` parameter. + This tends to be utilized for datasets that are hour or day-long files where it is + possible to only read a smaller bit of that file. An example is the TREx Spectrograph + processed data (1 hour files), or the riometer data (1 day files). If not supplied, + it will assume the start time is the timestamp of the first record in the first + file supplied (ie. beginning of the supplied data). This parameter is optional. + + end_time (datetime.datetime): + The end timestamp to read data up to (inclusive). This can be utilized to read a + portion of a data file, and could be paired with the `start_time` parameter. This + tends to be utilized for datasets that are hour or day-long files where it is possible + to only read a smaller bit of that file. An example is the TREx Spectrograph processed + data (1 hour files), or the riometer data (1 day files). If not supplied, it will + it will assume the end time is the timestamp of the last record in the last file + supplied (ie. end of the supplied data). This parameter is optional. + quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the `problematic_files` @@ -1597,6 +1631,8 @@

Methods

n_parallel=n_parallel, first_record=first_record, no_metadata=no_metadata, + start_time=start_time, + end_time=end_time, quiet=quiet, ) @@ -2254,7 +2290,7 @@

Returns

A list of the dataset names with file reading support.

-def read(self,
dataset: pyucalgarysrs.data.classes.Dataset,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
quiet: bool = False) ‑> pyucalgarysrs.data.classes.Data
+def read(self,
dataset: pyucalgarysrs.data.classes.Dataset,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
start_time: datetime.datetime | None = None,
end_time: datetime.datetime | None = None,
quiet: bool = False) ‑> pyucalgarysrs.data.classes.Data

Read in data files for a given dataset. Note that only one type of dataset's data @@ -2280,6 +2316,22 @@

Args

no_metadata : bool
Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False. This parameter is optional.
+
start_time : datetime.datetime
+
The start timestamp to read data onwards from (inclusive). This can be utilized to +read a portion of a data file, and could be paired with the end_time parameter. +This tends to be utilized for datasets that are hour or day-long files where it is +possible to only read a smaller bit of that file. An example is the TREx Spectrograph +processed data (1 hour files), or the riometer data (1 day files). If not supplied, +it will assume the start time is the timestamp of the first record in the first +file supplied (ie. beginning of the supplied data). This parameter is optional.
+
end_time : datetime.datetime
+
The end timestamp to read data up to (inclusive). This can be utilized to read a +portion of a data file, and could be paired with the start_time parameter. This +tends to be utilized for datasets that are hour or day-long files where it is possible +to only read a smaller bit of that file. An example is the TREx Spectrograph processed +data (1 hour files), or the riometer data (1 day files). If not supplied, it will +it will assume the end time is the timestamp of the last record in the last file +supplied (ie. end of the supplied data). This parameter is optional.
quiet : bool
Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files diff --git a/docs/generated/pyaurorax/data/ucalgary/read/index.html b/docs/generated/pyaurorax/data/ucalgary/read/index.html index a40c4476..550e94ef 100644 --- a/docs/generated/pyaurorax/data/ucalgary/read/index.html +++ b/docs/generated/pyaurorax/data/ucalgary/read/index.html @@ -109,6 +109,8 @@

Classes

n_parallel: int = 1, first_record: bool = False, no_metadata: bool = False, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, quiet: bool = False) -> Data: """ Read in data files for a given dataset. Note that only one type of dataset's data @@ -134,7 +136,25 @@

Classes

parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. - + + start_time (datetime.datetime): + The start timestamp to read data onwards from (inclusive). This can be utilized to + read a portion of a data file, and could be paired with the `end_time` parameter. + This tends to be utilized for datasets that are hour or day-long files where it is + possible to only read a smaller bit of that file. An example is the TREx Spectrograph + processed data (1 hour files), or the riometer data (1 day files). If not supplied, + it will assume the start time is the timestamp of the first record in the first + file supplied (ie. beginning of the supplied data). This parameter is optional. + + end_time (datetime.datetime): + The end timestamp to read data up to (inclusive). This can be utilized to read a + portion of a data file, and could be paired with the `start_time` parameter. This + tends to be utilized for datasets that are hour or day-long files where it is possible + to only read a smaller bit of that file. An example is the TREx Spectrograph processed + data (1 hour files), or the riometer data (1 day files). If not supplied, it will + it will assume the end time is the timestamp of the last record in the last file + supplied (ie. end of the supplied data). This parameter is optional. + no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is `False`. This parameter is optional. @@ -167,6 +187,8 @@

Classes

n_parallel=n_parallel, first_record=first_record, no_metadata=no_metadata, + start_time=start_time, + end_time=end_time, quiet=quiet, ) except SRSUnsupportedReadError as e: @@ -179,6 +201,8 @@

Classes

n_parallel: int = 1, first_record: bool = False, no_metadata: bool = False, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, quiet: bool = False, dataset: Optional[Dataset] = None) -> Data: """ @@ -227,6 +251,8 @@

Classes

n_parallel=n_parallel, first_record=first_record, no_metadata=no_metadata, + start_time=start_time, + end_time=end_time, quiet=quiet, dataset=dataset, ) @@ -238,6 +264,8 @@

Classes

n_parallel: int = 1, first_record: bool = False, no_metadata: bool = False, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, quiet: bool = False, dataset: Optional[Dataset] = None) -> Data: """ @@ -263,7 +291,25 @@

Classes

no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is `False`. This parameter is optional. - + + start_time (datetime.datetime): + The start timestamp to read data onwards from (inclusive). This can be utilized to + read a portion of a data file, and could be paired with the `end_time` parameter. + This tends to be utilized for datasets that are hour or day-long files where it is + possible to only read a smaller bit of that file. An example is the TREx Spectrograph + processed data (1 hour files), or the riometer data (1 day files). If not supplied, + it will assume the start time is the timestamp of the first record in the first + file supplied (ie. beginning of the supplied data). This parameter is optional. + + end_time (datetime.datetime): + The end timestamp to read data up to (inclusive). This can be utilized to read a + portion of a data file, and could be paired with the `start_time` parameter. This + tends to be utilized for datasets that are hour or day-long files where it is possible + to only read a smaller bit of that file. An example is the TREx Spectrograph processed + data (1 hour files), or the riometer data (1 day files). If not supplied, it will + it will assume the end time is the timestamp of the last record in the last file + supplied (ie. end of the supplied data). This parameter is optional. + quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the `problematic_files` @@ -285,6 +331,8 @@

Classes

n_parallel=n_parallel, first_record=first_record, no_metadata=no_metadata, + start_time=start_time, + end_time=end_time, quiet=quiet, dataset=dataset, ) @@ -294,6 +342,8 @@

Classes

n_parallel: int = 1, first_record: bool = False, no_metadata: bool = False, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, quiet: bool = False, dataset: Optional[Dataset] = None) -> Data: """ @@ -319,7 +369,25 @@

Classes

no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is `False`. This parameter is optional. - + + start_time (datetime.datetime): + The start timestamp to read data onwards from (inclusive). This can be utilized to + read a portion of a data file, and could be paired with the `end_time` parameter. + This tends to be utilized for datasets that are hour or day-long files where it is + possible to only read a smaller bit of that file. An example is the TREx Spectrograph + processed data (1 hour files), or the riometer data (1 day files). If not supplied, + it will assume the start time is the timestamp of the first record in the first + file supplied (ie. beginning of the supplied data). This parameter is optional. + + end_time (datetime.datetime): + The end timestamp to read data up to (inclusive). This can be utilized to read a + portion of a data file, and could be paired with the `start_time` parameter. This + tends to be utilized for datasets that are hour or day-long files where it is possible + to only read a smaller bit of that file. An example is the TREx Spectrograph processed + data (1 hour files), or the riometer data (1 day files). If not supplied, it will + it will assume the end time is the timestamp of the last record in the last file + supplied (ie. end of the supplied data). This parameter is optional. + quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the `problematic_files` @@ -341,6 +409,8 @@

Classes

n_parallel=n_parallel, first_record=first_record, no_metadata=no_metadata, + start_time=start_time, + end_time=end_time, quiet=quiet, dataset=dataset, ) @@ -350,6 +420,8 @@

Classes

n_parallel: int = 1, first_record: bool = False, no_metadata: bool = False, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, quiet: bool = False, dataset: Optional[Dataset] = None) -> Data: """ @@ -375,7 +447,25 @@

Classes

no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is `False`. This parameter is optional. - + + start_time (datetime.datetime): + The start timestamp to read data onwards from (inclusive). This can be utilized to + read a portion of a data file, and could be paired with the `end_time` parameter. + This tends to be utilized for datasets that are hour or day-long files where it is + possible to only read a smaller bit of that file. An example is the TREx Spectrograph + processed data (1 hour files), or the riometer data (1 day files). If not supplied, + it will assume the start time is the timestamp of the first record in the first + file supplied (ie. beginning of the supplied data). This parameter is optional. + + end_time (datetime.datetime): + The end timestamp to read data up to (inclusive). This can be utilized to read a + portion of a data file, and could be paired with the `start_time` parameter. This + tends to be utilized for datasets that are hour or day-long files where it is possible + to only read a smaller bit of that file. An example is the TREx Spectrograph processed + data (1 hour files), or the riometer data (1 day files). If not supplied, it will + it will assume the end time is the timestamp of the last record in the last file + supplied (ie. end of the supplied data). This parameter is optional. + quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the `problematic_files` @@ -398,6 +488,8 @@

Classes

n_parallel=n_parallel, first_record=first_record, no_metadata=no_metadata, + start_time=start_time, + end_time=end_time, quiet=quiet, dataset=dataset, ) @@ -407,6 +499,8 @@

Classes

n_parallel: int = 1, first_record: bool = False, no_metadata: bool = False, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, quiet: bool = False, dataset: Optional[Dataset] = None) -> Data: """ @@ -433,7 +527,25 @@

Classes

no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is `False`. This parameter is optional. - + + start_time (datetime.datetime): + The start timestamp to read data onwards from (inclusive). This can be utilized to + read a portion of a data file, and could be paired with the `end_time` parameter. + This tends to be utilized for datasets that are hour or day-long files where it is + possible to only read a smaller bit of that file. An example is the TREx Spectrograph + processed data (1 hour files), or the riometer data (1 day files). If not supplied, + it will assume the start time is the timestamp of the first record in the first + file supplied (ie. beginning of the supplied data). This parameter is optional. + + end_time (datetime.datetime): + The end timestamp to read data up to (inclusive). This can be utilized to read a + portion of a data file, and could be paired with the `start_time` parameter. This + tends to be utilized for datasets that are hour or day-long files where it is possible + to only read a smaller bit of that file. An example is the TREx Spectrograph processed + data (1 hour files), or the riometer data (1 day files). If not supplied, it will + it will assume the end time is the timestamp of the last record in the last file + supplied (ie. end of the supplied data). This parameter is optional. + quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the `problematic_files` @@ -455,6 +567,8 @@

Classes

n_parallel=n_parallel, first_record=first_record, no_metadata=no_metadata, + start_time=start_time, + end_time=end_time, quiet=quiet, dataset=dataset, ) @@ -464,6 +578,8 @@

Classes

n_parallel: int = 1, first_record: bool = False, no_metadata: bool = False, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, quiet: bool = False, dataset: Optional[Dataset] = None) -> Data: """ @@ -489,7 +605,25 @@

Classes

no_metadata (bool): Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is `False`. This parameter is optional. - + + start_time (datetime.datetime): + The start timestamp to read data onwards from (inclusive). This can be utilized to + read a portion of a data file, and could be paired with the `end_time` parameter. + This tends to be utilized for datasets that are hour or day-long files where it is + possible to only read a smaller bit of that file. An example is the TREx Spectrograph + processed data (1 hour files), or the riometer data (1 day files). If not supplied, + it will assume the start time is the timestamp of the first record in the first + file supplied (ie. beginning of the supplied data). This parameter is optional. + + end_time (datetime.datetime): + The end timestamp to read data up to (inclusive). This can be utilized to read a + portion of a data file, and could be paired with the `start_time` parameter. This + tends to be utilized for datasets that are hour or day-long files where it is possible + to only read a smaller bit of that file. An example is the TREx Spectrograph processed + data (1 hour files), or the riometer data (1 day files). If not supplied, it will + it will assume the end time is the timestamp of the last record in the last file + supplied (ie. end of the supplied data). This parameter is optional. + quiet (bool): Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the `problematic_files` @@ -511,6 +645,8 @@

Classes

n_parallel=n_parallel, first_record=first_record, no_metadata=no_metadata, + start_time=start_time, + end_time=end_time, quiet=quiet, dataset=dataset, ) @@ -601,6 +737,85 @@

Classes

n_parallel=n_parallel, quiet=quiet, dataset=dataset, + ) + + def read_grid(self, + file_list: Union[List[str], List[Path], str, Path], + n_parallel: int = 1, + first_record: bool = False, + no_metadata: bool = False, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + quiet: bool = False, + dataset: Optional[Dataset] = None) -> Data: + """ + Read in grid files. + + Args: + file_list (List[str], List[Path], str, Path): + The files to read in. Absolute paths are recommended, but not technically + necessary. This can be a single string for a file, or a list of strings to read + in multiple files. This parameter is required. + + n_parallel (int): + Number of data files to read in parallel using multiprocessing. Default value + is 1. Adjust according to your computer's available resources. This parameter + is optional. + + first_record (bool): + Only read in the first record in each file. This is the same as the first_frame + parameter in the themis-imager-readfile and trex-imager-readfile libraries, and + is a read optimization if you only need one image per minute, as opposed to the + full temporal resolution of data (e.g., 3sec cadence). This parameter is optional. + + no_metadata (bool): + Skip reading of metadata. This is a minor optimization if the metadata is not needed. + Default is `False`. This parameter is optional. + + start_time (datetime.datetime): + The start timestamp to read data onwards from (inclusive). This can be utilized to + read a portion of a data file, and could be paired with the `end_time` parameter. + This tends to be utilized for datasets that are hour or day-long files where it is + possible to only read a smaller bit of that file. An example is the TREx Spectrograph + processed data (1 hour files), or the riometer data (1 day files). If not supplied, + it will assume the start time is the timestamp of the first record in the first + file supplied (ie. beginning of the supplied data). This parameter is optional. + + end_time (datetime.datetime): + The end timestamp to read data up to (inclusive). This can be utilized to read a + portion of a data file, and could be paired with the `start_time` parameter. This + tends to be utilized for datasets that are hour or day-long files where it is possible + to only read a smaller bit of that file. An example is the TREx Spectrograph processed + data (1 hour files), or the riometer data (1 day files). If not supplied, it will + it will assume the end time is the timestamp of the last record in the last file + supplied (ie. end of the supplied data). This parameter is optional. + + quiet (bool): + Do not print out errors while reading data files, if any are encountered. Any files + that encounter errors will be, as usual, accessible via the `problematic_files` + attribute of the returned `pyucalgarysrs.data.classes.Data` object. This parameter + is optional. + + dataset (pyucalgarysrs.data.classes.Dataset): + The dataset object for which the files are associated with. This parameter is + optional. + + Returns: + A `pyucalgarysrs.data.classes.Data` object containing the data read in, among other + values. + + Raises: + pyucalgarysrs.exceptions.SRSError: a generic read error was encountered + """ + return self.__aurorax_obj.srs_obj.data.readers.read_grid( + file_list, + n_parallel=n_parallel, + first_record=first_record, + no_metadata=no_metadata, + start_time=start_time, + end_time=end_time, + quiet=quiet, + dataset=dataset, )

Methods

@@ -634,7 +849,7 @@

Returns

A list of the dataset names with file reading support.

-def read(self,
dataset: pyucalgarysrs.data.classes.Dataset,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
quiet: bool = False) ‑> pyucalgarysrs.data.classes.Data
+def read(self,
dataset: pyucalgarysrs.data.classes.Dataset,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
start_time: datetime.datetime | None = None,
end_time: datetime.datetime | None = None,
quiet: bool = False) ‑> pyucalgarysrs.data.classes.Data

Read in data files for a given dataset. Note that only one type of dataset's data @@ -657,6 +872,22 @@

Args

parameter in the themis-imager-readfile and trex-imager-readfile libraries, and is a read optimization if you only need one image per minute, as opposed to the full temporal resolution of data (e.g., 3sec cadence). This parameter is optional.
+
start_time : datetime.datetime
+
The start timestamp to read data onwards from (inclusive). This can be utilized to +read a portion of a data file, and could be paired with the end_time parameter. +This tends to be utilized for datasets that are hour or day-long files where it is +possible to only read a smaller bit of that file. An example is the TREx Spectrograph +processed data (1 hour files), or the riometer data (1 day files). If not supplied, +it will assume the start time is the timestamp of the first record in the first +file supplied (ie. beginning of the supplied data). This parameter is optional.
+
end_time : datetime.datetime
+
The end timestamp to read data up to (inclusive). This can be utilized to read a +portion of a data file, and could be paired with the start_time parameter. This +tends to be utilized for datasets that are hour or day-long files where it is possible +to only read a smaller bit of that file. An example is the TREx Spectrograph processed +data (1 hour files), or the riometer data (1 day files). If not supplied, it will +it will assume the end time is the timestamp of the last record in the last file +supplied (ie. end of the supplied data). This parameter is optional.
no_metadata : bool
Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False. This parameter is optional.
@@ -714,8 +945,65 @@

Raises

a generic read error was encountered
+
+def read_grid(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
start_time: datetime.datetime | None = None,
end_time: datetime.datetime | None = None,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data
+
+
+

Read in grid files.

+

Args

+
+
file_list : List[str], List[Path], str, Path
+
The files to read in. Absolute paths are recommended, but not technically +necessary. This can be a single string for a file, or a list of strings to read +in multiple files. This parameter is required.
+
n_parallel : int
+
Number of data files to read in parallel using multiprocessing. Default value +is 1. Adjust according to your computer's available resources. This parameter +is optional.
+
first_record : bool
+
Only read in the first record in each file. This is the same as the first_frame +parameter in the themis-imager-readfile and trex-imager-readfile libraries, and +is a read optimization if you only need one image per minute, as opposed to the +full temporal resolution of data (e.g., 3sec cadence). This parameter is optional.
+
no_metadata : bool
+
Skip reading of metadata. This is a minor optimization if the metadata is not needed. +Default is False. This parameter is optional.
+
start_time : datetime.datetime
+
The start timestamp to read data onwards from (inclusive). This can be utilized to +read a portion of a data file, and could be paired with the end_time parameter. +This tends to be utilized for datasets that are hour or day-long files where it is +possible to only read a smaller bit of that file. An example is the TREx Spectrograph +processed data (1 hour files), or the riometer data (1 day files). If not supplied, +it will assume the start time is the timestamp of the first record in the first +file supplied (ie. beginning of the supplied data). This parameter is optional.
+
end_time : datetime.datetime
+
The end timestamp to read data up to (inclusive). This can be utilized to read a +portion of a data file, and could be paired with the start_time parameter. This +tends to be utilized for datasets that are hour or day-long files where it is possible +to only read a smaller bit of that file. An example is the TREx Spectrograph processed +data (1 hour files), or the riometer data (1 day files). If not supplied, it will +it will assume the end time is the timestamp of the last record in the last file +supplied (ie. end of the supplied data). This parameter is optional.
+
quiet : bool
+
Do not print out errors while reading data files, if any are encountered. Any files +that encounter errors will be, as usual, accessible via the problematic_files +attribute of the returned pyucalgarysrs.data.classes.Data object. This parameter +is optional.
+
dataset : pyucalgarysrs.data.classes.Dataset
+
The dataset object for which the files are associated with. This parameter is +optional.
+
+

Returns

+

A pyucalgarysrs.data.classes.Data object containing the data read in, among other +values.

+

Raises

+
+
pyucalgarysrs.exceptions.SRSError
+
a generic read error was encountered
+
+
-def read_rego(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data
+def read_rego(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
start_time: datetime.datetime | None = None,
end_time: datetime.datetime | None = None,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data

Read in REGO raw data (stream0 pgm* files).

@@ -737,6 +1025,22 @@

Args

no_metadata : bool
Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False. This parameter is optional.
+
start_time : datetime.datetime
+
The start timestamp to read data onwards from (inclusive). This can be utilized to +read a portion of a data file, and could be paired with the end_time parameter. +This tends to be utilized for datasets that are hour or day-long files where it is +possible to only read a smaller bit of that file. An example is the TREx Spectrograph +processed data (1 hour files), or the riometer data (1 day files). If not supplied, +it will assume the start time is the timestamp of the first record in the first +file supplied (ie. beginning of the supplied data). This parameter is optional.
+
end_time : datetime.datetime
+
The end timestamp to read data up to (inclusive). This can be utilized to read a +portion of a data file, and could be paired with the start_time parameter. This +tends to be utilized for datasets that are hour or day-long files where it is possible +to only read a smaller bit of that file. An example is the TREx Spectrograph processed +data (1 hour files), or the riometer data (1 day files). If not supplied, it will +it will assume the end time is the timestamp of the last record in the last file +supplied (ie. end of the supplied data). This parameter is optional.
quiet : bool
Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files @@ -787,7 +1091,7 @@

Raises

-def read_themis(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data
+def read_themis(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
start_time: datetime.datetime | None = None,
end_time: datetime.datetime | None = None,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data

Read in THEMIS ASI raw data (stream0 full.pgm* files).

@@ -827,7 +1131,7 @@

Raises

-def read_trex_blue(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data
+def read_trex_blue(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
start_time: datetime.datetime | None = None,
end_time: datetime.datetime | None = None,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data

Read in TREx Blueline raw data (stream0 pgm* files).

@@ -849,6 +1153,22 @@

Args

no_metadata : bool
Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False. This parameter is optional.
+
start_time : datetime.datetime
+
The start timestamp to read data onwards from (inclusive). This can be utilized to +read a portion of a data file, and could be paired with the end_time parameter. +This tends to be utilized for datasets that are hour or day-long files where it is +possible to only read a smaller bit of that file. An example is the TREx Spectrograph +processed data (1 hour files), or the riometer data (1 day files). If not supplied, +it will assume the start time is the timestamp of the first record in the first +file supplied (ie. beginning of the supplied data). This parameter is optional.
+
end_time : datetime.datetime
+
The end timestamp to read data up to (inclusive). This can be utilized to read a +portion of a data file, and could be paired with the start_time parameter. This +tends to be utilized for datasets that are hour or day-long files where it is possible +to only read a smaller bit of that file. An example is the TREx Spectrograph processed +data (1 hour files), or the riometer data (1 day files). If not supplied, it will +it will assume the end time is the timestamp of the last record in the last file +supplied (ie. end of the supplied data). This parameter is optional.
quiet : bool
Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files @@ -868,7 +1188,7 @@

Raises

-def read_trex_nir(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data
+def read_trex_nir(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
start_time: datetime.datetime | None = None,
end_time: datetime.datetime | None = None,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data

Read in TREx near-infrared (NIR) raw data (stream0 pgm* files).

@@ -890,6 +1210,22 @@

Args

no_metadata : bool
Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False. This parameter is optional.
+
start_time : datetime.datetime
+
The start timestamp to read data onwards from (inclusive). This can be utilized to +read a portion of a data file, and could be paired with the end_time parameter. +This tends to be utilized for datasets that are hour or day-long files where it is +possible to only read a smaller bit of that file. An example is the TREx Spectrograph +processed data (1 hour files), or the riometer data (1 day files). If not supplied, +it will assume the start time is the timestamp of the first record in the first +file supplied (ie. beginning of the supplied data). This parameter is optional.
+
end_time : datetime.datetime
+
The end timestamp to read data up to (inclusive). This can be utilized to read a +portion of a data file, and could be paired with the start_time parameter. This +tends to be utilized for datasets that are hour or day-long files where it is possible +to only read a smaller bit of that file. An example is the TREx Spectrograph processed +data (1 hour files), or the riometer data (1 day files). If not supplied, it will +it will assume the end time is the timestamp of the last record in the last file +supplied (ie. end of the supplied data). This parameter is optional.
quiet : bool
Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files @@ -908,7 +1244,7 @@

Raises

-def read_trex_rgb(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data
+def read_trex_rgb(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
start_time: datetime.datetime | None = None,
end_time: datetime.datetime | None = None,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data

Read in TREx RGB raw data (stream0 h5, stream0.burst png.tar, unstable stream0 and @@ -931,6 +1267,22 @@

Args

no_metadata : bool
Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False. This parameter is optional.
+
start_time : datetime.datetime
+
The start timestamp to read data onwards from (inclusive). This can be utilized to +read a portion of a data file, and could be paired with the end_time parameter. +This tends to be utilized for datasets that are hour or day-long files where it is +possible to only read a smaller bit of that file. An example is the TREx Spectrograph +processed data (1 hour files), or the riometer data (1 day files). If not supplied, +it will assume the start time is the timestamp of the first record in the first +file supplied (ie. beginning of the supplied data). This parameter is optional.
+
end_time : datetime.datetime
+
The end timestamp to read data up to (inclusive). This can be utilized to read a +portion of a data file, and could be paired with the start_time parameter. This +tends to be utilized for datasets that are hour or day-long files where it is possible +to only read a smaller bit of that file. An example is the TREx Spectrograph processed +data (1 hour files), or the riometer data (1 day files). If not supplied, it will +it will assume the end time is the timestamp of the last record in the last file +supplied (ie. end of the supplied data). This parameter is optional.
quiet : bool
Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files @@ -949,7 +1301,7 @@

Raises

-def read_trex_spectrograph(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data
+def read_trex_spectrograph(self,
file_list: List[str] | List[pathlib.Path] | str | pathlib.Path,
n_parallel: int = 1,
first_record: bool = False,
no_metadata: bool = False,
start_time: datetime.datetime | None = None,
end_time: datetime.datetime | None = None,
quiet: bool = False,
dataset: pyucalgarysrs.data.classes.Dataset | None = None) ‑> pyucalgarysrs.data.classes.Data

Read in TREx Spectrograph raw data (stream0 pgm* files).

@@ -971,6 +1323,22 @@

Args

no_metadata : bool
Skip reading of metadata. This is a minor optimization if the metadata is not needed. Default is False. This parameter is optional.
+
start_time : datetime.datetime
+
The start timestamp to read data onwards from (inclusive). This can be utilized to +read a portion of a data file, and could be paired with the end_time parameter. +This tends to be utilized for datasets that are hour or day-long files where it is +possible to only read a smaller bit of that file. An example is the TREx Spectrograph +processed data (1 hour files), or the riometer data (1 day files). If not supplied, +it will assume the start time is the timestamp of the first record in the first +file supplied (ie. beginning of the supplied data). This parameter is optional.
+
end_time : datetime.datetime
+
The end timestamp to read data up to (inclusive). This can be utilized to read a +portion of a data file, and could be paired with the start_time parameter. This +tends to be utilized for datasets that are hour or day-long files where it is possible +to only read a smaller bit of that file. An example is the TREx Spectrograph processed +data (1 hour files), or the riometer data (1 day files). If not supplied, it will +it will assume the end time is the timestamp of the last record in the last file +supplied (ie. end of the supplied data). This parameter is optional.
quiet : bool
Do not print out errors while reading data files, if any are encountered. Any files that encounter errors will be, as usual, accessible via the problematic_files @@ -1058,6 +1426,7 @@

list_supported_datasets
  • read
  • read_calibration
  • +
  • read_grid
  • read_rego
  • read_skymap
  • read_themis
  • diff --git a/docs/generated/pyaurorax/tools/classes/keogram.html b/docs/generated/pyaurorax/tools/classes/keogram.html index b899de0c..ce7e50fd 100644 --- a/docs/generated/pyaurorax/tools/classes/keogram.html +++ b/docs/generated/pyaurorax/tools/classes/keogram.html @@ -56,7 +56,7 @@

    Classes

    class Keogram -(data: numpy.ndarray,
    timestamp: List[datetime.datetime],
    slice_idx: int | None = None,
    ccd_y: numpy.ndarray | None = None,
    mag_y: numpy.ndarray | None = None,
    geo_y: numpy.ndarray | None = None)
    +(data: numpy.ndarray,
    timestamp: List[datetime.datetime],
    instrument_type: str,
    slice_idx: int | None = None,
    ccd_y: numpy.ndarray | None = None,
    mag_y: numpy.ndarray | None = None,
    geo_y: numpy.ndarray | None = None)

    Class representation for a keogram

    @@ -66,6 +66,8 @@

    Attributes

    The derived keogram data.
    timestamp : List[datetime.datetime]
    Timestamps corresponding to each keogram slice.
    +
    instrument_type (str):
    +
    String giving instrument type, either 'asi' or 'spectrograph'.
    ccd_y : numpy.ndarray
    The y-axis representing CCD Y coordinates for the keogram.
    mag_y : numpy.ndarray
    @@ -87,6 +89,8 @@

    Attributes

    The derived keogram data. timestamp (List[datetime.datetime]): Timestamps corresponding to each keogram slice. + instrument_type (str): + String giving instrument type, either 'asi' or 'spectrograph'. ccd_y (numpy.ndarray): The y-axis representing CCD Y coordinates for the keogram. mag_y (numpy.ndarray): @@ -98,6 +102,7 @@

    Attributes

    def __init__(self, data: np.ndarray, timestamp: List[datetime.datetime], + instrument_type: str, slice_idx: Optional[int] = None, ccd_y: Optional[np.ndarray] = None, mag_y: Optional[np.ndarray] = None, @@ -105,6 +110,7 @@

    Attributes

    # public vars self.data = data self.timestamp = timestamp + self.instrument_type = instrument_type self.ccd_y = ccd_y self.mag_y = mag_y self.geo_y = geo_y @@ -147,8 +153,8 @@

    Attributes

    # check for slice idx if (self.__slice_idx is None): raise ValueError("Unable to set the geographic latitudes since the slice_idx is None. If this keogram " + - "object was create as part of the custom_keogram routines, this is expected and performing " + - "this action not supported at this time.") + "object was created as part of the custom_keogram routines or is a spectrogaph keogram, " + + "this is expected and performing this action is not supported at this time.") # determine altitude index to use if (altitude_km is not None): @@ -174,7 +180,7 @@

    Attributes

    self.geo_y = lats[:, self.__slice_idx].copy() else: # use default middle altitude - self.geo_y = np.squeeze(skymap.full_map_latitude[1,:, self.__slice_idx]).copy() + self.geo_y = np.squeeze(skymap.full_map_latitude[1, :, self.__slice_idx]).copy() def set_magnetic_latitudes(self, skymap: Skymap, timestamp: datetime.datetime, altitude_km: Optional[Union[int, float]] = None) -> None: """ @@ -204,8 +210,8 @@

    Attributes

    # check for slice idx if (self.__slice_idx is None): raise ValueError("Unable to set the geographic latitudes since the slice_idx is None. If this keogram " + - "object was create as part of the custom_keogram routines, this is expected and performing " + - "this action not supported at this time.") + "object was created as part of the custom_keogram routines or is a spectrogaph keogram, " + + "this is expected and performing this action is not supported at this time.") # determine altitude index to use if (altitude_km is not None): @@ -353,11 +359,11 @@

    Attributes

    # check return mode if (returnfig is True and savefig is True): raise ValueError("Only one of returnfig or savefig can be set to True") - if (returnfig is True and (savefig_filename is not None or savefig_quality is not None)): + if returnfig is True and (savefig_filename is not None or savefig_quality is not None): warnings.warn("The figure will be returned, but a savefig option parameter was supplied. Consider " + "removing the savefig option parameter(s) as they will be ignored.", stacklevel=1) - elif (savefig is False and (savefig_filename is not None or savefig_quality is not None)): + elif savefig is False and (savefig_filename is not None or savefig_quality is not None): warnings.warn("A savefig option parameter was supplied, but the savefig parameter is False. The " + "savefig option parameters will be ignored.", stacklevel=1) @@ -437,7 +443,9 @@

    Attributes

    # generate y ticks and labels y_ticks = self.ccd_y[25::ytick_increment] - y_labels = np.round(y_axis_data, 1).astype(str)[25::ytick_increment] # type: ignore + y_labels = np.round( + y_axis_data, # type: ignore + 1).astype(str)[25::ytick_increment] y_labels[np.where(y_labels == 'nan')] = '' # apply yticks diff --git a/docs/generated/pyaurorax/tools/classes/mosaic.html b/docs/generated/pyaurorax/tools/classes/mosaic.html index 6bf85553..a6bb013d 100644 --- a/docs/generated/pyaurorax/tools/classes/mosaic.html +++ b/docs/generated/pyaurorax/tools/classes/mosaic.html @@ -56,7 +56,7 @@

    Classes

    class Mosaic -(polygon_data: matplotlib.collections.PolyCollection | List[matplotlib.collections.PolyCollection],
    cartopy_projection: cartopy.crs.Projection,
    contour_data: Dict[str, List[Any]] | None = None)
    +(polygon_data: matplotlib.collections.PolyCollection | List[matplotlib.collections.PolyCollection],
    cartopy_projection: cartopy.crs.Projection,
    contour_data: Dict[str, List[Any]] | None = None,
    spect_cmap: str | None = None,
    spect_intensity_scale: Tuple[int, int] | None = None)

    Class representation for a generated mosaic.

    @@ -68,6 +68,11 @@

    Attributes

    Cartopy projection to utilize.
    contour_data : Dict[str, List[Any]]
    Generated contour data.
    +
    spect_cmap : str
    +
    String giving the cmap to use for spect legend.
    +
    spect_intensity_scale : Tuple[int]
    +
    The min and max values that spectrograph data +is scaled to in the mosaic, if any is present.
    @@ -85,10 +90,17 @@

    Attributes

    Cartopy projection to utilize. contour_data (Dict[str, List[Any]]): Generated contour data. + spect_cmap (str): + String giving the cmap to use for spect legend. + spect_intensity_scale (Tuple[int]): + The min and max values that spectrograph data + is scaled to in the mosaic, if any is present. """ polygon_data: Union[PolyCollection, List[PolyCollection]] cartopy_projection: Projection contour_data: Optional[Dict[str, List[Any]]] = None + spect_cmap: Optional[str] = None + spect_intensity_scale: Optional[Tuple[int, int]] = None def __str__(self) -> str: return self.__repr__() @@ -105,7 +117,7 @@

    Attributes

    len(self.contour_data.get("x", [])), ) else: - return "Mosaic(polygon_data="+polycollection_str+", cartopy_projection=Projection(%s))" % (self.cartopy_projection.to_string()) + return "Mosaic(polygon_data=" + polycollection_str + ", cartopy_projection=Projection(%s))" % (self.cartopy_projection.to_string()) def plot(self, map_extent: Sequence[Union[float, int]], @@ -113,12 +125,13 @@

    Attributes

    rayleighs: bool = False, max_rayleighs: int = 20000, title: Optional[str] = None, + colorbar_title: Optional[str] = None, ocean_color: Optional[str] = None, land_color: str = "gray", land_edgecolor: str = "#8A8A8A", borders_color: str = "#AEAEAE", borders_disable: bool = False, - cbar_colormap: str = "gray", + cbar_colormap: str = "", returnfig: bool = False, savefig: bool = False, savefig_filename: Optional[str] = None, @@ -163,7 +176,9 @@

    Attributes

    Disbale rendering of the borders. Default is `False`. cbar_colorcmap (str): - The matplotlib colormap to use for the plotted color bar. Default is `gray`. + The matplotlib colormap to use for the plotted color bar. Default is `gray`, unless + mosaic was created with spectrograph data, in which case defaults to the colormap + used for spectrograph data.. Commonly used colormaps are: @@ -205,7 +220,7 @@

    Attributes

    # check return mode if (returnfig is True and savefig is True): raise ValueError("Only one of returnfig or savefig can be set to True") - if (returnfig is True and (savefig_filename is not None or savefig_quality is not None)): + if returnfig is True and (savefig_filename is not None or savefig_quality is not None): warnings.warn("The figure will be returned, but a savefig option parameter was supplied. Consider " + "removing the savefig option parameter(s) as they will be ignored.", stacklevel=1) @@ -214,6 +229,10 @@

    Attributes

    "savefig option parameters will be ignored.", stacklevel=1) + # Get colormap if there is spectrograph data + if self.spect_cmap is not None: + cbar_colormap = self.spect_cmap + # initialize figure fig = plt.figure(figsize=figsize) ax = fig.add_axes((0, 0, 1, 1), projection=self.cartopy_projection) @@ -223,16 +242,19 @@

    Attributes

    # # NOTE: we use the default ocean color if (ocean_color is not None): - ax.add_feature(cartopy.feature.OCEAN, facecolor=ocean_color, zorder=0) # type: ignore + ax.add_feature( # type: ignore + cartopy.feature.OCEAN, facecolor=ocean_color, zorder=0) else: ax.add_feature(cartopy.feature.OCEAN, zorder=0) # type: ignore # add land - ax.add_feature(cartopy.feature.LAND, facecolor=land_color, edgecolor=land_edgecolor, zorder=0) # type: ignore + ax.add_feature( # type: ignore + cartopy.feature.LAND, facecolor=land_color, edgecolor=land_edgecolor, zorder=0) # add borders if (borders_disable is False): - ax.add_feature(cartopy.feature.BORDERS, edgecolor=borders_color, zorder=0) # type: ignore + ax.add_feature( # type: ignore + cartopy.feature.BORDERS, edgecolor=borders_color, zorder=0) # add polygon data # @@ -262,7 +284,7 @@

    Attributes

    if (rayleighs is True): if isinstance(self.polygon_data, list): raise ValueError("Rayleighs Keyword is currently not available for mosaics with multiple sets of data.") - + # Create a colorbar, in Rayleighs, that accounts for the scaling limit we applied cbar_ticks = [float(j) / 5. for j in range(0, 6)] cbar_ticknames = [str(int(max_rayleighs / 5) * j) for j in range(0, 6)] @@ -282,6 +304,51 @@

    Attributes

    weight="bold", style="oblique") + if (self.spect_cmap) is not None: + + if (self.spect_intensity_scale) is None: + intensity_max = np.nan + intensity_min = np.nan + else: + intensity_max = self.spect_intensity_scale[1] + intensity_min = self.spect_intensity_scale[0] + + # Create a colorbar, in Rayleighs, that accounts for the scaling limit we applied + cbar_ticks = [float(j) / 5. for j in range(0, 6)] + cbar_ticknames = [str(int((intensity_max / 5) + intensity_min) * j) for j in range(0, 6)] + + # Any specrograph bins with the max intensity value could be greater than it, so we include the plus sign + cbar_ticknames[-1] += "+" + if isinstance(self.polygon_data, list): + self.polygon_data[0].set_cmap(cbar_colormap) + else: + self.polygon_data.set_cmap(cbar_colormap) + if isinstance(self.polygon_data, list): + cbar = plt.colorbar(self.polygon_data[0], shrink=0.5, ticks=cbar_ticks, ax=ax) + else: + cbar = plt.colorbar(self.polygon_data, shrink=0.5, ticks=cbar_ticks, ax=ax) + cbar.ax.set_yticklabels(cbar_ticknames) + if colorbar_title is None: + plt.text(1.025, + 0.5, + "Spectrograph Intensity (Rayleighs)", + fontsize=10, + transform=ax.transAxes, + va="center", + rotation="vertical", + weight="bold", + style="oblique") + else: + plt.text(1.025, + 0.5, + colorbar_title, + fontsize=10, + transform=ax.transAxes, + va="center", + rotation="vertical", + weight="bold", + style="oblique") + # save figure or show it if (savefig is True): # check that filename has been set @@ -386,7 +453,7 @@

    Attributes

    # Check that marker is valid if marker not in ["", "o", ".", "p", "*", "x", "+", "X"]: raise ValueError(f"Marker '{marker}' is not currently supported.") - + # Convert numerics to lists if necessary if constant_lats is not None: if isinstance(constant_lats, (float, int)): @@ -641,6 +708,14 @@

    Class variables

    +
    var spect_cmap : str | None
    +
    +
    +
    +
    var spect_intensity_scale : Tuple[int, int] | None
    +
    +
    +

    Methods

    @@ -707,7 +782,7 @@

    Raises

    -def plot(self,
    map_extent: Sequence[float | int],
    figsize: Tuple[int, int] | None = None,
    rayleighs: bool = False,
    max_rayleighs: int = 20000,
    title: str | None = None,
    ocean_color: str | None = None,
    land_color: str = 'gray',
    land_edgecolor: str = '#8A8A8A',
    borders_color: str = '#AEAEAE',
    borders_disable: bool = False,
    cbar_colormap: str = 'gray',
    returnfig: bool = False,
    savefig: bool = False,
    savefig_filename: str | None = None,
    savefig_quality: int | None = None) ‑> Any
    +def plot(self,
    map_extent: Sequence[float | int],
    figsize: Tuple[int, int] | None = None,
    rayleighs: bool = False,
    max_rayleighs: int = 20000,
    title: str | None = None,
    colorbar_title: str | None = None,
    ocean_color: str | None = None,
    land_color: str = 'gray',
    land_edgecolor: str = '#8A8A8A',
    borders_color: str = '#AEAEAE',
    borders_disable: bool = False,
    cbar_colormap: str = '',
    returnfig: bool = False,
    savefig: bool = False,
    savefig_filename: str | None = None,
    savefig_quality: int | None = None) ‑> Any

    Generate a plot of the mosaic data.

    @@ -740,7 +815,9 @@

    Args

    Disbale rendering of the borders. Default is False.
    cbar_colorcmap : str
    -

    The matplotlib colormap to use for the plotted color bar. Default is gray.

    +

    The matplotlib colormap to use for the plotted color bar. Default is gray, unless +mosaic was created with spectrograph data, in which case defaults to the colormap +used for spectrograph data..

    Commonly used colormaps are:

    class MosaicData -(site_uid_list: List[str],
    timestamps: List[datetime.datetime],
    images: Dict[str, numpy.ndarray],
    images_dimensions: Dict[str, Tuple])
    +(site_uid_list: List[str],
    timestamps: List[datetime.datetime],
    images: Dict[str, numpy.ndarray],
    images_dimensions: Dict[str, Tuple],
    data_types: List[str])

    Prepared image data for use by mosaic routines.

    @@ -793,6 +870,8 @@

    Attributes

    ndarray is the prepared data.
    images_dimensions : Dict[str, Tuple]
    The image dimensions.
    +
    data_types : List[str]
    +
    The data types for each data object.
    @@ -812,13 +891,16 @@

    Attributes

    Image data prepared into the necessary format; a dictionary. Keys are the site UID, ndarray is the prepared data. images_dimensions (Dict[str, Tuple]): - The image dimensions. + The image dimensions. + data_types (List[str]): + The data types for each data object. """ site_uid_list: List[str] timestamps: List[datetime.datetime] images: Dict[str, ndarray] images_dimensions: Dict[str, Tuple] + data_types: List[str] def __str__(self) -> str: return self.__repr__() @@ -832,6 +914,10 @@

    Attributes

    Class variables

    +
    var data_types : List[str]
    +
    +
    +
    var images : Dict[str, numpy.ndarray]
    @@ -1004,18 +1090,21 @@

    Class variables

    @@ -243,7 +247,7 @@

    Classes

    class Keogram -(data: numpy.ndarray,
    timestamp: List[datetime.datetime],
    slice_idx: int | None = None,
    ccd_y: numpy.ndarray | None = None,
    mag_y: numpy.ndarray | None = None,
    geo_y: numpy.ndarray | None = None)
    +(data: numpy.ndarray,
    timestamp: List[datetime.datetime],
    instrument_type: str,
    slice_idx: int | None = None,
    ccd_y: numpy.ndarray | None = None,
    mag_y: numpy.ndarray | None = None,
    geo_y: numpy.ndarray | None = None)

    Class representation for a keogram

    @@ -253,6 +257,8 @@

    Attributes

    The derived keogram data.
    timestamp : List[datetime.datetime]
    Timestamps corresponding to each keogram slice.
    +
    instrument_type (str):
    +
    String giving instrument type, either 'asi' or 'spectrograph'.
    ccd_y : numpy.ndarray
    The y-axis representing CCD Y coordinates for the keogram.
    mag_y : numpy.ndarray
    @@ -274,6 +280,8 @@

    Attributes

    The derived keogram data. timestamp (List[datetime.datetime]): Timestamps corresponding to each keogram slice. + instrument_type (str): + String giving instrument type, either 'asi' or 'spectrograph'. ccd_y (numpy.ndarray): The y-axis representing CCD Y coordinates for the keogram. mag_y (numpy.ndarray): @@ -285,6 +293,7 @@

    Attributes

    def __init__(self, data: np.ndarray, timestamp: List[datetime.datetime], + instrument_type: str, slice_idx: Optional[int] = None, ccd_y: Optional[np.ndarray] = None, mag_y: Optional[np.ndarray] = None, @@ -292,6 +301,7 @@

    Attributes

    # public vars self.data = data self.timestamp = timestamp + self.instrument_type = instrument_type self.ccd_y = ccd_y self.mag_y = mag_y self.geo_y = geo_y @@ -334,8 +344,8 @@

    Attributes

    # check for slice idx if (self.__slice_idx is None): raise ValueError("Unable to set the geographic latitudes since the slice_idx is None. If this keogram " + - "object was create as part of the custom_keogram routines, this is expected and performing " + - "this action not supported at this time.") + "object was created as part of the custom_keogram routines or is a spectrogaph keogram, " + + "this is expected and performing this action is not supported at this time.") # determine altitude index to use if (altitude_km is not None): @@ -361,7 +371,7 @@

    Attributes

    self.geo_y = lats[:, self.__slice_idx].copy() else: # use default middle altitude - self.geo_y = np.squeeze(skymap.full_map_latitude[1,:, self.__slice_idx]).copy() + self.geo_y = np.squeeze(skymap.full_map_latitude[1, :, self.__slice_idx]).copy() def set_magnetic_latitudes(self, skymap: Skymap, timestamp: datetime.datetime, altitude_km: Optional[Union[int, float]] = None) -> None: """ @@ -391,8 +401,8 @@

    Attributes

    # check for slice idx if (self.__slice_idx is None): raise ValueError("Unable to set the geographic latitudes since the slice_idx is None. If this keogram " + - "object was create as part of the custom_keogram routines, this is expected and performing " + - "this action not supported at this time.") + "object was created as part of the custom_keogram routines or is a spectrogaph keogram, " + + "this is expected and performing this action is not supported at this time.") # determine altitude index to use if (altitude_km is not None): @@ -540,11 +550,11 @@

    Attributes

    # check return mode if (returnfig is True and savefig is True): raise ValueError("Only one of returnfig or savefig can be set to True") - if (returnfig is True and (savefig_filename is not None or savefig_quality is not None)): + if returnfig is True and (savefig_filename is not None or savefig_quality is not None): warnings.warn("The figure will be returned, but a savefig option parameter was supplied. Consider " + "removing the savefig option parameter(s) as they will be ignored.", stacklevel=1) - elif (savefig is False and (savefig_filename is not None or savefig_quality is not None)): + elif savefig is False and (savefig_filename is not None or savefig_quality is not None): warnings.warn("A savefig option parameter was supplied, but the savefig parameter is False. The " + "savefig option parameters will be ignored.", stacklevel=1) @@ -624,7 +634,9 @@

    Attributes

    # generate y ticks and labels y_ticks = self.ccd_y[25::ytick_increment] - y_labels = np.round(y_axis_data, 1).astype(str)[25::ytick_increment] # type: ignore + y_labels = np.round( + y_axis_data, # type: ignore + 1).astype(str)[25::ytick_increment] y_labels[np.where(y_labels == 'nan')] = '' # apply yticks @@ -1037,7 +1049,7 @@

    Raises

    class Mosaic -(polygon_data: matplotlib.collections.PolyCollection | List[matplotlib.collections.PolyCollection],
    cartopy_projection: cartopy.crs.Projection,
    contour_data: Dict[str, List[Any]] | None = None)
    +(polygon_data: matplotlib.collections.PolyCollection | List[matplotlib.collections.PolyCollection],
    cartopy_projection: cartopy.crs.Projection,
    contour_data: Dict[str, List[Any]] | None = None,
    spect_cmap: str | None = None,
    spect_intensity_scale: Tuple[int, int] | None = None)

    Class representation for a generated mosaic.

    @@ -1049,6 +1061,11 @@

    Attributes

    Cartopy projection to utilize.
    contour_data : Dict[str, List[Any]]
    Generated contour data.
    +
    spect_cmap : str
    +
    String giving the cmap to use for spect legend.
    +
    spect_intensity_scale : Tuple[int]
    +
    The min and max values that spectrograph data +is scaled to in the mosaic, if any is present.
    @@ -1066,10 +1083,17 @@

    Attributes

    Cartopy projection to utilize. contour_data (Dict[str, List[Any]]): Generated contour data. + spect_cmap (str): + String giving the cmap to use for spect legend. + spect_intensity_scale (Tuple[int]): + The min and max values that spectrograph data + is scaled to in the mosaic, if any is present. """ polygon_data: Union[PolyCollection, List[PolyCollection]] cartopy_projection: Projection contour_data: Optional[Dict[str, List[Any]]] = None + spect_cmap: Optional[str] = None + spect_intensity_scale: Optional[Tuple[int, int]] = None def __str__(self) -> str: return self.__repr__() @@ -1086,7 +1110,7 @@

    Attributes

    len(self.contour_data.get("x", [])), ) else: - return "Mosaic(polygon_data="+polycollection_str+", cartopy_projection=Projection(%s))" % (self.cartopy_projection.to_string()) + return "Mosaic(polygon_data=" + polycollection_str + ", cartopy_projection=Projection(%s))" % (self.cartopy_projection.to_string()) def plot(self, map_extent: Sequence[Union[float, int]], @@ -1094,12 +1118,13 @@

    Attributes

    rayleighs: bool = False, max_rayleighs: int = 20000, title: Optional[str] = None, + colorbar_title: Optional[str] = None, ocean_color: Optional[str] = None, land_color: str = "gray", land_edgecolor: str = "#8A8A8A", borders_color: str = "#AEAEAE", borders_disable: bool = False, - cbar_colormap: str = "gray", + cbar_colormap: str = "", returnfig: bool = False, savefig: bool = False, savefig_filename: Optional[str] = None, @@ -1144,7 +1169,9 @@

    Attributes

    Disbale rendering of the borders. Default is `False`. cbar_colorcmap (str): - The matplotlib colormap to use for the plotted color bar. Default is `gray`. + The matplotlib colormap to use for the plotted color bar. Default is `gray`, unless + mosaic was created with spectrograph data, in which case defaults to the colormap + used for spectrograph data.. Commonly used colormaps are: @@ -1186,7 +1213,7 @@

    Attributes

    # check return mode if (returnfig is True and savefig is True): raise ValueError("Only one of returnfig or savefig can be set to True") - if (returnfig is True and (savefig_filename is not None or savefig_quality is not None)): + if returnfig is True and (savefig_filename is not None or savefig_quality is not None): warnings.warn("The figure will be returned, but a savefig option parameter was supplied. Consider " + "removing the savefig option parameter(s) as they will be ignored.", stacklevel=1) @@ -1195,6 +1222,10 @@

    Attributes

    "savefig option parameters will be ignored.", stacklevel=1) + # Get colormap if there is spectrograph data + if self.spect_cmap is not None: + cbar_colormap = self.spect_cmap + # initialize figure fig = plt.figure(figsize=figsize) ax = fig.add_axes((0, 0, 1, 1), projection=self.cartopy_projection) @@ -1204,16 +1235,19 @@

    Attributes

    # # NOTE: we use the default ocean color if (ocean_color is not None): - ax.add_feature(cartopy.feature.OCEAN, facecolor=ocean_color, zorder=0) # type: ignore + ax.add_feature( # type: ignore + cartopy.feature.OCEAN, facecolor=ocean_color, zorder=0) else: ax.add_feature(cartopy.feature.OCEAN, zorder=0) # type: ignore # add land - ax.add_feature(cartopy.feature.LAND, facecolor=land_color, edgecolor=land_edgecolor, zorder=0) # type: ignore + ax.add_feature( # type: ignore + cartopy.feature.LAND, facecolor=land_color, edgecolor=land_edgecolor, zorder=0) # add borders if (borders_disable is False): - ax.add_feature(cartopy.feature.BORDERS, edgecolor=borders_color, zorder=0) # type: ignore + ax.add_feature( # type: ignore + cartopy.feature.BORDERS, edgecolor=borders_color, zorder=0) # add polygon data # @@ -1243,7 +1277,7 @@

    Attributes

    if (rayleighs is True): if isinstance(self.polygon_data, list): raise ValueError("Rayleighs Keyword is currently not available for mosaics with multiple sets of data.") - + # Create a colorbar, in Rayleighs, that accounts for the scaling limit we applied cbar_ticks = [float(j) / 5. for j in range(0, 6)] cbar_ticknames = [str(int(max_rayleighs / 5) * j) for j in range(0, 6)] @@ -1263,6 +1297,51 @@

    Attributes

    weight="bold", style="oblique") + if (self.spect_cmap) is not None: + + if (self.spect_intensity_scale) is None: + intensity_max = np.nan + intensity_min = np.nan + else: + intensity_max = self.spect_intensity_scale[1] + intensity_min = self.spect_intensity_scale[0] + + # Create a colorbar, in Rayleighs, that accounts for the scaling limit we applied + cbar_ticks = [float(j) / 5. for j in range(0, 6)] + cbar_ticknames = [str(int((intensity_max / 5) + intensity_min) * j) for j in range(0, 6)] + + # Any specrograph bins with the max intensity value could be greater than it, so we include the plus sign + cbar_ticknames[-1] += "+" + if isinstance(self.polygon_data, list): + self.polygon_data[0].set_cmap(cbar_colormap) + else: + self.polygon_data.set_cmap(cbar_colormap) + if isinstance(self.polygon_data, list): + cbar = plt.colorbar(self.polygon_data[0], shrink=0.5, ticks=cbar_ticks, ax=ax) + else: + cbar = plt.colorbar(self.polygon_data, shrink=0.5, ticks=cbar_ticks, ax=ax) + cbar.ax.set_yticklabels(cbar_ticknames) + if colorbar_title is None: + plt.text(1.025, + 0.5, + "Spectrograph Intensity (Rayleighs)", + fontsize=10, + transform=ax.transAxes, + va="center", + rotation="vertical", + weight="bold", + style="oblique") + else: + plt.text(1.025, + 0.5, + colorbar_title, + fontsize=10, + transform=ax.transAxes, + va="center", + rotation="vertical", + weight="bold", + style="oblique") + # save figure or show it if (savefig is True): # check that filename has been set @@ -1367,7 +1446,7 @@

    Attributes

    # Check that marker is valid if marker not in ["", "o", ".", "p", "*", "x", "+", "X"]: raise ValueError(f"Marker '{marker}' is not currently supported.") - + # Convert numerics to lists if necessary if constant_lats is not None: if isinstance(constant_lats, (float, int)): @@ -1622,6 +1701,14 @@

    Class variables

    +
    var spect_cmap : str | None
    +
    +
    +
    +
    var spect_intensity_scale : Tuple[int, int] | None
    +
    +
    +

    Methods

    @@ -1688,7 +1775,7 @@

    Raises

    -def plot(self,
    map_extent: Sequence[float | int],
    figsize: Tuple[int, int] | None = None,
    rayleighs: bool = False,
    max_rayleighs: int = 20000,
    title: str | None = None,
    ocean_color: str | None = None,
    land_color: str = 'gray',
    land_edgecolor: str = '#8A8A8A',
    borders_color: str = '#AEAEAE',
    borders_disable: bool = False,
    cbar_colormap: str = 'gray',
    returnfig: bool = False,
    savefig: bool = False,
    savefig_filename: str | None = None,
    savefig_quality: int | None = None) ‑> Any
    +def plot(self,
    map_extent: Sequence[float | int],
    figsize: Tuple[int, int] | None = None,
    rayleighs: bool = False,
    max_rayleighs: int = 20000,
    title: str | None = None,
    colorbar_title: str | None = None,
    ocean_color: str | None = None,
    land_color: str = 'gray',
    land_edgecolor: str = '#8A8A8A',
    borders_color: str = '#AEAEAE',
    borders_disable: bool = False,
    cbar_colormap: str = '',
    returnfig: bool = False,
    savefig: bool = False,
    savefig_filename: str | None = None,
    savefig_quality: int | None = None) ‑> Any

    Generate a plot of the mosaic data.

    @@ -1721,7 +1808,9 @@

    Args

    Disbale rendering of the borders. Default is False.
    cbar_colorcmap : str
    -

    The matplotlib colormap to use for the plotted color bar. Default is gray.

    +

    The matplotlib colormap to use for the plotted color bar. Default is gray, unless +mosaic was created with spectrograph data, in which case defaults to the colormap +used for spectrograph data..

    Commonly used colormaps are:

    • REGO: gist_heat
    • @@ -1759,7 +1848,7 @@

      Returns

    class MosaicData -(site_uid_list: List[str],
    timestamps: List[datetime.datetime],
    images: Dict[str, numpy.ndarray],
    images_dimensions: Dict[str, Tuple])
    +(site_uid_list: List[str],
    timestamps: List[datetime.datetime],
    images: Dict[str, numpy.ndarray],
    images_dimensions: Dict[str, Tuple],
    data_types: List[str])

    Prepared image data for use by mosaic routines.

    @@ -1774,6 +1863,8 @@

    Attributes

    ndarray is the prepared data.
    images_dimensions : Dict[str, Tuple]
    The image dimensions.
    +
    data_types : List[str]
    +
    The data types for each data object.
    @@ -1793,13 +1884,16 @@

    Attributes

    Image data prepared into the necessary format; a dictionary. Keys are the site UID, ndarray is the prepared data. images_dimensions (Dict[str, Tuple]): - The image dimensions. + The image dimensions. + data_types (List[str]): + The data types for each data object. """ site_uid_list: List[str] timestamps: List[datetime.datetime] images: Dict[str, ndarray] images_dimensions: Dict[str, Tuple] + data_types: List[str] def __str__(self) -> str: return self.__repr__() @@ -1813,6 +1907,10 @@

    Attributes

    Class variables

    +
    var data_types : List[str]
    +
    +
    +
    var images : Dict[str, numpy.ndarray]
    @@ -1991,6 +2089,7 @@

    Class variables

  • pyaurorax.tools.keogram
  • pyaurorax.tools.montage
  • pyaurorax.tools.mosaic
  • +
  • pyaurorax.tools.spectra
  • Functions

    @@ -2019,18 +2118,21 @@

    Mon

  • Mosaic

    -
      +
    • MosaicData

        +
      • data_types
      • images
      • images_dimensions
      • site_uid_list
      • diff --git a/docs/generated/pyaurorax/tools/keogram/index.html b/docs/generated/pyaurorax/tools/keogram/index.html index 76d59141..26aaa29c 100644 --- a/docs/generated/pyaurorax/tools/keogram/index.html +++ b/docs/generated/pyaurorax/tools/keogram/index.html @@ -53,7 +53,7 @@

        Module pyaurorax.tools.keogram

        Functions

        -def create(images: numpy.ndarray, timestamp: List[datetime.datetime], axis: int = 0) ‑> Keogram +def create(images: numpy.ndarray,
        timestamp: List[datetime.datetime],
        axis: int = 0,
        spectra: bool = False,
        wavelength: numpy.ndarray | None = None,
        spect_emission: Literal['green', 'red', 'blue', 'hbeta'] = 'green',
        spect_band: Tuple[float, float] | None = None,
        spect_band_bg: Tuple[float, float] | None = None) ‑> Keogram

        Create a keogram from a set of images.

        @@ -69,6 +69,20 @@

        Args

        axis : int
        The axis to extract the keogram slice from. Default is 0, meaning the rows (or Y) axis.
        +

        spectra (bool): +Make a keogram out of spectrograph data, for a specific emission. Defaults to False (ASI data).

        +

        wavelength (numpy.ndarray): +The wavelength array corresponding to spectrograph data. If spectra=True, this parameter +must be supplied.

        +

        spect_emission (str): +The emission (green, red, blue, hbeta) to prepare from spectrograph data. Default is +'green' (557.7 nm emission).

        +

        spect_band (Tuple[float]): +Manual selection of the wavelength region to integrate for obtaining emissions. Use this +to prepare emissions that are not available in spect_emission.

        +

        spect_band_bg (Tuple[float]): +Manual selection of the wavelength region to subtract from integration for manually +chosen emissions, via the spect_band argument.

        Returns

        A Keogram object.

        Raises

        diff --git a/docs/generated/pyaurorax/tools/mosaic/index.html b/docs/generated/pyaurorax/tools/mosaic/index.html index bf85e6aa..812006e2 100644 --- a/docs/generated/pyaurorax/tools/mosaic/index.html +++ b/docs/generated/pyaurorax/tools/mosaic/index.html @@ -53,7 +53,7 @@

        Module pyaurorax.tools.mosaic

        Functions

        -def create(prepped_data: MosaicData | List[MosaicData],
        prepped_skymap: MosaicSkymap | List[MosaicSkymap],
        timestamp: datetime.datetime,
        cartopy_projection: cartopy.crs.Projection,
        min_elevation: int | List[int] = 5,
        colormap: str | List[str] | None = None,
        image_intensity_scales: List | Dict | None = None) ‑> Mosaic
        +def create(prepped_data: MosaicData | List[MosaicData],
        prepped_skymap: MosaicSkymap | List[MosaicSkymap],
        timestamp: datetime.datetime,
        cartopy_projection: cartopy.crs.Projection,
        min_elevation: int | List[int] = 5,
        colormap: str | List[str] | None = None,
        spect_colormap: str | List[str] | None = None,
        image_intensity_scales: List | Dict | None = None,
        spect_intensity_scales: Tuple[int, int] | None = None) ‑> Mosaic

        Create a mosaic object.

        @@ -70,7 +70,7 @@

        Args

        The cartopy projection to use when creating the mosaic.
        min_elevation : int
        The minimum elevation cutoff when projecting images on the map, in degrees. Default is 5.
        -
        cbar_colorcmap : str
        +
        colormap : str

        The matplotlib colormap to use for the rendered image data. Default is gray.

        Commonly used colormaps are:

        @@ -84,6 +84,11 @@

        Args

        A list of all available colormaps can be found on the matplotlib documentation.

        +
        +

        spect_cmap (str): +The matplotlib colormap to use for the colorbar if working with spectrograph +data. Default is gnuplot.

        +
        image_intensity_scaled : List or Dict

        Ranges for scaling images. Either a a list with 2 elements which will scale all sites with @@ -93,6 +98,8 @@

        Args

        Example of scaling each site differently: image_intensity_scales = {"fsmi": [1000, 10000], "gill": [2000, 8000]}

        +
        spect_intensity_scaled : Tuple[int]
        +
        Min and max values, in Rayleighs, to scale ALL spectrograph data.

        Returns

        The generated Mosaic object.

        @@ -103,7 +110,7 @@

        Raises

  • -def prep_images(image_list: List[pyucalgarysrs.data.classes.Data],
    data_attribute: Literal['data', 'calibrated_data'] = 'data') ‑> MosaicData
    +def prep_images(image_list: List[pyucalgarysrs.data.classes.Data],
    data_attribute: Literal['data', 'calibrated_data'] = 'data',
    spect_emission: Literal['green', 'red', 'blue', 'hbeta'] = 'green',
    spect_band: Tuple[float, float] | None = None,
    spect_band_bg: Tuple[float, float] | None = None) ‑> MosaicData

    Prepare the image data for use in a mosaic.

    @@ -115,12 +122,21 @@

    Args

    The data attribute to use when prepping the images. Either data or calibrated_data. Default is data.
    +

    spect_emission (str): +The emission (green, red, blue, hbeta) to prepare from spectrograph data. Default is +'green' (557.7 nm emission).

    +

    spect_band (Tuple[float]): +Manual selection of the wavelength region to integrate for obtaining emissions. Use this +to prepare emissions that are not available in spect_emission.

    +

    spect_band_bg (Tuple[float]): +Manual selection of the wavelength region to subtract from integration for manually +chosen emissions, via the spect_band argument.

    Returns

    The prepared data, as a MosaicData object.

    Raises

    ValueError
    -
    issues encountered with supplied paramters.
    +
    issues encountered with supplied parameters.
    diff --git a/docs/generated/pyaurorax/tools/spectra/index.html b/docs/generated/pyaurorax/tools/spectra/index.html new file mode 100644 index 00000000..675abd24 --- /dev/null +++ b/docs/generated/pyaurorax/tools/spectra/index.html @@ -0,0 +1,192 @@ + + + + + + +pyaurorax.tools.spectra API documentation + + + + + + + + + + + + +
    +
    +
    +

    Module pyaurorax.tools.spectra

    +
    +
    +

    Work with spectrograph data.

    +
    +
    +
    +
    +
    +
    +

    Functions

    +
    +
    +def plot(spect_data: pyucalgarysrs.data.classes.Data,
    timestamp: datetime.datetime | List[datetime.datetime],
    spect_loc: int | List[int],
    title: str | None = None,
    figsize: Tuple[int, int] | None = None,
    color: str | None = None,
    ylog: bool = False,
    xlabel: str = 'Wavelength (nm)',
    ylabel: str = 'Intensity (R/nm)',
    ylim: Tuple[int, int] | None = None,
    xlim: Tuple[int, int] | None = None,
    plot_line: float | List[float] | None = None,
    plot_line_color: str | List[str] | None = None,
    returnfig: bool = False,
    savefig: bool = False,
    savefig_filename: str | None = None,
    savefig_quality: int | None = None) ‑> Any
    +
    +
    +

    Generate a plot of one or more spectra from spectrograph data.

    +

    Either display it (default behaviour), save it to disk (using the savefig parameter), or +return the matplotlib plot object for further usage (using the returnfig parameter).

    +

    Args

    +

    spect_data (pyaurorax.data.ucalgary.Data): +The data object containing spectrograph data.

    +

    timestamp (datetime.datetime): +A timestamp or list of timestamps for which to plot spectra from.

    +

    spect_loc (int): +An int or list of ints giving the spectrograph spatial bin indices to plot.

    +
    +
    title : str
    +
    The title to display above the plotted spectra.
    +
    figsize : tuple
    +
    The matplotlib figure size to use when plotting. For example figsize=(14,4).
    +
    +

    color (str): +A string or list of strings giving the matplotlib color names to use for plotting spectra.

    +
    +
    xlabel : str
    +
    The x-axis label to use. Default is Wavelength (nm).
    +
    ylabel : str
    +
    The y-axis label to use. Default is 'Intensity (Rayleighs)'.
    +
    +

    ylim (Tuple[int]): +The min and max values to display on the y-axis, in units of Rayleighs/nm.

    +

    xlim (Tuple[int]): +The min and max values to display on the x-axis, in units of nm.

    +

    plot_line (float): +A float, or list of floats, giving wavelengths at which to plot a vertical line, useful for comparing +to known emission wavelengths (e.g. 557.7).

    +

    plot_line_color (str): +A string or list of strings giving the colors to use for plotting lines specified by 'plot_lines'.

    +
    +
    returnfig : bool
    +
    +

    Instead of displaying the image, return the matplotlib figure object. This allows for further plot +manipulation, for example, adding labels or a title in a different location than the default.

    +

    Remember - if this parameter is supplied, be sure that you close your plot after finishing work +with it. This can be achieved by doing plt.close(fig).

    +

    Note that this method cannot be used in combination with savefig.

    +
    +
    savefig : bool
    +
    Save the displayed image to disk instead of displaying it. The parameter savefig_filename is required if +this parameter is set to True. Defaults to False.
    +
    savefig_filename : str
    +
    Filename to save the image to. Must be specified if the savefig parameter is set to True.
    +
    savefig_quality : int
    +
    Quality level of the saved image. This can be specified if the savefig_filename is a JPG image. If it +is a PNG, quality is ignored. Default quality level for JPGs is matplotlib/Pillow's default of 75%.
    +
    +

    Returns

    +

    The displayed spectra, by default. If savefig is set to True, nothing will be returned. If returnfig is +set to True, the plotting variables (fig, ax) will be returned.

    +

    Raises

    +
    +
    ValueError
    +
    Issues with the y-axis choice.
    +
    +
    +
    +
    +
    +
    +
    + +
    + + +