Communitygithub.com

Anhvu1107/all-agent-skill

요청이 Astropy와 일치할 때 항상 사용하세요: Astropy는 천문학 연구와 데이터 분석을 위한 핵심 Python 패키지입니다.

all-agent-skill란 무엇인가요?

이 스킬은 AI 에이전트(예: Claude Code, Cursor, Codex)가 천문학 관련 Python 작업을 수행할 때 Astropy 라이브러리를 올바르게 활용하도록 안내합니다. Astropy는 좌표 변환, 단위 및 물리량 계산, FITS 파일 처리, 우주론 계산, 정밀 시간 처리, 테이블 데이터 조작, 천문 이미지 처리 등 천문학 연구에 필수적인 기능을 제공합니다. 이 스킬은 선택적 읽기 규칙을 통해 사용자 작업과 관련된 문서만 로드하여 효율성을 높이며, `references/` 디렉토리의 상세 문서를 참조하여 각 모듈의 전체 기능을 숙지하도록 돕습니다. 주요 사용 사례로는 천체 좌표계 간 변환, FITS 파일 읽기/쓰기, 우주론적 거리 계산, 카탈로그 교차 매칭 등이 포함되며, 베스트 프랙티스와 제한 사항도 함께 제시하여 환경에 구애받지 않고 안전하게 사용할 수 있도록 합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Anhvu1107/all-agent-skill/tree/HEAD/.agent/skills/astropy

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Astropy

선택적 읽기 규칙

다음부터 시작하세요:

  • references/senior-master-standard.md
  • references/usage-routing.md
  • references/quality-checklist.md

그런 다음, 사용자의 실제 작업과 일치하는 상속된 문서, 스크립트, 에셋 또는 예제만 로드하세요.

개요

Astropy는 천문학 연구와 데이터 분석을 위한 핵심 Python 패키지로, 천문학 연구 및 데이터 분석에 필수적인 기능을 제공합니다. 좌표 변환, 단위 및 물리량 계산, FITS 파일 작업, 우주론 계산, 정밀 시간 처리, 테이블 데이터 조작, 천문 이미지 처리 등에 Astropy를 사용하세요.

이 스킬을 사용해야 하는 경우

다음과 같은 작업이 포함될 때 Astropy를 사용하세요:

  • 천체 좌표계(ICRS, Galactic, FK5, AltAz 등) 간 변환
  • 물리 단위 및 물리량 작업(Jy를 mJy로, 파섹을 km로 변환 등)
  • FITS 파일(이미지 또는 테이블) 읽기, 쓰기 또는 조작
  • 우주론 계산(광도 거리, 룩백 시간, 허블 매개변수)
  • 다양한 시간 척도(UTC, TAI, TT, TDB)와 형식(JD, MJD, ISO)을 사용한 정밀 시간 처리
  • 테이블 작업(카탈로그 읽기, 교차 매칭, 필터링, 조인)
  • 픽셀 좌표와 세계 좌표 간 WCS 변환
  • 천문 상수 및 계산

빠른 시작

import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.time import Time
from astropy.io import fits
from astropy.table import Table
from astropy.cosmology import Planck18

# 단위 및 물리량
distance = 100 * u.pc
distance_km = distance.to(u.km)

# 좌표
coord = SkyCoord(ra=10.5*u.degree, dec=41.2*u.degree, frame='icrs')
coord_galactic = coord.galactic

# 시간
t = Time('2023-01-15 12:30:00')
jd = t.jd  # 율리우스일

# FITS 파일
data = fits.getdata('image.fits')
header = fits.getheader('image.fits')

# 테이블
table = Table.read('catalog.fits')

# 우주론
d_L = Planck18.luminosity_distance(z=1.0)

핵심 기능

1. 단위 및 물리량 (astropy.units)

물리량을 단위와 함께 처리하고, 단위 변환을 수행하며, 계산에서 차원 일관성을 보장합니다.

주요 작업:

  • 값에 단위를 곱하여 물리량 생성
  • .to() 메서드를 사용하여 단위 간 변환
  • 자동 단위 처리를 통한 산술 연산 수행
  • 도메인별 변환(분광, 도플러, 시차)에 등가성 사용
  • 로그 단위(등급, 데시벨) 작업

참고: references/units.md에서 종합 문서, 단위 시스템, 등가성, 성능 최적화 및 단위 산술을 확인하세요.

2. 좌표계 (astropy.coordinates)

천체 위치를 표현하고 서로 다른 좌표 프레임 간 변환합니다.

주요 작업:

  • 모든 프레임(ICRS, Galactic, FK5, AltAz 등)에서 SkyCoord로 좌표 생성
  • 좌표계 간 변환
  • 각도 분리 및 위치 각도 계산
  • 카탈로그에 좌표 매칭
  • 3D 좌표 작업을 위한 거리 포함
  • 고유 운동 및 시선 속도 처리
  • 온라인 데이터베이스에서 명명된 객체 쿼리

참고: references/coordinates.md에서 상세 좌표 프레임 설명, 변환, 관측자 의존 프레임(AltAz), 카탈로그 매칭 및 성능 팁을 확인하세요.

3. 우주론 계산 (astropy.cosmology)

표준 우주론 모델을 사용하여 우주론 계산을 수행합니다.

주요 작업:

  • 내장 우주론 사용(Planck18, WMAP9 등)
  • 사용자 정의 우주론 모델 생성
  • 거리 계산(광도, 공변, 각지름)
  • 나이 및 룩백 시간 계산
  • 임의 적색편이에서 허블 매개변수 결정
  • 밀도 매개변수 및 부피 계산
  • 역 계산 수행(주어진 거리에 대한 z 찾기)

참고: references/cosmology.md에서 사용 가능한 모델, 거리 계산, 시간 계산, 밀도 매개변수 및 중성미자 효과를 확인하세요.

4. FITS 파일 처리 (astropy.io.fits)

FITS(Flexible Image Transport System) 파일을 읽고, 쓰고, 조작합니다.

주요 작업:

  • 컨텍스트 관리자로 FITS 파일 열기
  • 인덱스 또는 이름으로 HDU(Header Data Unit) 접근
  • 헤더 읽기 및 수정(키워드, 주석, 히스토리)
  • 이미지 데이터(NumPy 배열) 작업
  • 테이블 데이터(이진 및 ASCII 테이블) 처리
  • 새 FITS 파일 생성(단일 또는 다중 확장자)
  • 대용량 파일을 위한 메모리 매핑 사용
  • 원격 FITS 파일 접근(S3, HTTP)

참고: references/fits.md에서 종합 파일 작업, 헤더 조작, 이미지 및 테이블 처리, 다중 확장자 파일 및 성능 고려 사항을 확인하세요.

5. 테이블 작업 (astropy.table)

단위, 메타데이터 및 다양한 파일 형식을 지원하는 테이블 형식 데이터를 작업합니다.

주요 작업:

  • 배열, 리스트 또는 딕셔너리에서 테이블 생성
  • 여러 형식(FITS, CSV, HDF5, VOTable)으로 테이블 읽기/쓰기
  • 열과 행 접근 및 수정
  • 테이블 정렬, 필터링 및 인덱싱
  • 데이터베이스 스타일 작업 수행(조인, 그룹, 집계)
  • 테이블 쌓기 및 연결
  • 단위 인식 열 작업(QTable)
  • 마스킹으로 누락된 데이터 처리

참고: references/tables.md에서 테이블 생성, I/O 작업, 데이터 조작, 정렬, 필터링, 조인, 그룹화 및 성능 팁을 확인하세요.

6. 시간 처리 (astropy.time)

정밀한 시간 표현과 시간 척도 및 형식 간 변환을 제공합니다.

주요 작업:

  • 다양한 형식(ISO, JD, MJD, Unix 등)으로 Time 객체 생성
  • 시간 척도 간 변환(UTC, TAI, TT, TDB 등)
  • TimeDelta로 시간 산술 연산 수행
  • 관측자를 위한 항성시 계산
  • 빛 이동 시간 보정 계산(질량 중심, 태양 중심)
  • 시간 배열 효율적으로 작업
  • 마스킹된(누락된) 시간 처리

참고: references/time.md에서 시간 형식, 시간 척도, 변환, 산술, 관측 기능 및 정밀도 처리를 확인하세요.

7. 세계 좌표계 (astropy.wcs)

이미지의 픽셀 좌표와 세계 좌표 간 변환을 수행합니다.

주요 작업:

  • FITS 헤더에서 WCS 읽기
  • 픽셀 좌표를 세계 좌표로 변환(및 그 반대)
  • 이미지 풋프린트 계산
  • WCS 매개변수 접근(기준 픽셀, 투영, 축척)
  • 사용자 정의 WCS 객체 생성

참고: references/wcs_and_other_modules.md에서 WCS 작업 및 변환을 확인하세요.

추가 기능

references/wcs_and_other_modules.md 파일은 다음 내용도 다룹니다:

NDData 및 CCDData

메타데이터, 불확실성, 마스킹 및 WCS 정보가 포함된 n차원 데이터셋을 위한 컨테이너입니다.

모델링

천문 데이터에 수학적 모델을 생성하고 적합시키기 위한 프레임워크입니다.

시각화

적절한 스트레칭 및 스케일링으로 천문 이미지를 표시하기 위한 도구입니다.

상수

적절한 단위를 가진 물리 및 천문 상수(광속, 태양 질량, 플랑크 상수 등)입니다.

컨볼루션

평활화 및 필터링을 위한 이미지 처리 커널입니다.

통계

시그마 클리핑 및 이상치 제거를 포함한 강건한 통계 함수입니다.

설치

# Astropy 설치
uv pip install astropy

# 전체 기능을 위한 선택적 종속성 포함
uv pip install astropy[all]

일반적인 워크플로우

좌표계 간 변환

from astropy.coordinates import SkyCoord
import astropy.units as u

# 좌표 생성
c = SkyCoord(ra='05h23m34.5s', dec='-69d45m22s', frame='icrs')

# 은하 좌표로 변환
c_gal = c.galactic
print(f"l={c_gal.l.deg}, b={c_gal.b.deg}")

# 고도-방위각 좌표로 변환 (시간과 위치 필요)
from astropy.time import Time
from astropy.coordinates import EarthLocation, AltAz

observing_time = Time('2023-06-15 23:00:00')
observing_location = EarthLocation(lat=40*u.deg, lon=-120*u.deg)
aa_frame = AltAz(obstime=observing_time, location=observing_location)
c_altaz = c.transform_to(aa_frame)
print(f"Alt={c_altaz.alt.deg}, Az={c_altaz.az.deg}")

FITS 파일 읽기 및 분석

from astropy.io import fits
import numpy as np

# FITS 파일 열기
with fits.open('observation.fits') as hdul:
    # 구조 표시
    hdul.info()

    # 이미지 데이터 및 헤더 가져오기
    data = hdul[1].data
    header = hdul[1].header

    # 헤더 값 접근
    exptime = header['EXPTIME']
    filter_name = header['FILTER']

    # 데이터 분석
    mean = np.mean(data)
    median = np.median(data)
    print(f"Mean: {mean}, Median: {median}")

우주론적 거리 계산

from astropy.cosmology import Planck18
import astropy.units as u
import numpy as np

# z=1.5에서 거리 계산
z = 1.5
d_L = Planck18.luminosity_distance(z)
d_A = Planck18.angular_diameter_distance(z)

print(f"광도 거리: {d_L}")
print(f"각지름 거리: {d_A}")

# 해당 적색편이에서 우주 나이
age = Planck18.age(z)
print(f"z={z}에서 나이: {age.to(u.Gyr)}")

# 룩백 시간
t_lookback = Planck18.lookback_time(z)
print(f"룩백 시간: {t_lookback.to(u.Gyr)}")

카탈로그 교차 매칭

from astropy.table import Table
from astropy.coordinates import SkyCoord, match_coordinates_sky
import astropy.units as u

# 카탈로그 읽기
cat1 = Table.read('catalog1.fits')
cat2 = Table.read('catalog2.fits')

# 좌표 객체 생성
coords1 = SkyCoord(ra=cat1['RA']*u.degree, dec=cat1['DEC']*u.degree)
coords2 = SkyCoord(ra=cat2['RA']*u.degree, dec=cat2['DEC']*u.degree)

# 일치 항목 찾기
idx, sep, _ = coords1.match_to_catalog_sky(coords2)

# 분리 임계값으로 필터링
max_sep = 1 * u.arcsec
matches = sep < max_sep

# 일치된 카탈로그 생성
cat1_matched = cat1[matches]
cat2_matched = cat2[idx[matches]]
print(f"{len(cat1_matched)}개의 일치 항목 발견")

모범 사례

  1. 항상 단위 사용: 물리량에 단위를 첨부하여 오류를 방지하고 차원 일관성 보장
  2. FITS 파일에 컨텍스트 관리자 사용: 올바른 파일 닫기 보장
  3. 루프보다 배열 선호: 더 나은 성능을 위해 여러 좌표/시간을 배열로 처리
  4. 좌표 프레임 확인: 변환 전에 프레임 확인
  5. 적절한 우주론 사용: 분석에 맞는 우주론 모델 선택
  6. 누락된 데이터 처리: 누락된 값이 있는 테이블에 마스킹된 열 사용
  7. 시간 척도 지정: 정밀한 시간 측정을 위해 시간 척도(UTC, TT, TDB)를 명시적으로 지정
  8. 단위 인식 테이블에 QTable 사용: 테이블 열에 단위가 있는 경우
  9. WCS 유효성 확인: 변환을 사용하기 전에 WCS 확인
  10. 자주 사용하는 값 캐싱: 비용이 많이 드는 계산(예: 우주론적 거리)은 캐시 가능

문서 및 리소스

참조 파일

특정 모듈에 대한 자세한 내용은 다음을 참조하세요:

  • references/units.md - 단위, 물리량, 변환 및 등가성
  • references/coordinates.md - 좌표계, 변환 및 카탈로그 매칭
  • references/cosmology.md - 우주론 모델 및 계산
  • references/fits.md - FITS 파일 작업 및 조작
  • references/tables.md - 테이블 생성, I/O 및 작업
  • references/time.md - 시간 형식, 척도 및 계산
  • references/wcs_and_other_modules.md - WCS, NDData, 모델링, 시각화, 상수 및 유틸리티

제한 사항

  • 이 스킬은 작업이 위에 설명된 범위와 명확하게 일치하는 경우에만 사용하세요.
  • 출력물을 환경별 검증, 테스트 또는 전문가 검토의 대체물로 취급하지 마세요.
  • 필수 입력, 권한, 안전 경계 또는 성공 기준이 누락된 경우 중단하고 명확히 요청하세요.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches 007: Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Agentfolio: Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Animejs Animation: Advanced JavaScript animation library skill for creating complex, high-performance web animations.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Astro: Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Emotional ARC Designer: One sentence - what this skill does and when to invoke it

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Fixing Motion Performance: Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches I18n Localization: Internationalization and localization patterns.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Interactive Portfolio: Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches JQ: Expert jq usage for JSON querying, filtering, transformation, and pipeline integration.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Landing Page Generator: Generates high-converting Next.js/React landing pages with Tailwind CSS.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches LEX: Centralized ''Truth Engine'' for cross-jurisdictional legal context (US, EU, CA) and contract scaffolding.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Magic Animator: AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Makepad Animation: CRITICAL: Use for Makepad animation system.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Nextjs APP Router Patterns: Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

Anhvu1107/all-agent-skill

ALWAYS use this when the user mentions Nextjs Best Practices, asks to build, debug, review, document, automate, test, configure, migrate, or make decisions in this domain, or the task clearly depends on Nextjs Best Practices; scope: Next.js App Router principles. Apply the bundled workflow, references, scripts, Senior Master standard, and Codex strict review gate before final output.

Anhvu1107/all-agent-skill

description: ALWAYS use this when the work is specifically about modern Next.js or React architecture, data flow, rendering strategy, routing, or performance-sensitive frontend behavior.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Nextjs Supabase Auth: Expert integration of Supabase Auth with Next.js App Router

Anhvu1107/all-agent-skill

ALWAYS use this when the task involves reading, extracting, splitting, merging, rotating, creating, validating, OCR-ing, form-filling, or otherwise producing or modifying PDF files.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches React Nextjs Development: React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

Anhvu1107/all-agent-skill

ALWAYS use this when working with Remotion code, video compositions, rendering logic, timing, media assets, or React-based motion workflows.

관련 스킬