Skip to main content

A Python library for accessing and analyzing Skylab mission data

Project description

Skylab2IAI

A Python library for accessing and analyzing Skylab mission data.

Installation

From GitHub (for Google Colab or local use)

!pip install git+https://github.com/tiago-ferrer/skylab2iai.git

For local development

git clone https://github.com/tiago-ferrer/skylab2iai.git
cd skylab2iai
pip install -e .

Usage in Google Colab

# Install the library
!pip install git+https://github.com/tiago-ferrer/skylab2iai.git

# Import the library
from skylab2iai import PlateFrameService

# Create a service instance
service = PlateFrameService()

# Get all plate frames
plate_frames = service.get_plate_frames()
print(plate_frames)

# Get a specific plate frame
plate_frame = service.get_plate_frame("plate_name")
print(plate_frame)

# Get plate frames by plate name
plate_frames_by_plate = service.get_plate_frames_by_plate("plate_name")
print(plate_frames_by_plate)

# Download FITS files
downloaded_files = service.download_fits_plate_frames(
    plate_names=("plate1", "plate2", "plate3"),
    output_dir="./fits_data"  # Optional, defaults to './fits_downloads'
)
print(f"Downloaded {len(downloaded_files)} files:")
for file_path in downloaded_files:
    print(f"  - {file_path}")

Features

  • PlateFrameService: Service layer for managing plate frame data
    • get_plate_frame(plate_frame_name): Retrieve a specific plate frame
    • get_plate_frames(): Retrieve all plate frames
    • get_plate_frames_by_plate(plate_name): Retrieve plate frames for a specific plate
    • download_fits_plate_frames(plate_names, output_dir): Download FITS files for specified plate frames

Requirements

  • Python >= 3.10
  • pandas >= 2.0.0
  • requests >= 2.31.0

Testing

Run the comprehensive test suite:

python test_main.py

Or run a quick verification:

python quick_test.py

Test GitHub installation:

python test_github_install.py

Troubleshooting

Google Colab: "unable to open database file" or "no such table"

If you encounter database errors in Google Colab, try these steps:

  1. Restart the runtime and reinstall:

    # In Google Colab, go to Runtime > Restart runtime
    # Then reinstall the library
    !pip install --force-reinstall git+https://github.com/tiago-ferrer/skylab2iai.git
    
  2. Clear pip cache before installing:

    !pip cache purge
    !pip install git+https://github.com/tiago-ferrer/skylab2iai.git
    
  3. Verify the database is loaded:

    from skylab2iai import PlateFrameService
    service = PlateFrameService()
    plate_frames = service.get_plate_frames()
    print(f"Loaded {len(plate_frames)} plate frames")
    

The library includes a 1.8MB SQLite database with 6408 plate frames. If you see this count, everything is working correctly!

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skylab2iai-0.0.3.tar.gz (231.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skylab2iai-0.0.3-py3-none-any.whl (238.3 kB view details)

Uploaded Python 3

File details

Details for the file skylab2iai-0.0.3.tar.gz.

File metadata

  • Download URL: skylab2iai-0.0.3.tar.gz
  • Upload date:
  • Size: 231.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for skylab2iai-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7cf1e8d10f995040bd002303aad07bdb97dcdecca06b70e357c53704f62c65f5
MD5 5db2394a5ab84b393dd6ec606a6f6b13
BLAKE2b-256 780f4147bd3dee22744c00cccbab0dafbc3b89f7be8a46f55c28adbde7d1bbf4

See more details on using hashes here.

File details

Details for the file skylab2iai-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: skylab2iai-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 238.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for skylab2iai-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f083a2fca69e5fb717a9a3fae0d718aec2a619e47da57e39d614eaadbc2f716f
MD5 f299d9973d763b8f5523ba892992ea3b
BLAKE2b-256 0d261b27029bd0fe21ef6b83ab3e1dbb86dbd84074cb5d84776af11394d365e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page