aftpy


Nameaftpy JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/bibhuraushan/aftpy/
SummaryPython package to read and download AFTmap data.
upload_time2024-02-19 05:12:50
maintainer
docs_urlNone
authorBibhuti Kumar Jha
requires_python
licenseMIT
keywords sun dataloader aft sft
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AFTpy
The Python package enables users to download, visualize, and analyze
AFT HDF (h5) data seamlessly. `AFTPy` offers a comprehensive solution for
analyzing and downloading Advective Flux Transport (AFT) data,
streamlining the process of data downloading in parallel and
also facilitating the conversion of H5 files into the most popular
FITS file format or various other formats with ease.

## Installation
### From PyPI
```shell
pip install aftpy
```

### From source
```shell
git clone git@github.com:bibhuraushan/aftpy.git
cd aftpy
python setup.py install
```

## Discriptions
`aftpy` provides two importent python module named `aftmap` and `aftgetdata`. These modules can be used
to read the single **aftmap file** or load all the files from a given directory.

## aftmap module
`aftmap` modules also provides two python class `AFTmap` and `AFTload`. The `AFTmap` class
provide an interface to read the singale H5 **AFTmap** file and provide you the functions and isntances 
to get the information and plot the data. The other class `AFTload` provides the interface to load 
all the data from a directory and provide the instances and function to know about the loaded data. It also
provides a function to convert all the loaded data in to popular **FITS** file.

### AFTmap Class

### AFTload Class

A class for loading all AFT maps from directory.

#### Attributes

- `path` (str): The path to the directory containing AFT map files.
- `filetype` (str): The file extension of the AFT map files (e.g., "h5").
- `date_fmt` (str): The date format string used to parse timestamps from filenames.
- `filelist` (list): A list of file paths to AFT map files in the specified directory.
- `filenames` (numpy.ndarray): An array of filenames extracted from the filelist.

#### Methods

- `convert_all(convert_to="fits", outpath=".", verbose=True)` Convert all loaded AFT map files to the specified format.
  - `convert_to` (str, optional): The output format to convert the AFT map files to. Defaults to "fits".
  - `outpath` (str, optional): The directory path to save the converted files. Defaults to current directory.
  - `verbose` (bool, optional): Whether to print conversion progress. Defaults to True.

#### Example Usage

```python
import aftpy.aftmap as aft

# Initialize AFTload object
loader = aft.AFTload(path="/path/to/aft/maps", filetype="h5")

# Convert all AFT map files to FITS format to '/path/to/converted/maps'
loader.convert_all(convert_to="fits", outpath="/path/to/converted/maps", verbose=True)
```


## aftgetdata module

### AFTdownlaod Clas
A class for downloading AFT map files from a specified URL.

#### Attributes

- `ncpu` (int): Number of CPU cores to utilize for downloading files. Defaults to `cpu_count() - 1`.
- `dt` (module): Alias for the `datetime` module.
- `root_url` (str): The root URL from where AFT map files will be downloaded. Defaults to "https://data.boulder.swri.edu/lisa/".
- `urls` (list): List of URLs of AFT map files.
- `datafile` (str): File path to store the list of files in CSV format.
- `datalist` (DataFrame): DataFrame containing the list of files and corresponding timestamps.

#### Methods
- `get_list(t0=None, t1=None, dt=1) -> data (DataFrame)`
  - `t0` (datetime.datetime, optional): Start time of the time range. Defaults to None.
  - `t1` (datetime.datetime, optional): End time of the time range. Defaults to None.
  - `dt` (int, optional): Time interval for sampling files within the time range. Defaults to 1.
  - `Returns` data (DataFrame): DataFrame containing the list of files within the specified time range.

- `reload_files(url=None, filetype="h5")` Reload the list of AFT map files from the root URL.
  - `url` (str, optional): The URL to reload the list of files from. Defaults to None.
  - `filetype` (str, optional): The file extension of AFT map files. Defaults to "h5".
  - `Returns`: True if the list of files is successfully reloaded.
- `download(dataframe, rootpath=None, ncpu=None)` Download AFT map files listed in the DataFrame.
  - `dataframe` (DataFrame): DataFrame containing the list of files to download.
  - `rootpath` (str, optional): Root directory path to save the downloaded files. Defaults to None.
  - `ncpu` (int, optional): Number of CPU cores to utilize for downloading files. Defaults to `cpu_count() - 1`.


#### Example Usage

```python
import aftpy.getaftdata as aftget
# Initialize AFTdownload object
downloader = aftget.AFTdownload()

# Reload the list of AFT map files
downloader.reload_files()

# Get the list of AFT map files within a specified time range
file_list = downloader.get_list(t0=dt.datetime(2023, 1, 1), t1=dt.datetime(2023, 1, 7))

# Download AFT map files listed in the DataFrame
downloader.download(file_list)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bibhuraushan/aftpy/",
    "name": "aftpy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Sun,dataloader,AFT,SFT",
    "author": "Bibhuti Kumar Jha",
    "author_email": "bibhuraushan1@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ad/69/7d778676451e0f23d70faa7863101b095c1f7754b34140aad89447cb973d/aftpy-1.1.0.tar.gz",
    "platform": null,
    "description": "# AFTpy\nThe Python package enables users to download, visualize, and analyze\nAFT HDF (h5) data seamlessly. `AFTPy` offers a comprehensive solution for\nanalyzing and downloading Advective Flux Transport (AFT) data,\nstreamlining the process of data downloading in parallel and\nalso facilitating the conversion of H5 files into the most popular\nFITS file format or various other formats with ease.\n\n## Installation\n### From PyPI\n```shell\npip install aftpy\n```\n\n### From source\n```shell\ngit clone git@github.com:bibhuraushan/aftpy.git\ncd aftpy\npython setup.py install\n```\n\n## Discriptions\n`aftpy` provides two importent python module named `aftmap` and `aftgetdata`. These modules can be used\nto read the single **aftmap file** or load all the files from a given directory.\n\n## aftmap module\n`aftmap` modules also provides two python class `AFTmap` and `AFTload`. The `AFTmap` class\nprovide an interface to read the singale H5 **AFTmap** file and provide you the functions and isntances \nto get the information and plot the data. The other class `AFTload` provides the interface to load \nall the data from a directory and provide the instances and function to know about the loaded data. It also\nprovides a function to convert all the loaded data in to popular **FITS** file.\n\n### AFTmap Class\n\n### AFTload Class\n\nA class for loading all AFT maps from directory.\n\n#### Attributes\n\n- `path` (str): The path to the directory containing AFT map files.\n- `filetype` (str): The file extension of the AFT map files (e.g., \"h5\").\n- `date_fmt` (str): The date format string used to parse timestamps from filenames.\n- `filelist` (list): A list of file paths to AFT map files in the specified directory.\n- `filenames` (numpy.ndarray): An array of filenames extracted from the filelist.\n\n#### Methods\n\n- `convert_all(convert_to=\"fits\", outpath=\".\", verbose=True)` Convert all loaded AFT map files to the specified format.\n  - `convert_to` (str, optional): The output format to convert the AFT map files to. Defaults to \"fits\".\n  - `outpath` (str, optional): The directory path to save the converted files. Defaults to current directory.\n  - `verbose` (bool, optional): Whether to print conversion progress. Defaults to True.\n\n#### Example Usage\n\n```python\nimport aftpy.aftmap as aft\n\n# Initialize AFTload object\nloader = aft.AFTload(path=\"/path/to/aft/maps\", filetype=\"h5\")\n\n# Convert all AFT map files to FITS format to '/path/to/converted/maps'\nloader.convert_all(convert_to=\"fits\", outpath=\"/path/to/converted/maps\", verbose=True)\n```\n\n\n## aftgetdata module\n\n### AFTdownlaod Clas\nA class for downloading AFT map files from a specified URL.\n\n#### Attributes\n\n- `ncpu` (int): Number of CPU cores to utilize for downloading files. Defaults to `cpu_count() - 1`.\n- `dt` (module): Alias for the `datetime` module.\n- `root_url` (str): The root URL from where AFT map files will be downloaded. Defaults to \"https://data.boulder.swri.edu/lisa/\".\n- `urls` (list): List of URLs of AFT map files.\n- `datafile` (str): File path to store the list of files in CSV format.\n- `datalist` (DataFrame): DataFrame containing the list of files and corresponding timestamps.\n\n#### Methods\n- `get_list(t0=None, t1=None, dt=1) -> data (DataFrame)`\n  - `t0` (datetime.datetime, optional): Start time of the time range. Defaults to None.\n  - `t1` (datetime.datetime, optional): End time of the time range. Defaults to None.\n  - `dt` (int, optional): Time interval for sampling files within the time range. Defaults to 1.\n  - `Returns` data (DataFrame): DataFrame containing the list of files within the specified time range.\n\n- `reload_files(url=None, filetype=\"h5\")` Reload the list of AFT map files from the root URL.\n  - `url` (str, optional): The URL to reload the list of files from. Defaults to None.\n  - `filetype` (str, optional): The file extension of AFT map files. Defaults to \"h5\".\n  - `Returns`: True if the list of files is successfully reloaded.\n- `download(dataframe, rootpath=None, ncpu=None)` Download AFT map files listed in the DataFrame.\n  - `dataframe` (DataFrame): DataFrame containing the list of files to download.\n  - `rootpath` (str, optional): Root directory path to save the downloaded files. Defaults to None.\n  - `ncpu` (int, optional): Number of CPU cores to utilize for downloading files. Defaults to `cpu_count() - 1`.\n\n\n#### Example Usage\n\n```python\nimport aftpy.getaftdata as aftget\n# Initialize AFTdownload object\ndownloader = aftget.AFTdownload()\n\n# Reload the list of AFT map files\ndownloader.reload_files()\n\n# Get the list of AFT map files within a specified time range\nfile_list = downloader.get_list(t0=dt.datetime(2023, 1, 1), t1=dt.datetime(2023, 1, 7))\n\n# Download AFT map files listed in the DataFrame\ndownloader.download(file_list)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python package to read and download AFTmap data.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/bibhuraushan/aftpy/"
    },
    "split_keywords": [
        "sun",
        "dataloader",
        "aft",
        "sft"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21ac0b50e61eacbacd44256d1e1bb73249836aeb64eedb2b4365a4a4dd665c82",
                "md5": "6c19d20534592ee6ece0bfd94f12e4b8",
                "sha256": "798ce3a0603ca2d5a445f8cc29c1fa86bd6a8aca26b0e5f0d4d5fb360339cfb4"
            },
            "downloads": -1,
            "filename": "aftpy-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6c19d20534592ee6ece0bfd94f12e4b8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 11811,
            "upload_time": "2024-02-19T05:12:48",
            "upload_time_iso_8601": "2024-02-19T05:12:48.363415Z",
            "url": "https://files.pythonhosted.org/packages/21/ac/0b50e61eacbacd44256d1e1bb73249836aeb64eedb2b4365a4a4dd665c82/aftpy-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad697d778676451e0f23d70faa7863101b095c1f7754b34140aad89447cb973d",
                "md5": "b6dc0882a67e1f82a0add290eb4536a1",
                "sha256": "a28770155bf3f1b55d59aee4babdccc9cdcf394d4ba72debfcf07893a184a2a3"
            },
            "downloads": -1,
            "filename": "aftpy-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b6dc0882a67e1f82a0add290eb4536a1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12204,
            "upload_time": "2024-02-19T05:12:50",
            "upload_time_iso_8601": "2024-02-19T05:12:50.045876Z",
            "url": "https://files.pythonhosted.org/packages/ad/69/7d778676451e0f23d70faa7863101b095c1f7754b34140aad89447cb973d/aftpy-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-19 05:12:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bibhuraushan",
    "github_project": "aftpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "aftpy"
}
        
Elapsed time: 0.19512s