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.4.tar.gz (232.2 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.4-py3-none-any.whl (239.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skylab2iai-0.0.4.tar.gz
  • Upload date:
  • Size: 232.2 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.4.tar.gz
Algorithm Hash digest
SHA256 54e0e351ca1bba4c5e9f5ccbbed8cf6a152cd579766090f2b733d0fa9e5f6627
MD5 0253a592f18f2957de3d21dc95f9ba02
BLAKE2b-256 7a1654605997409233851476dc2c6b863ec05415306089ca06d3fac3ed026887

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skylab2iai-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 239.0 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a3b47683e15422fca65b6cd15efca28c2adfd2125c83c636d01630339d145d88
MD5 0eaac3f46de94462ad0f12c1e9c618e1
BLAKE2b-256 b27dee9bb6cb4bd41dc5ef84c457ab2ff8434e3ff76d932000eb55d17d3f39c5

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