{"id":47234948,"url":"https://github.com/simonsobs/mapcat","last_synced_at":"2026-05-05T22:01:23.979Z","repository":{"id":320569050,"uuid":"1080704136","full_name":"simonsobs/mapcat","owner":"simonsobs","description":"Map catalog databases","archived":false,"fork":false,"pushed_at":"2026-04-28T17:25:20.000Z","size":162,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-28T17:26:39.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonsobs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-21T18:43:31.000Z","updated_at":"2026-04-28T16:58:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"674ba2ab-6e5d-4e33-8fb2-29cd43910cc9","html_url":"https://github.com/simonsobs/mapcat","commit_stats":null,"previous_names":["simonsobs/mapcat"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/simonsobs/mapcat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Fmapcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Fmapcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Fmapcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Fmapcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonsobs","download_url":"https://codeload.github.com/simonsobs/mapcat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Fmapcat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32669433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-13T22:05:14.613Z","updated_at":"2026-05-05T22:01:23.971Z","avatar_url":"https://github.com/simonsobs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simons Observatory Map Catalog\n==============================\n\nThe Depth-1 and Atomic map catalog for the Simons Observatory.\nThis repository contains the SQLModel (SQLAlchemy + Pydantic)\ntypes, a client interface, and alembic migration tool for the\ndatabase.\n\nConfiguration\n-------------\n\n`mapcat` is set up to use either PostgreSQL (production) and\nSQLite (testing). It can be configured using the `pydantic-settings`\ninterface defined in `mapcat/helper.py`, with environment variables\nusing the prefix `MAPCAT_`.\n\n- `export MAPCAT_DATABASE_NAME=mapcat.db`: for SQLite it should be the path to the map\n  catalog file;  If using PostgreSQL, this should be your connection string in the form\n  `\u003cusername\u003e:\u003cpassword\u003e@\u003cserver_ip\u003e:\u003cserver_port\u003e/\u003cdbname\u003e`. Please do not include\n  `postgresql://` at the beginning of this variable.\n- `export MAPCAT_DATABASE_TYPE=sqlite`: Or `postgresql` if using PostgreSQL.\n- `export MAPCAT_DEPTH_ONE_PARENT=\".\"`: Parent directory containing the\n  Depth-1 maps referred to by the database on this machine.\n- `export MAPCAT_ATOMIC_PARENT=\".\"`: Parent directory containing the\n  Atomic maps referenced by the database on this machine.\n- `export MAPCAT_{DEPTH_ONE,ATOMIC}_COADD_PARENT=\".\"`.\n\nSetting up\n----------\n\nMapcat can be installed like any other python package, using your\npreferred package manager. We recommend using `uv`:\n```\nuv pip install mapcat\n```\n\n### Creating or Migrating the Database\n\nThe database can be migrated (or created, if starting fresh) by using\nthe:\n```\nmapcatmigrate\n```\ncommand. This runs `alembic upgrade head` with the version of the database\nreferred to by your currently installed verison of the map catalog.\nThe database is created in the file or postgres cluster defined in the\nconfiguration above.\n\nCommand-line Tools\n------------------\n\nWe provide a command-line tool for automatically ingesting a directory\nof Depth-1 maps stored in the same format as ACT into the database.\nNote that the `_info.hdf` files are required, and that these\nare not entirely metadata-complete. The command-line script is:\n```\nactingest --relative-to=/path/to/maps --glob=*/*_map.fits --telescope=act\n```\nMore information on the parameters is available through `actingest -h`.\n\nRegistering new Maps\n--------------------\n\nNew maps can easily be added to the catalog through the SQLAlchemy interface.\nIt is also wise to include the TOD information used for creating the map,\nso that we can later track individual TODs' contributions to various maps.\nNote that there does not need to be a one-to-one relationship between\nmaps and TODs.\n```python3\nfrom mapcat.helper import settings\nfrom mapcat.database import DepthOneMapTable, TODDepthOneTable\n\nwith settings.session() as session:\n  tods = [\n    TODDepthOneTable(\n      obs_id=\"obs_...\",\n      pwv=2.3,\n      ...\n    ),\n    ...\n  ]\n  \n  map = DepthOneMapTable(\n    map_name=\"15722/depth1_157221244_lati1_f090\",\n    map_path=\"15722/depth1_157221244_lati1_f090_map.fits\",\n    ivar_path=\"15722/depth1_157221244_lati1_f090_ivar.fits\",\n    time_path=\"15722/depth1_157221244_lati1_f090_time.fits\",\n    tube_slot=\"i1\",\n    frequency=\"090\",\n    ctime=157221244.0,\n    start_time=157220244.0,\n    stop_time=157222423.0,\n    tods=tods,\n  )\n\n  session.add(map)\n  session.commit()\n```\nBy referencing the TOD objects, you automatically create the required\nlink table items.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsobs%2Fmapcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonsobs%2Fmapcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsobs%2Fmapcat/lists"}