Skip to content

Ingest CATWISE #629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

kaseyLee123
Copy link

Short description: Include what type of data being ingested and appropriate references.

Link to relevant issue: Closes #614

For data ingests:

  • includes script used for ingest
  • includes modified JSON files
  • Add new tests
  • Update the Versions table

@kaseyLee123 kaseyLee123 self-assigned this Jun 18, 2025
try:
filtered_results = results[(results["ab_flags"] == '00') & (results["cc_flags"] == '0000')][0]
writer.writerow([
filtered_results[0],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include the db source name in the CSV file. I think it's source["source"]

Comment on lines +71 to +73
source_num+=1
print(source_num)
logger.warning("no source match found")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also make a CSV file of the sources with no match.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, add counters. Count how many sources have multiple matches, 1 match, and no match.

Comment on lines +56 to +65
filtered_results[1],
filtered_results[2],
filtered_results[3],
filtered_results[4],
filtered_results[7],
filtered_results[8],
filtered_results[9],
filtered_results[10],
filtered_results[11],
filtered_results[12]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure there's a better way to convert this list into a comma delimited string.

results = Irsa.query_region(coordinates=coord, spatial='Cone', catalog='catwise_2020', radius=0.5 * u.arcmin, columns="source_name,PMRA,sigPMRA,PMDec,sigPMDec,ab_flags,cc_flags,w1mpro,w1sigmpro,w2mpro,w2sigmpro,ra,dec")

try:
filtered_results = results[(results["ab_flags"] == '00') & (results["cc_flags"] == '0000')][0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no particular motivation for picking the first one. If there are multiple matches which pass these flags, you should keep them. Might as well save them to the CSV file. I would save all matches that pass these filters. If there are sources with multiple matches, save them to a DIFFERENT CSV file and we can look at them individually.

sources_table = select(db.Sources)
with db.engine.connect() as conn:
sources = conn.execute(sources_table).mappings().all()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
coord_vector = SkyCoord(ra = sources["ra"], dec = sources["dec"], unit = "deg", frame = "icrs")
results = Irsa.query_region(coordinates=coord_vector, spatial='Cone', catalog='catwise_2020', radius=0.5 * u.arcmin, columns="source_name,PMRA,sigPMRA,PMDec,sigPMDec,ab_flags,cc_flags,w1mpro,w1sigmpro,w2mpro,w2sigmpro,ra,dec")

Comment on lines +45 to +50
for source in sources:
#create skycoord object because one of the parameters for query region for position
coord = SkyCoord(ra = source["ra"], dec = source["dec"], unit = "deg", frame = "icrs")

# generates a list of objects from the catwise2020 catalogs that are within this radius of a certain position/coordinate
results = Irsa.query_region(coordinates=coord, spatial='Cone', catalog='catwise_2020', radius=0.5 * u.arcmin, columns="source_name,PMRA,sigPMRA,PMDec,sigPMDec,ab_flags,cc_flags,w1mpro,w1sigmpro,w2mpro,w2sigmpro,ra,dec")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loop over results instead of sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ingest CATWISE data
2 participants