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.2.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.2-py3-none-any.whl (238.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skylab2iai-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 bdda898f08f55b4a201c10b25caec5ca0351cfa24ef717b89274614d00bddc7c
MD5 10fe0a24776024593fdd7bd55c96f57c
BLAKE2b-256 dbe905caf735bb106d29caec87e5732a5caf6b45afbf1422249fcc82bae58168

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skylab2iai-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 238.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 92f6f29b25195da75105222d552a07fb3f84ee8249bfdcce92551a12ae962a53
MD5 6faae2d21b80c06910ed9e09ff45817f
BLAKE2b-256 bf7def9c1621e569883a6b43a90e687996570ce9728c9fbfac8ed4471458ec27

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