Skip to content

Commit

Permalink
basic background model
Browse files Browse the repository at this point in the history
  • Loading branch information
guynir42 committed Jun 10, 2024
1 parent 3e2ae69 commit 6b900b8
Show file tree
Hide file tree
Showing 12 changed files with 632 additions and 50 deletions.
74 changes: 74 additions & 0 deletions alembic/versions/2024_06_10_1132-a375526c8260_background_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
"""background table
Revision ID: a375526c8260
Revises: a7dde2327dde
Create Date: 2024-06-10 11:32:39.717922
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'a375526c8260'
down_revision = 'a7dde2327dde'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('backgrounds',
sa.Column('_format', sa.SMALLINT(), nullable=False),
sa.Column('_method', sa.SMALLINT(), nullable=False),
sa.Column('image_id', sa.BigInteger(), nullable=False),
sa.Column('value', sa.Float(), nullable=False),
sa.Column('noise', sa.Float(), nullable=False),
sa.Column('provenance_id', sa.String(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('modified', sa.DateTime(), nullable=False),
sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False),
sa.Column('filepath_extensions', postgresql.ARRAY(sa.Text(), zero_indexes=True), nullable=True),
sa.Column('md5sum', sa.UUID(), nullable=True),
sa.Column('md5sum_extensions', postgresql.ARRAY(sa.UUID(), zero_indexes=True), nullable=True),
sa.Column('filepath', sa.Text(), nullable=False),
sa.Column('_bitflag', sa.BIGINT(), nullable=False),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('_upstream_bitflag', sa.BIGINT(), nullable=False),
sa.ForeignKeyConstraint(['image_id'], ['images.id'], name='psfs_image_id_fkey', ondelete='CASCADE'),
sa.ForeignKeyConstraint(['provenance_id'], ['provenances.id'], name='backgrounds_provenance_id_fkey', ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_index('backgrounds_image_id_provenance_index', 'backgrounds', ['image_id', 'provenance_id'], unique=True)
op.create_index(op.f('ix_backgrounds__bitflag'), 'backgrounds', ['_bitflag'], unique=False)
op.create_index(op.f('ix_backgrounds__upstream_bitflag'), 'backgrounds', ['_upstream_bitflag'], unique=False)
op.create_index(op.f('ix_backgrounds_created_at'), 'backgrounds', ['created_at'], unique=False)
op.create_index(op.f('ix_backgrounds_filepath'), 'backgrounds', ['filepath'], unique=True)
op.create_index(op.f('ix_backgrounds_id'), 'backgrounds', ['id'], unique=False)
op.create_index(op.f('ix_backgrounds_image_id'), 'backgrounds', ['image_id'], unique=False)
op.create_index(op.f('ix_backgrounds_noise'), 'backgrounds', ['noise'], unique=False)
op.create_index(op.f('ix_backgrounds_provenance_id'), 'backgrounds', ['provenance_id'], unique=False)
op.create_index(op.f('ix_backgrounds_value'), 'backgrounds', ['value'], unique=False)
op.add_column('source_lists', sa.Column('inf_aper_num', sa.SMALLINT(), nullable=True))
op.add_column('source_lists', sa.Column('best_aper_num', sa.SMALLINT(), nullable=True))
op.drop_column('source_lists', '_inf_aper_num')
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('source_lists', sa.Column('_inf_aper_num', sa.SMALLINT(), autoincrement=False, nullable=True))
op.drop_column('source_lists', 'best_aper_num')
op.drop_column('source_lists', 'inf_aper_num')
op.drop_index(op.f('ix_backgrounds_value'), table_name='backgrounds')
op.drop_index(op.f('ix_backgrounds_provenance_id'), table_name='backgrounds')
op.drop_index(op.f('ix_backgrounds_noise'), table_name='backgrounds')
op.drop_index(op.f('ix_backgrounds_image_id'), table_name='backgrounds')
op.drop_index(op.f('ix_backgrounds_id'), table_name='backgrounds')
op.drop_index(op.f('ix_backgrounds_filepath'), table_name='backgrounds')
op.drop_index(op.f('ix_backgrounds_created_at'), table_name='backgrounds')
op.drop_index(op.f('ix_backgrounds__upstream_bitflag'), table_name='backgrounds')
op.drop_index(op.f('ix_backgrounds__bitflag'), table_name='backgrounds')
op.drop_index('backgrounds_image_id_provenance_index', table_name='backgrounds')
op.drop_table('backgrounds')
# ### end Alembic commands ###
11 changes: 10 additions & 1 deletion default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,18 @@ preprocessing:

extraction:
sources:
method: sextractor
measure_psf: true
background_format: map
background_order: 1
background_method: sep
apertures: [1.0, 2.0, 3.0, 5.0]
inf_aper_num: -1
best_aper_num: 0
aperunit: fwhm
separation_fwhm: 1.0
threshold: 3.0
method: sextractor
subtraction: false

wcs:
cross_match_catalog: gaia_dr3
Expand Down
Loading

0 comments on commit 6b900b8

Please sign in to comment.