SBI-16-3D / utils /pull_jwst_csv.py
rithwiks's picture
added csv pull
12f956c
from astroquery.mast.missions import MastMissions
missions = MastMissions(mission='jwst')
"""
Used to pull the list of observations that fit our filter criteria from
online JWST archives. See all filter details in the function call below.
If your API query here times out, you may have to manually search into the UI here, and download as CSV:
https://mast.stsci.edu/search/ui
Use the parameters outlined below when searching.
"""
# Use query_criteria method to use selected form search conditions for making missions_mast search API call
results = missions.query_criteria(select_cols=[
'act_id',
'targname',
'ang_sep',
'apername',
'intarget',
'bkgmeth',
'bkgdtarg',
'bartdelt',
'cal_vcs',
'cal_ver',
'bkglevel',
'bkgsub',
'miri_cccstate',
'cont_id',
'crds_ver',
'crds_ctx',
'fileSetName',
'date_end',
'date_beg',
'targ_dec',
'miri_detmode',
'miri_ditchdirc',
'miri_dithopfr',
'pixfrac',
'effexptm',
'effexptm',
'effinttm',
'intend',
'eng_qual',
'errtype',
'duration',
'exp_type',
'expend',
'is_psf',
'expmid',
'exposure',
'expstart',
'fastaxis',
'fgs_focuspos',
'filter',
'gainfact',
'nirspec_gwa_ytilt',
'nirspec_gwa_xtilt',
'gs_dec',
'gs_udec',
'gdstarid',
'gs_order',
'gs_mag',
'gs_umag',
'gs_dra',
'gs_ura',
'gsendtim',
'gsstrttm',
'nirspec_gwa_pxav',
'nirspec_gwa_pyav',
'nirspec_gwa_tilt',
'nirspec_gwa_xp_v',
'nirspec_gwa_yp_v',
'helidelt',
'hendtime',
'hmidtime',
'hstrtime',
'hga_move',
'origin',
'instrume',
'lamp',
'opmode',
'masterbg',
'miri_coronmsk',
'miri_mirnfrms',
'miri_mirngrps',
'miri_channel',
'miri_pattnpts',
'miri_spat_num',
'miri_spec_num',
'miri_band',
'nirspec_msaconid',
'nirspec_msametfl',
'nirspec_msametid',
'detector',
'nirspec_fxd_slit',
'nircam_smgrdpat',
'obsfolder',
'asntable',
'asnpool',
'nirspec_grating',
'nircam_pupil',
'nwfsest',
'nircam_channel',
'nircam_coronmsk',
'nircam_module',
'niriss_fwcpos',
'niriss_focuspos',
'niriss_pupil',
'niriss_pwcpos',
'nirspec_focuspos',
'nirspec_is_imprt',
'nirspec_spat_num',
'nirspec_spec_num',
'nirspec_nod_type',
'miri_numdsets',
'nsamples',
'noutputs',
'nextend',
'groupgap',
'drpfrms3',
'drpfrms1',
'nframes',
'ngroups',
'nints',
'nirspec_nrs_norm',
'subsize1',
'subsize2',
'niriss_nrimdtpt',
'pridtpts',
'subpxpts',
'nirspec_nrs_ref',
'nrststrt',
'nresets',
'miri_spatnstp',
'miri_specnstp',
'obslabel',
'observtn',
'oss_ver',
'osf_file',
'visitend',
'opticalElements',
'miri_mrsprchn',
'pps_aper',
'seq_id',
'pi_name',
'pxsclrt',
'miri_dithpnts',
'nirspec_dithpnts',
'pcs_mode',
'nircam_fam_la1',
'nircam_fam_la2',
'nircam_fam_la3',
'patt_num',
'datamode',
'nirspec_preimage',
'pwfseet',
'pattsize',
'patttype',
'nircam_pridtype',
'expripar',
'timesys',
'productLevel',
'program',
'category',
'subcat',
'proposal_type',
'obs_id',
'proposal_cycle',
'title',
'prop_dec',
'prop_ra',
'nircam_pilin',
'targ_ra',
'readpatt',
'nirspec_rma_pos',
'nirspec_fcsrlpos',
'publicReleaseDate',
'nircam_fa1value',
'nircam_faphase1',
'nircam_fastep1',
'nircam_faunit1',
'nircam_fa2value',
'nircam_faphase2',
'nircam_fastep2',
'nircam_faunit2',
'nircam_fa3value',
'nircam_faphase3',
'nircam_fastep3',
'nircam_faunit3',
'expcount',
'prd_ver',
'scicat',
'dataprob',
'segmfile',
'selfref',
'sca_num',
'exsegnum',
'rois',
'roiw',
'miri_spatstep',
'miri_specstep',
'slowaxis',
'scatfile',
'engqlptg',
'sctarate',
'miri_sptoffst',
'exp_only',
'miri_spcoffst',
'date_obs',
'miri_dsetstrt',
'intstart',
'substrt1',
'substrt2',
'miri_pattstrt',
'nirspec_pattstrt',
'nirspec_msastate',
'access',
'visitsta',
'subarray',
'nircam_subpxpat',
'nirspec_subpxpat',
'targcat',
'targudec',
'targdesc',
'targprop',
'mu_epoch',
'mu_dec',
'mu_ra',
'targura',
'targtype',
'bstrtime',
'bendtime',
'bmidtime',
'telescop',
'template',
'miri_cmd_tsel',
'tframe',
'tgroup',
'tsample',
'tsovisit',
'texptime',
'texptime',
'nexposur',
'numdthpt',
'exsegtot',
'tcatfile',
'datamodl',
'date',
'expsteng',
'gsendtim',
'gsstrttm',
'vststart',
'gs_v3_pa',
'frmdivsr',
'va_dec',
'va_ra',
'visitgrp',
'visid_id',
'visit',
'targoopp',
'visitype',
'wpower',
'wtype',
'dirimage',
'xoffset',
'yoffset',
'zerofram'], exp_type='NRC_IMAGE',
instrume='NIRCAM',
opticalElements='*F200W;CLEAR*',
productLevel='*1b*',
targtype='FIXED',
visitsta='SUCCESSFUL',
access='PUBLIC',
effinttm='>30')
df = results.to_pandas()
print(len(df))
df.to_csv('jwst_FINAL.csv')