import pandas as pd
"display.max_columns", 1000) pd.set_option(
CTX
get_edr_index
get_edr_index (refresh=False)
False) get_edr_index(
VOLUME_ID | FILE_SPECIFICATION_NAME | ORIGINAL_PRODUCT_ID | PRODUCT_ID | IMAGE_TIME | INSTRUMENT_ID | INSTRUMENT_MODE_ID | LINE_SAMPLES | LINES | SPATIAL_SUMMING | SCALED_PIXEL_WIDTH | PIXEL_ASPECT_RATIO | EMISSION_ANGLE | INCIDENCE_ANGLE | PHASE_ANGLE | CENTER_LONGITUDE | CENTER_LATITUDE | UPPER_LEFT_LONGITUDE | UPPER_LEFT_LATITUDE | UPPER_RIGHT_LONGITUDE | UPPER_RIGHT_LATITUDE | LOWER_LEFT_LONGITUDE | LOWER_LEFT_LATITUDE | LOWER_RIGHT_LONGITUDE | LOWER_RIGHT_LATITUDE | MISSION_PHASE_NAME | TARGET_NAME | SPACECRAFT_CLOCK_START_COUNT | FOCAL_PLANE_TEMPERATURE | LINE_EXPOSURE_DURATION | OFFSET_MODE_ID | SAMPLE_FIRST_PIXEL | SCALED_IMAGE_WIDTH | SCALED_IMAGE_HEIGHT | SPACECRAFT_ALTITUDE | TARGET_CENTER_DISTANCE | SLANT_DISTANCE | USAGE_NOTE | NORTH_AZIMUTH | SUB_SOLAR_AZIMUTH | SUB_SOLAR_LONGITUDE | SUB_SOLAR_LATITUDE | SUB_SPACECRAFT_LONGITUDE | SUB_SPACECRAFT_LATITUDE | SOLAR_DISTANCE | SOLAR_LONGITUDE | LOCAL_TIME | IMAGE_SKEW_ANGLE | RATIONALE_DESC | DATA_QUALITY_DESC | ORBIT_NUMBER | short_pid | month_col | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | MROX_0001 | DATA/CRU_000001_9999_XN_99N999W.IMG | 4A_04_0001000400 | CRU_000001_9999_XN_99N999W | 2005-08-30 15:40:21.549 | CTX | NIFL | 5056 | 1024 | 1 | 0.0 | 0.0 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | CRUISE | SPACE | 0809883639:076 | 283.3 | 10.0 | 194/53/53 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | N | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 278.89 | 10.16 | 0.0 | Instrument checkout image of space | OK | -4242 | CRU_000001_9999 | CRU |
1 | MROX_0001 | DATA/CRU_000002_9999_XN_99N999W.IMG | 4A_04_0001000500 | CRU_000002_9999_XN_99N999W | 2005-09-08 15:59:45.313 | CTX | NIFL | 5056 | 15360 | 1 | 0.0 | 0.0 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | CRUISE | MOON | 0810662403:012 | 296.0 | 5.71 | 196/243/238 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | N | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 284.48 | 4.6 | 0.0 | Calibration image of the Moon | OK | -4126 | CRU_000002_9999 | CRU |
2 | MROX_0001 | DATA/CRU_000003_9999_XN_99N999W.IMG | 4A_04_0001000600 | CRU_000003_9999_XN_99N999W | 2005-09-08 16:03:37.927 | CTX | NIFL | 5056 | 2048 | 1 | 0.0 | 0.0 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | CRUISE | STAR | 0810662635:169 | 296.6 | 22.9 | 196/243/238 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | N | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 284.48 | 4.66 | 0.0 | Calibration image of Omega Centauri (globular ... | OK | -4126 | CRU_000003_9999 | CRU |
3 | MROX_0001 | DATA/CRU_000004_9999_XN_99N999W.IMG | 4A_04_0001000700 | CRU_000004_9999_XN_99N999W | 2005-09-08 16:08:23.841 | CTX | NIFL | 5056 | 2048 | 1 | 0.0 | 0.0 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | CRUISE | STAR | 0810662921:147 | 296.8 | 22.9 | 196/243/238 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | N | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 284.48 | 4.74 | 0.0 | Calibration image of Omega Centauri (globular ... | OK | -4126 | CRU_000004_9999 | CRU |
4 | MROX_0001 | DATA/CRU_000005_9999_XN_99N999W.IMG | 4A_04_0001000800 | CRU_000005_9999_XN_99N999W | 2005-09-08 16:11:18.649 | CTX | NIFL | 5056 | 21504 | 1 | 0.0 | 0.0 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | 999.9 | CRUISE | MOON | 0810663096:098 | 297.1 | 5.71 | 196/243/238 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | N | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 284.48 | 4.79 | 0.0 | Calibration image of the Moon | OK | -4126 | CRU_000005_9999 | CRU |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
142363 | MROX_4656 | DATA/U17_077781_1107_XI_69S045W.IMG | 4A_04_118B04B300 | U17_077781_1107_XI_69S045W | 2023-03-01 00:01:37.834 | CTX | ITL | 5056 | 7168 | 1 | 5.06 | 1.19 | 4.96 | 89.4 | 86.17 | 45.21 | -69.42 | 45.64 | -69.82 | 44.42 | -69.74 | 45.97 | -69.1 | 44.79 | -69.02 | ESP | MARS | 1362096156:230 | 294.0 | 1.877 | 197/202/197 | 0 | 25.36 | 43.16 | 252.6 | 3631.28 | 253.48 | N | 279.93 | 230.37 | 96.49 | 12.74 | 46.17 | -69.47 | 243271024.8 | 30.8 | 15.42 | 90.1 | Southern autumn frost streak area in Viking 2 ... | OK | 77781 | U17_077781_1107 | U17 |
142364 | MROX_4656 | DATA/U17_077781_1560_XN_24S055W.IMG | 4A_04_118A04B400 | U17_077781_1560_XN_24S055W | 2023-03-01 00:15:17.076 | CTX | NIFL | 5056 | 30720 | 1 | 5.13 | 1.19 | 0.09 | 56.84 | 56.78 | 55.44 | -24.08 | 55.48 | -25.67 | 55.0 | -25.62 | 55.88 | -22.55 | 55.41 | -22.5 | ESP | MARS | 1362096976:036 | 293.9 | 1.877 | 197/202/197 | 0 | 25.68 | 186.57 | 256.54 | 3649.44 | 256.54 | N | 276.89 | 222.28 | 99.9 | 12.74 | 55.44 | -24.08 | 243270437.8 | 30.81 | 14.96 | 90.2 | Ride-along with HiRISE | OK | 77781 | U17_077781_1560 | U17 |
142365 | MROX_4656 | DATA/U17_077781_1683_XN_11S057W.IMG | 4A_04_118A04B500 | U17_077781_1683_XN_11S057W | 2023-03-01 00:19:04.486 | CTX | NIFL | 5056 | 31744 | 1 | 5.22 | 1.16 | 0.09 | 49.82 | 49.76 | 57.0 | -11.71 | 57.03 | -13.35 | 56.58 | -13.29 | 57.42 | -10.12 | 56.98 | -10.06 | ESP | MARS | 1362097203:141 | 293.8 | 1.877 | 197/202/197 | 0 | 26.13 | 192.71 | 260.84 | 3656.22 | 260.84 | N | 277.01 | 214.98 | 100.83 | 12.74 | 57.0 | -11.7 | 243270441.7 | 30.81 | 14.91 | 90.2 | Terrain north of Coprates Chasma | OK | 77781 | U17_077781_1683 | U17 |
142366 | MROX_4656 | DATA/U17_077781_2027_XI_22N061W.IMG | 4A_04_118B04B600 | U17_077781_2027_XI_22N061W | 2023-03-01 00:29:24.818 | CTX | ITL | 5056 | 52224 | 1 | 5.65 | 1.06 | 3.5 | 41.56 | 38.06 | 60.96 | 22.8 | 60.88 | 20.15 | 60.38 | 20.21 | 61.56 | 25.4 | 61.04 | 25.45 | ESP | MARS | 1362097823:226 | 293.8 | 1.877 | 197/202/197 | 0 | 28.27 | 312.92 | 281.46 | 3674.69 | 281.94 | N | 276.85 | 180.29 | 103.42 | 12.74 | 61.25 | 22.78 | 243271031.7 | 30.81 | 14.82 | 89.8 | Kasei Valles region | OK | 77781 | U17_077781_2027 | U17 |
142367 | MROX_4656 | DATA/U17_077781_2440_XN_64N067W.IMG | 4A_04_118A04B700 | U17_077781_2440_XN_64N067W | 2023-03-01 00:43:08.662 | CTX | NIFL | 5056 | 7168 | 1 | 6.22 | 0.94 | 5.41 | 58.1 | 53.88 | 67.74 | 64.07 | 68.23 | 63.68 | 67.05 | 63.75 | 68.44 | 64.38 | 67.23 | 64.45 | ESP | MARS | 1362098647:186 | 293.8 | 1.877 | 197/202/197 | 0 | 31.15 | 41.8 | 309.79 | 3689.87 | 311.07 | N | 277.1 | 143.31 | 106.59 | 12.74 | 68.76 | 64.02 | 243272920.6 | 30.82 | 14.59 | 89.9 | Ride-along with HiRISE | OK | 77781 | U17_077781_2440 | U17 |
142368 rows × 53 columns
CTXEDR
CTXEDR (pid:str, root:str='', with_volume=None, with_pid_folder=None, refresh_index=False)
Manage access to EDR data
Type | Default | Details | |
---|---|---|---|
pid | str | CTX product id (pid) | |
root | str | alternative root folder for EDR data | |
with_volume | NoneType | None | does the storage path include the volume folder |
with_pid_folder | NoneType | None | control if stuff is stored inside PID folders |
refresh_index | bool | False |
PRODUCT_IDs can be provided in the shortened form (still unique), which are the first 15 characters of the full PRODUCT_ID:
= "F10_039666_1383"
pid = "B01_009958_1524_XI_27S347W" pid
= CTXEDR(pid) edr
CTXEDR.pid
CTXEDR.pid ()
Return product_id
edr.pid
'B01_009958_1524_XI_27S347W'
edr.short_pid
'B01_009958_1524'
These are the storage configuration settings:
edr.root
Path('/home/maye/big_drive/planetary_data/missions/mro/ctx/edr')
edr.with_pid_folder
True
edr.with_volume
True
CTXEDR.source_folder
CTXEDR.source_folder ()
Calculate the source folder based on storage options with_pid_folder
and with_volume
.
edr.source_folder
Path('/home/maye/big_drive/planetary_data/missions/mro/ctx/edr/mrox_0684/B01_009958_1524_XI_27S347W')
CTXEDR.source_path
CTXEDR.source_path ()
Combine source_folder
with pid
into full path.
edr.source_path
Path('/home/maye/big_drive/planetary_data/missions/mro/ctx/edr/mrox_0684/B01_009958_1524_XI_27S347W/B01_009958_1524_XI_27S347W.IMG')
edr.source_path.exists()
False
CTXEDR.meta
CTXEDR.meta ()
get the metadata from the index table
edr.meta
volume_id MROX_0684
file_specification_name DATA/B01_009958_1524_XI_27S347W.IMG
original_product_id 4A_04_103100F800
product_id B01_009958_1524_XI_27S347W
image_time 2008-09-10 10:15:05.533000
instrument_id CTX
instrument_mode_id ITL
line_samples 5056
lines 18432
spatial_summing 1
scaled_pixel_width 5.13
pixel_aspect_ratio 1.18
emission_angle 1.08
incidence_angle 71.46
phase_angle 70.61
center_longitude 347.59
center_latitude -27.64
upper_left_longitude 347.71
upper_left_latitude -28.6
upper_right_longitude 347.22
upper_right_latitude -28.55
lower_left_longitude 347.96
lower_left_latitude -26.73
lower_right_longitude 347.47
lower_right_latitude -26.68
mission_phase_name PSP
target_name MARS
spacecraft_clock_start_count 0905508925:217
focal_plane_temperature 292.8
line_exposure_duration 1.877
offset_mode_id 196/190/181
sample_first_pixel 0
scaled_image_width 25.69
scaled_image_height 111.85
spacecraft_altitude 256.72
target_center_distance 3648.65
slant_distance 256.76
usage_note N
north_azimuth 276.86
sub_solar_azimuth 223.2
sub_solar_longitude 42.32
sub_solar_latitude 20.59
sub_spacecraft_longitude 347.68
sub_spacecraft_latitude -27.64
solar_distance 239051686.0
solar_longitude 125.14
local_time 15.66
image_skew_angle 90.2
rationale_desc Valley trace in northern Noachis Terra
data_quality_desc OK
orbit_number 9958
short_pid B01_009958_1524
month_col B01
Name: 16153, dtype: object
CTXEDR.url
CTXEDR.url ()
Calculate URL from input dataframe row.
CTXEDR.download
CTXEDR.download (overwrite=False)
Download and store correctly the EDR data, if not locally available.
Type | Default | Details | |
---|---|---|---|
overwrite | bool | False | use overwrite to download in all cases. |
edr.download()
edr.source_path
Path('/home/maye/big_drive/planetary_data/missions/mro/ctx/edr/mrox_0684/B01_009958_1524_XI_27S347W.IMG')
CTXEDR.__str__
CTXEDR.__str__ ()
Show some info about yourself when returned in a REPL (like ipython/jupyter).
"mro.ctx.preproc_root")) Path(config.get_value(
Path('/remote/trove/geo/planet/Mars/CTX/special/cal_noflat')
CTX
CTX (id_:str, source_dir:str='', proc_root:str='', with_volume=None, with_pid_folder=None, use_preproc=False)
*Class to manage dealing with CTX data.
HAS a CTXEDR attribute as defined above. Attributes from CTXEDR are availalbe via getattr()*
Type | Default | Details | |
---|---|---|---|
id_ | str | CTX product id | |
source_dir | str | where the raw EDR data is stored, if not coming from plpy | |
proc_root | str | where to store processed, if not plpy | |
with_volume | NoneType | None | store with extra volume subfolder? |
with_pid_folder | NoneType | None | store with extra product_id subfolder? |
use_preproc | bool | False | use preproc for cal_da |
= "N05_064260_1638_XI_16S351W" pid
= CTX(pid) ctx
ctx.save_as_tif()
File exists. Use `refresh=True` to force recreation.
str(ctx.map_path)
'/home/ayek72/mnt/slowdata/planetarypy/missions/mro/ctx/edr/mrox_3629/N05_064260_1638_XI_16S351W/N05_064260_1638_XI_16S351W.lev2.cub'
/ ctx.map_name.with_suffix(".tif") ctx.proc_folder
Path('/home/ayek72/mnt/slowdata/planetarypy/missions/mro/ctx/edr/mrox_3629/N05_064260_1638_XI_16S351W/N05_064260_1638_XI_16S351W.lev2.tif')
ctx.cal_da
<xarray.DataArray 'N05_064260_1638 calibrated' (y: 15360, x: 5000)> [76800000 values with dtype=float32] Coordinates: * x (x) float64 0.5 1.5 2.5 3.5 ... 4.996e+03 4.998e+03 4.998e+03 5e+03 * y (y) float64 0.5 1.5 2.5 3.5 ... 1.536e+04 1.536e+04 1.536e+04 Attributes: BANDWIDTH: 0.15 BANDWIDTH_UNIT: micrometers WAVELENGTH: 0.65 WAVELENGTH_UNIT: micrometers scale_factor: 1.0 add_offset: 0.0 long_name: BroadBand
ctx.preproc_cal_path
Path('/remote/trove/geo/planet/Mars/CTX/special/cal_noflat/mrox_3629/N05_064260_1638_XI_16S351W.ctxcal.cub')
Based on storage options with_pid_folder
and with_volume
, we calculate the proc_folder
for self-processed data:
CTX.proc_folder
CTX.proc_folder ()
the folder for foreign processed data, like pre-processed calibrated data, e.g.
ctx.proc_folder
Path('/home/ayek72/mnt/slowdata/planetarypy/missions/mro/ctx/edr/mrox_3629/N05_064260_1638_XI_16S351W')
These can be changed at object creation:
=True, with_pid_folder=True).source_folder CTX(pid, with_volume
Path('/remote/trove/geo/planet/Mars/CTX/pds/mrox_3629')
CTX.cal_path
CTX.cal_path ()
Path to calibrated cube file. Also destriped files get this name.
ctx.cal_path
Path('/home/ayek72/mnt/slowdata/planetarypy/missions/mro/ctx/edr/mrox_3629/N05_064260_1638_XI_16S351W/N05_064260_1638_XI_16S351W.cal.cub')
CTX.calib_pipeline
CTX.calib_pipeline (overwrite=False)
Execute the whole ISIS pipeline for CTX EDR data.
ctx.proc_folder
Path('/home/ayek72/mnt/slowdata/planetarypy/missions/mro/ctx/edr/mrox_3629/N05_064260_1638_XI_16S351W')
ctx.isis_import()
="yes") ctx.spice_init(web
ctx.calibrate()
ctx.destripe()
# not executing always, as it takes lot of time
# ctx.map_project()
ctx.map_path
ctx.calib_pipeline()
CTX.plot_edr
CTX.plot_edr ()
Plot EDR xarray using hvplot.
ctx.plot_edr()
Note the different shape of EDR data and calibrated data. A few SAMPLES are being used for calibration.
ctx.edr_shape
(15360, 5056)
ctx.cal_shape
(15360, 5000)
ctx.plot_calibrated()
CTXCollection
CTXCollection (product_ids, full_width=False, filter_error=False, edrindex=None)
*Class with several helpful methods to work with a set of CTX images.
We identify the images via a list of product_ids. Several methods manipulate this list based on the requested constraint.*
The CTXCollection
class offers a few class methods for a wider range of finding CTX product_ids from the index file:
CTXCollection.by_volume
CTXCollection.by_volume (vol_id, **kwargs)
Create a CTXCollection from the PDS volume number.
4114).n_items CTXCollection.by_volume(
30
4114, full_width=True).n_items CTXCollection.by_volume(
19
4114, full_width=True, filter_error=True).n_items CTXCollection.by_volume(
14
4114, full_width=False, filter_error=True).n_items CTXCollection.by_volume(
23
CTXCollection.by_month
CTXCollection.by_month (month_letters, nth_volume=None, **kwargs)
Create a CTXCollection based on the first 3 letters of the product_id (a.k.a. “month”)
"J18", filter_error=True, full_width=True).n_items CTXCollection.by_month(
287
CTXCollection.volume_from_pid
CTXCollection.volume_from_pid (pid, **kwargs)
Get a CTXCollection of the volume for a given image (product_id).
We define an example list of product_id
s:
= get_edr_index().sample(3, random_state=41).PRODUCT_ID
ids ids
41779 G16_024548_2195_XI_39N161W
33475 G02_018931_1907_XI_10N166W
45075 G20_026104_2617_XN_81N181W
Name: PRODUCT_ID, dtype: string
0]).n_items # getting the whole volume here CTXCollection.volume_from_pid(ids.values[
56
= CTXCollection(ids) coll
coll.edr_exist_check()
[('G02_018931_1907_XI_10N166W', True),
('G16_024548_2195_XI_39N161W', True),
('G20_026104_2617_XN_81N181W', True)]
coll.get_urls()
[URL('https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_1200/data/G02_018931_1907_XI_10N166W.IMG'),
URL('https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_1422/data/G16_024548_2195_XI_39N161W.IMG'),
URL('https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_1532/data/G20_026104_2617_XN_81N181W.IMG')]
The next command launches a parallel download:
=False) coll.download_collection(overwrite
Downloading collection...
File exists. Use `overwrite=True` to download fresh.
File exists. Use `overwrite=True` to download fresh.
File exists. Use `overwrite=True` to download fresh.
This is performing the ISIS import and calibration in parallel:
coll.calibrate_collection()
coll.calib_exist_check()
[('G02_018931_1907_XI_10N166W', False),
('G16_024548_2195_XI_39N161W', False),
('G20_026104_2617_XN_81N181W', False)]
= CTXCollection.by_volume(4114) coll
coll.product_ids
<StringArray>
['N20_069979_1676_XI_12S177W', 'N20_069980_1676_XI_12S205W',
'N20_069981_1919_XI_11N234W', 'N20_069982_1380_XI_42S255W',
'N20_069982_1820_XI_02N261W', 'N20_069982_2287_XN_48N269W',
'N20_069983_1442_XI_35S283W', 'N20_069984_1686_XI_11S313W',
'N20_069984_2097_XI_29N319W', 'N20_069985_2064_XI_26N345W',
'N20_069986_2025_XI_22N012W', 'N20_069987_2243_XN_44N042W',
'N20_069991_1451_XI_34S142W', 'N20_069991_1940_XI_14N149W',
'N20_069992_1761_XI_03S173W', 'N20_069993_1724_XI_07S200W',
'N20_069994_1753_XI_04S227W', 'N20_069995_1633_XI_16S254W',
'N20_069995_2028_XI_22N258W', 'N20_069996_2085_XN_28N285W',
'N20_069997_1479_XI_32S306W', 'N20_069999_1558_XI_24S003W',
'N20_070004_1931_XI_13N144W', 'N20_070006_1430_XI_37S191W',
'N20_070007_1793_XI_00S223W', 'N20_070009_2018_XN_21N282W',
'N20_070010_1466_XI_33S301W', 'N20_070011_1507_XI_29S328W',
'N20_070011_2252_XI_45N338W', 'N20_070012_1824_XN_02N001W']
Length: 30, dtype: string
CTXCollection.get_corrupted
CTXCollection.get_corrupted ()
Return the product_ids where the PDS index file has an ‘ERROR’ flag for the DATA_QUALITY_DESC
field.
coll.get_corrupted()
['N20_069991_1451_XI_34S142W',
'N20_069992_1761_XI_03S173W',
'N20_069993_1724_XI_07S200W',
'N20_069994_1753_XI_04S227W',
'N20_069997_1479_XI_32S306W',
'N20_070010_1466_XI_33S301W',
'N20_070012_1824_XN_02N001W']
CTXCollection.n_items
CTXCollection.n_items ()
Return length of product_ids list.
coll.n_items
30
CTXCollection.sample
CTXCollection.sample (n)
Return random sample of product_ids, size n
.
4) coll.sample(
['N20_070006_1430_XI_37S191W',
'N20_069999_1558_XI_24S003W',
'N20_069986_2025_XI_22N012W',
'N20_069983_1442_XI_35S283W']
CTXCollection.meta
CTXCollection.meta ()
Return the index file filtered for the given product_ids.
coll.meta.head()
VOLUME_ID | FILE_SPECIFICATION_NAME | ORIGINAL_PRODUCT_ID | PRODUCT_ID | IMAGE_TIME | INSTRUMENT_ID | INSTRUMENT_MODE_ID | LINE_SAMPLES | LINES | SPATIAL_SUMMING | SCALED_PIXEL_WIDTH | PIXEL_ASPECT_RATIO | EMISSION_ANGLE | INCIDENCE_ANGLE | PHASE_ANGLE | CENTER_LONGITUDE | CENTER_LATITUDE | UPPER_LEFT_LONGITUDE | UPPER_LEFT_LATITUDE | UPPER_RIGHT_LONGITUDE | UPPER_RIGHT_LATITUDE | LOWER_LEFT_LONGITUDE | LOWER_LEFT_LATITUDE | LOWER_RIGHT_LONGITUDE | LOWER_RIGHT_LATITUDE | MISSION_PHASE_NAME | TARGET_NAME | SPACECRAFT_CLOCK_START_COUNT | FOCAL_PLANE_TEMPERATURE | LINE_EXPOSURE_DURATION | OFFSET_MODE_ID | SAMPLE_FIRST_PIXEL | SCALED_IMAGE_WIDTH | SCALED_IMAGE_HEIGHT | SPACECRAFT_ALTITUDE | TARGET_CENTER_DISTANCE | SLANT_DISTANCE | USAGE_NOTE | NORTH_AZIMUTH | SUB_SOLAR_AZIMUTH | SUB_SOLAR_LONGITUDE | SUB_SOLAR_LATITUDE | SUB_SPACECRAFT_LONGITUDE | SUB_SPACECRAFT_LATITUDE | SOLAR_DISTANCE | SOLAR_LONGITUDE | LOCAL_TIME | IMAGE_SKEW_ANGLE | RATIONALE_DESC | DATA_QUALITY_DESC | ORBIT_NUMBER | short_pid | month_col | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
127546 | MROX_4114 | DATA/N20_069979_1676_XI_12S177W.IMG | 4A_04_1165000100 | N20_069979_1676_XI_12S177W | 2021-07-01 02:22:53.651 | CTX | ITL | 5056 | 43008 | 1 | 5.3 | 1.14 | 5.3 | 65.18 | 61.08 | 177.4 | -12.53 | 177.37 | -14.74 | 176.91 | -14.69 | 177.89 | -10.37 | 177.43 | -10.32 | ESP | MARS | 1309573428:228 | 291.3 | 1.877 | 196/188/183 | 0 | 26.53 | 260.74 | 262.71 | 3657.97 | 263.76 | N | 276.79 | 219.82 | 233.3 | 23.12 | 177.78 | -12.56 | 249116269.6 | 65.97 | 15.72 | 90.2 | Northern Terra Sirenum | OK | 69979 | N20_069979_1676 | N20 |
127547 | MROX_4114 | DATA/N20_069980_1676_XI_12S205W.IMG | 4A_04_1165000200 | N20_069980_1676_XI_12S205W | 2021-07-01 04:15:32.600 | CTX | ITL | 5056 | 18432 | 1 | 5.26 | 1.15 | 2.48 | 64.99 | 63.03 | 204.93 | -12.5 | 205.04 | -13.46 | 204.59 | -13.41 | 205.26 | -11.59 | 204.81 | -11.53 | ESP | MARS | 1309580187:215 | 290.9 | 1.877 | 196/188/183 | 0 | 26.34 | 111.73 | 262.54 | 3657.8 | 262.77 | N | 276.75 | 219.87 | 260.62 | 23.13 | 205.11 | -12.51 | 249117636.2 | 66.0 | 15.71 | 90.1 | Valleys in Terra Cimmeria | OK | 69980 | N20_069980_1676 | N20 |
127548 | MROX_4114 | DATA/N20_069981_1919_XI_11N234W.IMG | 4A_04_1165000300 | N20_069981_1919_XI_11N234W | 2021-07-01 06:14:46.674 | CTX | ITL | 5056 | 52224 | 1 | 5.62 | 1.07 | 8.13 | 53.43 | 46.2 | 234.64 | 11.91 | 234.58 | 9.25 | 234.1 | 9.3 | 235.2 | 14.52 | 234.71 | 14.57 | ESP | MARS | 1309587341:234 | 291.1 | 1.877 | 196/188/183 | 0 | 28.12 | 314.36 | 275.31 | 3670.67 | 277.89 | N | 276.65 | 206.74 | 289.76 | 23.14 | 235.27 | 11.85 | 249118514.0 | 66.04 | 15.66 | 90.0 | Nepenthes Planum region | OK | 69981 | N20_069981_1919 | N20 |
127549 | MROX_4114 | DATA/N20_069982_1380_XI_42S255W.IMG | 4A_04_1165000400 | N20_069982_1380_XI_42S255W | 2021-07-01 07:50:56.614 | CTX | ITL | 2528 | 7168 | 2 | 10.25 | 1.19 | 4.87 | 83.98 | 80.5 | 255.35 | -42.07 | 255.52 | -42.83 | 254.94 | -42.77 | 255.75 | -41.37 | 255.18 | -41.32 | ESP | MARS | 1309593111:219 | 291.2 | 1.884 | 196/188/183 | 0 | 25.65 | 87.09 | 254.99 | 3642.26 | 255.85 | N | 276.84 | 225.48 | 313.02 | 23.14 | 255.8 | -42.1 | 249121323.6 | 66.07 | 15.84 | 90.1 | Apron in the Hellas Montes region | OK | 69982 | N20_069982_1380 | N20 |
127550 | MROX_4114 | DATA/N20_069982_1820_XI_02N261W.IMG | 4A_04_1165000500 | N20_069982_1820_XI_02N261W | 2021-07-01 08:03:55.615 | CTX | ITL | 5056 | 52224 | 1 | 5.42 | 1.11 | 5.11 | 57.47 | 53.17 | 261.02 | 2.02 | 260.94 | -0.66 | 260.49 | -0.6 | 261.57 | 4.63 | 261.11 | 4.69 | ESP | MARS | 1309593890:219 | 291.0 | 1.877 | 196/188/183 | 0 | 27.13 | 315.79 | 268.72 | 3664.89 | 269.71 | N | 276.84 | 213.19 | 316.33 | 23.14 | 261.4 | 1.98 | 249120029.2 | 66.07 | 15.67 | 90.1 | Tyrrhena Terra | OK | 69982 | N20_069982_1820 | N20 |
CTXCollection.image_times
CTXCollection.image_times ()
Return the image observation times.
coll.image_times
127546 2021-07-01 02:22:53.651
127547 2021-07-01 04:15:32.600
127548 2021-07-01 06:14:46.674
127549 2021-07-01 07:50:56.614
127550 2021-07-01 08:03:55.615
127551 2021-07-01 08:19:18.963
127552 2021-07-01 09:44:54.631
127553 2021-07-01 11:44:29.607
127554 2021-07-01 11:57:15.646
127555 2021-07-01 13:48:19.595
127556 2021-07-01 15:39:04.638
127557 2021-07-01 17:38:53.212
127558 2021-07-02 00:42:16.641
127559 2021-07-02 00:57:36.688
127560 2021-07-02 02:44:15.621
127561 2021-07-02 04:35:30.668
127562 2021-07-02 06:28:38.621
127563 2021-07-02 08:16:50.660
127564 2021-07-02 08:29:27.601
127565 2021-07-02 10:23:41.558
127566 2021-07-02 11:56:54.648
127567 2021-07-02 15:43:37.659
127568 2021-07-03 01:16:03.651
127569 2021-07-03 04:45:28.607
127570 2021-07-03 06:48:35.596
127571 2021-07-03 10:40:22.119
127572 2021-07-03 12:14:51.615
127573 2021-07-03 14:08:48.673
127574 2021-07-03 14:31:39.582
127575 2021-07-03 16:10:56.454
Name: IMAGE_TIME, dtype: datetime64[ns]
Also cool: pandas
can do time-average:
coll.image_times.mean()
Timestamp('2021-07-02 05:45:11.936933376')
CTXCollection.get_ctx_n
CTXCollection.get_ctx_n (n)
Get CTX object for n-th product_id
2) coll.get_ctx_n(
PRODUCT_ID: N20_069981_1919_XI_11N234W
URL: https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_4114/data/N20_069981_1919_XI_11N234W.IMG
source_path: /remote/trove/geo/planet/Mars/CTX/pds/mrox_4114/N20_069981_1919_XI_11N234W.IMG
Shape: (52224, 5056)
CTXCollection.get_pid_n
CTXCollection.get_pid_n (n)
Get pid for n-th entry in product_ids.
2) coll.get_pid_n(
'N20_069981_1919_XI_11N234W'
= CTXCollection.by_month("N21") coll
len(coll.product_ids)
342
coll
# of product IDs: 342
Volumes contained in list of product_ids:
<StringArray>
['MROX_4126', 'MROX_4127', 'MROX_4128', 'MROX_4129', 'MROX_4130', 'MROX_4131',
'MROX_4132', 'MROX_4133']
Length: 8, dtype: string
Command line interfaces
ctx_calib
ctx_calib (pid:str, source:str='', proc_root:str='', overwrite:bool=False)
Type | Default | Details | |
---|---|---|---|
pid | str | CTX product_id | |
source | str | path to where EDRs are stored if not from plpy | |
proc_root | str | path to where processed data is to be stored | |
overwrite | bool | False | overwrite processed data |
=True) ctx_calib(pid, overwrite
from nbdev import nbdev_export
nbdev_export()